backlog
|
@ -1,10 +1,10 @@
|
|||
local HOME = os.getenv("HOME")
|
||||
|
||||
return {
|
||||
terminal = "wezterm",
|
||||
terminal = HOME .. "/.local/bin/wezterm",
|
||||
terminal_separator = "start",
|
||||
editor = "nvim",
|
||||
launcher = "rofi -show combi",
|
||||
screenshot = HOME .. "/.local/bin/screenie",
|
||||
modkey = "Mod4",
|
||||
theme = "tokyo_night",
|
||||
font = "Terminus 8",
|
||||
|
@ -16,10 +16,19 @@ return {
|
|||
"fair",
|
||||
"fair.horizontal",
|
||||
"floating",
|
||||
},
|
||||
autostart = {
|
||||
"xrdb " .. HOME .. "/.config/xrdb/main.xrdb",
|
||||
"xrdb -merge " .. HOME .. "/.config/xrdb/colors/tokyonight.xrdb",
|
||||
"sh ~/.local/generic_autostart.sh",
|
||||
-- "spiral",
|
||||
-- "spiral.dwindle",
|
||||
"tile.right",
|
||||
-- "tile.bottom",
|
||||
-- "tile.left",
|
||||
-- "tile.top",
|
||||
-- "corner.ne",
|
||||
-- "corner.se",
|
||||
-- "corner.sw",
|
||||
-- "corner.nw",
|
||||
-- "lain:termfair",
|
||||
-- "lain:termfair.center",
|
||||
-- "lain:centerwork",
|
||||
-- "lain:centerwork.horizontal",
|
||||
},
|
||||
}
|
||||
|
|
1
linux/.config/awesome/cyclefocus
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit d7c8390052631f0fd9183b704a520ae5d40ad310
|
|
@ -1,7 +1,7 @@
|
|||
return function(path, theme)
|
||||
-- Define the image to load
|
||||
theme.menu_submenu_icon = path .. "/submenu.png"
|
||||
|
||||
-- titlebar
|
||||
theme.titlebar_close_button_normal = path .. "/titlebar/close.png"
|
||||
theme.titlebar_close_button_focus = path .. "/titlebar/close.png"
|
||||
|
||||
|
@ -28,7 +28,7 @@ return function(path, theme)
|
|||
theme.titlebar_maximized_button_normal_active = path .. "/titlebar/maximized_active.png"
|
||||
theme.titlebar_maximized_button_focus_active = path .. "/titlebar/maximized_active.png"
|
||||
|
||||
-- You can use your own layout icons like this:
|
||||
-- layouts
|
||||
theme.layout_fairh = path .. "/layouts/fairh.png"
|
||||
theme.layout_fairv = path .. "/layouts/fairv.png"
|
||||
theme.layout_floating = path .. "/layouts/floating.png"
|
||||
|
@ -45,4 +45,12 @@ return function(path, theme)
|
|||
theme.layout_cornerne = path .. "/layouts/cornerne.png"
|
||||
theme.layout_cornersw = path .. "/layouts/cornersw.png"
|
||||
theme.layout_cornerse = path .. "/layouts/cornerse.png"
|
||||
|
||||
-- layouts (lain)
|
||||
theme.layout_termfair = path .. "/layouts/lain/termfair.png"
|
||||
theme.layout_centerfair = path .. "/layouts/lain/centerfair.png"
|
||||
theme.layout_cascade = path .. "/layouts/lain/cascade.png"
|
||||
theme.layout_cascadetile = path .. "/layouts/lain/cascadetile.png"
|
||||
theme.layout_centerwork = path .. "/layouts/lain/centerwork.png"
|
||||
theme.layout_centerworkh = path .. "/layouts/lain/centerworkh.png"
|
||||
end
|
||||
|
|
BIN
linux/.config/awesome/icons/bar/net_down.png
Normal file
After Width: | Height: | Size: 615 B |
BIN
linux/.config/awesome/icons/bar/net_up.png
Normal file
After Width: | Height: | Size: 609 B |
BIN
linux/.config/awesome/icons/bar/packages.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
linux/.config/awesome/icons/layouts/lain/cascade.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
linux/.config/awesome/icons/layouts/lain/cascadetile.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
linux/.config/awesome/icons/layouts/lain/centerfair.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
linux/.config/awesome/icons/layouts/lain/centerwork.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
linux/.config/awesome/icons/layouts/lain/centerworkh.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
linux/.config/awesome/icons/layouts/lain/termfair.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
|
@ -15,6 +15,7 @@ local naughty = require("naughty")
|
|||
local menubar = require("menubar")
|
||||
local lain = require("lain")
|
||||
local freedesktop = require("freedesktop")
|
||||
local cyclefocus = require("cyclefocus")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
-- Enable hotkeys help widget for VIM and other apps
|
||||
-- when client with a matching name is opened:
|
||||
|
@ -69,9 +70,12 @@ local terminal = config.terminal or "xterm"
|
|||
local terminal_separator = config.terminal_separator or "-e"
|
||||
local editor = config.editor or os.getenv("EDITOR") or "nano"
|
||||
local editor_cmd = terminal .. " " .. terminal_separator .. " " .. editor
|
||||
local screenshot = config.screenshot
|
||||
local modkey = config.modkey or "Mod4"
|
||||
local altkey = config.altkey or "Mod1"
|
||||
|
||||
cyclefocus.move_mouse_pointer = false
|
||||
|
||||
-- Themes define colours, icons, font and wallpapers.
|
||||
do
|
||||
local theme = require("themes/".. config.theme)
|
||||
|
@ -102,6 +106,19 @@ do
|
|||
theme = beautiful.theme_assets.recolor_titlebar(theme, theme.fg_focus, "focus")
|
||||
theme = beautiful.theme_assets.recolor_layout(theme, theme.layout_fg)
|
||||
|
||||
local lain_layouts = {
|
||||
"termfair",
|
||||
"centerfair",
|
||||
"cascade",
|
||||
"cascadetile",
|
||||
"centerwork",
|
||||
"centerworkh"
|
||||
}
|
||||
for _, key in ipairs(lain_layouts) do
|
||||
local image = gears.surface.duplicate_surface(theme["layout_" .. key])
|
||||
theme["layout_" .. key] = gears.color.recolor_image(image, theme.layout_fg)
|
||||
end
|
||||
|
||||
do
|
||||
local image = gears.surface.duplicate_surface(theme.menu_submenu_icon)
|
||||
theme.menu_submenu_icon = gears.color.recolor_image(image, theme.menu_fg_normal)
|
||||
|
@ -144,6 +161,18 @@ do
|
|||
path = "music",
|
||||
color = theme.widget_music,
|
||||
},
|
||||
packages = {
|
||||
path = "packages",
|
||||
color = theme.widget_packages,
|
||||
},
|
||||
net_up = {
|
||||
path = "net_up",
|
||||
color = theme.widget_net_up,
|
||||
},
|
||||
net_down = {
|
||||
path = "net_down",
|
||||
color = theme.widget_net_down,
|
||||
},
|
||||
}
|
||||
|
||||
for key, icon in pairs(bar_icons) do
|
||||
|
@ -163,14 +192,20 @@ end
|
|||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
awful.layout.layouts = {}
|
||||
for _, layout in ipairs(config.layouts) do
|
||||
local layoutRef = awful.layout.suit
|
||||
if layout:find("^lain:") then
|
||||
layoutRef = lain.layout
|
||||
layout = layout:gsub("^lain:","")
|
||||
end
|
||||
|
||||
if layout:find("%.") then
|
||||
local perStart, perEnd = layout:find("%.")
|
||||
local first = layout:sub(1, perStart - 1)
|
||||
local second = layout:sub(perEnd + 1, #layout)
|
||||
|
||||
table.insert(awful.layout.layouts, awful.layout.suit[first][second])
|
||||
table.insert(awful.layout.layouts, layoutRef[first][second])
|
||||
else
|
||||
table.insert(awful.layout.layouts, awful.layout.suit[layout])
|
||||
table.insert(awful.layout.layouts, layoutRef[layout])
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
|
@ -295,7 +330,21 @@ local function makeBarIcon(icon)
|
|||
end
|
||||
|
||||
-- Widgets
|
||||
local volume_icon = makeBarIcon("volume")
|
||||
local clock = wibox.widget.textclock(markup(beautiful.widget_clock or beautiful.wibar_fg, "%H:%M:%S"), 1)
|
||||
local calendar = lain.widget.cal({
|
||||
attach_to = {clock},
|
||||
week_start = 1,
|
||||
week_number = "left",
|
||||
followtag = true,
|
||||
icons = "",
|
||||
notification_preset = {
|
||||
font = config.font,
|
||||
fg = beautiful.notification_fg,
|
||||
bg = beautiful.notification_bg,
|
||||
},
|
||||
})
|
||||
|
||||
--[[local volume_icon = makeBarIcon("volume")
|
||||
local volume = lain.widget.alsa({
|
||||
settings = function()
|
||||
if volume_now.status == "off" then
|
||||
|
@ -324,7 +373,7 @@ local volume_buttons = awful.util.table.join(
|
|||
end)
|
||||
)
|
||||
volume.widget:buttons(volume_buttons)
|
||||
volume_icon:buttons(volume_buttons)
|
||||
volume_icon:buttons(volume_buttons)--]]
|
||||
|
||||
local memory = lain.widget.mem({
|
||||
settings = function()
|
||||
|
@ -338,28 +387,157 @@ local cpu = lain.widget.cpu({
|
|||
end
|
||||
})
|
||||
|
||||
local cpu_temp = lain.widget.temp({
|
||||
settings = function()
|
||||
widget:set_markup(markup(beautiful.widget_cpu or beautiful.wibar_fg, coretemp_now .. " °C"))
|
||||
end
|
||||
})
|
||||
|
||||
local music_icon = makeBarIcon("music")
|
||||
local music = wibox.widget.textbox()
|
||||
local cpu_temp = wibox.widget.textbox()
|
||||
awful.widget.watch(
|
||||
'bash -c "~/.config/awesome/scripts/cmus.sh"',
|
||||
'bash -c "cat /sys/class/hwmon/hwmon1/temp1_input"',
|
||||
1,
|
||||
function(widget, stdout, stderr)
|
||||
if stdout == "<not running>" then
|
||||
music_icon._private.image = nil
|
||||
music_icon:emit_signal("widget::redraw_needed")
|
||||
music_icon:emit_signal("widget::layout_changed")
|
||||
widget:set_markup(markup(beautiful.widget_cpu or beautiful.wibar_fg, math.floor(tonumber(stdout) / 1000) .. "°C"))
|
||||
end,
|
||||
cpu_temp
|
||||
)
|
||||
|
||||
local gpu = wibox.widget.textbox()
|
||||
awful.widget.watch(
|
||||
'bash -c "radeontop -d - -l 1"',
|
||||
1,
|
||||
function(widget, stdout, stderr)
|
||||
local usage = math.floor(tonumber(stdout:match("gpu (.-)%%")))
|
||||
local vram = math.floor(tonumber(stdout:match("vram .- (.-)mb")))
|
||||
|
||||
widget:set_markup(markup(beautiful.widget_gpu or beautiful.wibar_fg, usage .. "%, " .. vram .. " MB"))
|
||||
end,
|
||||
gpu
|
||||
)
|
||||
|
||||
local gpu_temp = wibox.widget.textbox()
|
||||
awful.widget.watch(
|
||||
'bash -c "cat /sys/class/hwmon/hwmon0/temp1_input"',
|
||||
1,
|
||||
function(widget, stdout, stderr)
|
||||
widget:set_markup(markup(beautiful.widget_gpu or beautiful.wibar_fg, math.floor(tonumber(stdout) / 1000) .. "°C"))
|
||||
end,
|
||||
gpu_temp
|
||||
)
|
||||
|
||||
local packages_icon = makeBarIcon("packages")
|
||||
local packages = wibox.widget.textbox()
|
||||
local packages_wrapper = wibox.widget({
|
||||
{
|
||||
packages_icon,
|
||||
packages,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
|
||||
awful.widget.watch(
|
||||
'bash -c "xbps-install -Mun | wc -l"',
|
||||
900,
|
||||
function(widget, stdout, stderr)
|
||||
local count = tonumber(stdout)
|
||||
if count == 0 then
|
||||
packages_wrapper.visible = false
|
||||
|
||||
widget:set_markup("")
|
||||
else
|
||||
music_icon.image = beautiful.bar_music
|
||||
packages_wrapper.visible = true
|
||||
widget:set_markup(markup(beautiful.widget_packages or beautiful.wibar_fg, count .. " pkg" .. (count > 1 and "s" or "")))
|
||||
end
|
||||
end,
|
||||
packages
|
||||
)
|
||||
|
||||
widget:set_markup(markup(beautiful.widget_music, stdout))
|
||||
local function gm_round(num, idp)
|
||||
local mult = 10 ^ (idp or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
local function format_size(size)
|
||||
size = tonumber(size)
|
||||
|
||||
if size <= 0 then return "0" end
|
||||
if size < 1024 then return size .. " B" end
|
||||
if size < 1024 * 1024 then return gm_round(size / 1024, 2) .. " KB" end
|
||||
if size < 1024 * 1024 * 1024 then return gm_round( size / (1024 * 1024), 2) .. " MB" end
|
||||
|
||||
return gm_round(size / (1024 * 1024 * 1024), 2) .. " GB"
|
||||
end
|
||||
|
||||
--[[local net_up_icon = makeBarIcon("net_up")
|
||||
local net_down_icon = makeBarIcon("net_down")
|
||||
local net_down = wibox.widget.textbox()
|
||||
local net_up = lain.widget.net({
|
||||
units = 1,
|
||||
settings = function()
|
||||
widget:set_markup(markup(beautiful.widget_net_up or beautiful.wibar_fg, format_size(net_now.sent)))
|
||||
net_down:set_markup(markup(beautiful.widget_net_down or beautiful.wibar_fg, format_size(net_now.received)))
|
||||
end,
|
||||
})--]]
|
||||
|
||||
local function format_time(time)
|
||||
local out = ""
|
||||
|
||||
if time >= 3600 then
|
||||
out = out .. string.format("%02d:", math.floor(time / 3600))
|
||||
end
|
||||
|
||||
out = out .. string.format("%02d:%02d", math.floor(time % 3600 / 60), math.floor(time % 60))
|
||||
|
||||
return out
|
||||
end
|
||||
|
||||
local music_icon = makeBarIcon("music")
|
||||
local music = wibox.widget.textbox()
|
||||
local music_wrapper = wibox.widget({
|
||||
{
|
||||
music_icon,
|
||||
music,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
|
||||
awful.widget.watch(
|
||||
'bash -c "~/.config/awesome/scripts/cmus-wrapper.sh"',
|
||||
1,
|
||||
function(widget, stdout, stderr, reason, code)
|
||||
if code ~= 0 then
|
||||
music_wrapper.visible = false
|
||||
|
||||
widget:set_markup("")
|
||||
else
|
||||
music_wrapper.visible = true
|
||||
|
||||
local nowplaying = ""
|
||||
|
||||
local status = stdout:match("status (.-)\n")
|
||||
local duration = tonumber(stdout:match("duration (.-)\n"))
|
||||
local position = tonumber(stdout:match("position (.-)\n"))
|
||||
|
||||
if duration == -1 and stdout:find("stream ") then
|
||||
local stream = stdout:match("stream (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
|
||||
|
||||
nowplaying = stream .. " [" .. format_time(position) .. "]"
|
||||
else
|
||||
local artist = stdout:match("tag artist (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
|
||||
local title = stdout:match("tag title (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
|
||||
|
||||
nowplaying = artist .. " - " .. title .. " [" .. format_time(position) .. "/" .. format_time(duration) .. "]"
|
||||
end
|
||||
|
||||
if status == "stopped" or status == "paused" then
|
||||
nowplaying = nowplaying .. " [" .. status .. "]"
|
||||
end
|
||||
|
||||
widget:set_markup(markup(beautiful.widget_music, gears.string.xml_escape(nowplaying)))
|
||||
end
|
||||
end,
|
||||
music
|
||||
|
@ -445,18 +623,7 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
|
||||
-- Right widgets
|
||||
{
|
||||
{
|
||||
{
|
||||
music_icon,
|
||||
music,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
music_wrapper,
|
||||
{
|
||||
{
|
||||
makeBarIcon("cpu"),
|
||||
|
@ -472,7 +639,31 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
{
|
||||
{
|
||||
makeBarIcon("cpu_temp"),
|
||||
cpu_temp.widget,
|
||||
cpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
makeBarIcon("gpu"),
|
||||
gpu,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
makeBarIcon("gpu_temp"),
|
||||
gpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
|
@ -481,7 +672,6 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
-- TODO: GPU + Temp when not in VM
|
||||
{
|
||||
{
|
||||
makeBarIcon("memory"),
|
||||
|
@ -494,10 +684,10 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
--[[{
|
||||
{
|
||||
volume_icon,
|
||||
volume.widget,
|
||||
net_down_icon,
|
||||
net_down,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
|
@ -506,10 +696,35 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
net_up_icon,
|
||||
net_up.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
packages_wrapper,
|
||||
--[[{
|
||||
{
|
||||
volume_icon,
|
||||
volume.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
{
|
||||
{
|
||||
makeBarIcon("clock"),
|
||||
wibox.widget.textclock(markup(beautiful.widget_clock or beautiful.wibar_fg, "%H:%M:%S"), 1),
|
||||
clock,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
|
@ -623,6 +838,16 @@ globalkeys = gears.table.join(
|
|||
group = "launcher",
|
||||
}
|
||||
),
|
||||
awful.key(
|
||||
{}, "Print",
|
||||
function()
|
||||
awful.spawn(screenshot)
|
||||
end,
|
||||
{
|
||||
description = "run screenshot tool",
|
||||
group = "launcher",
|
||||
}
|
||||
),
|
||||
|
||||
-- client
|
||||
awful.key(
|
||||
|
@ -673,7 +898,7 @@ globalkeys = gears.table.join(
|
|||
group = "client",
|
||||
}
|
||||
),
|
||||
awful.key(
|
||||
--[[awful.key(
|
||||
{altkey}, "Tab",
|
||||
function()
|
||||
awful.client.focus.history.previous()
|
||||
|
@ -685,6 +910,12 @@ globalkeys = gears.table.join(
|
|||
description = "go back",
|
||||
group = "client",
|
||||
}
|
||||
),--]]
|
||||
cyclefocus.key(
|
||||
{altkey}, Tab
|
||||
),
|
||||
cyclefocus.key(
|
||||
{altkey, "Shift"}, Tab
|
||||
),
|
||||
|
||||
-- layout
|
||||
|
@ -884,6 +1115,24 @@ clientkeys = gears.table.join(
|
|||
description = "(un)maximize horizontally",
|
||||
group = "client",
|
||||
}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, "Shift"}, "r",
|
||||
function(c)
|
||||
local scr = awful.screen.focused({client = true})
|
||||
local x = scr.geometry.x + (scr.geometry.width / 2 - 800)
|
||||
local y = scr.geometry.y + (scr.geometry.height / 2 - 450)
|
||||
c:geometry({
|
||||
x = x,
|
||||
y = y,
|
||||
width = 1600,
|
||||
height = 900,
|
||||
})
|
||||
end,
|
||||
{
|
||||
description = "resize to 1600x900",
|
||||
group = "client",
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -1122,7 +1371,28 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n
|
|||
-- }}}
|
||||
|
||||
--{{{ Autostart
|
||||
for _, program in ipairs(config.autostart) do
|
||||
awful.spawn(program)
|
||||
end
|
||||
-- taken from: https://gitlab.com/luna/til/-/blob/main/awesome/rc.lua
|
||||
awful.spawn.with_line_callback(HOME .. "/.local/bin/autostart.sh", {
|
||||
stdout = function(line)
|
||||
--[[naughty.notify({
|
||||
title = "autostart",
|
||||
text = "pid: "..line.." already started",
|
||||
timeout = 7,
|
||||
position = "top_right"
|
||||
})--]]
|
||||
end,
|
||||
exit = function(reason, code)
|
||||
local data = {
|
||||
title = "autostart exited",
|
||||
text = reason .. ' ' .. code,
|
||||
timeout = 4,
|
||||
}
|
||||
|
||||
if reason ~= "exit" and code ~= 0 then
|
||||
data.preset = naughty.config.presets.critical
|
||||
end
|
||||
|
||||
naughty.notify(data)
|
||||
end
|
||||
})
|
||||
--}}}
|
||||
|
|
10
linux/.config/awesome/scripts/cmus-wrapper.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# this only exists to stop socket deadlocking (hopefully)
|
||||
|
||||
if ! pgrep -x cmus ; then
|
||||
echo "cmus-remote: cmus is not running"
|
||||
exit 1
|
||||
else
|
||||
cmus-remote -Q
|
||||
fi
|
|
@ -1,44 +0,0 @@
|
|||
#!/bin/bash
|
||||
if [ "`pgrep -x cmus`" == "" ]; then
|
||||
echo "<not running>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
data="$(cmus-remote -Q)"
|
||||
|
||||
status=$(echo "$data" | awk '/status / {print $2}')
|
||||
artist=$(echo "$data" | awk '/tag artist / {$1="";$2="";print substr($0,3)}')
|
||||
title=$(echo "$data" | awk '/tag title / {$1="";$2="";print substr($0,3)}')
|
||||
duration=$(echo "$data" | awk '/duration/ {print $2}')
|
||||
position=$(echo "$data" | awk '/position/ {print $2}')
|
||||
|
||||
nowplaying="$artist - $title"
|
||||
|
||||
position_formatted=""
|
||||
duration_formatted=""
|
||||
|
||||
if [ "$position" != "" ]; then
|
||||
if [ $position -ge 3600 ]; then
|
||||
position_formatted+=$(printf '%02d:' $(($position/3600)))
|
||||
fi
|
||||
|
||||
position_formatted+=$(printf '%02d:%02d' $(($position%3600/60)) $(($position%60)))
|
||||
fi
|
||||
|
||||
if [ "$duration" != "" ]; then
|
||||
if [ $duration -ge 3600 ]; then
|
||||
duration_formatted+=$(printf '%02d:' $(($duration/3600)))
|
||||
fi
|
||||
|
||||
duration_formatted+=$(printf '%02d:%02d' $(($duration%3600/60)) $(($duration%60)))
|
||||
fi
|
||||
|
||||
nowplaying+=" [$position_formatted/$duration_formatted]"
|
||||
|
||||
if [ "$status" == "paused" ]; then
|
||||
nowplaying+=" [paused]"
|
||||
elif [ "$status" == "stopped" ]; then
|
||||
nowplaying+=" [stopped]"
|
||||
fi
|
||||
|
||||
echo "$nowplaying"
|
|
@ -90,11 +90,14 @@ theme.layout_fg = colors.foreground
|
|||
-- bar items
|
||||
theme.widget_clock = colors.color6
|
||||
theme.widget_volume = colors.color4
|
||||
theme.widget_volume_muted = colors.color1
|
||||
theme.widget_cpu = colors.color2
|
||||
theme.widget_gpu = colors.color4
|
||||
theme.widget_memory = colors.color3
|
||||
theme.widget_music = colors.color5
|
||||
theme.widget_volume_muted = colors.color9
|
||||
theme.widget_cpu = colors.color10
|
||||
theme.widget_gpu = colors.color14
|
||||
theme.widget_memory = colors.color11
|
||||
theme.widget_music = colors.color13
|
||||
theme.widget_packages = colors.color4
|
||||
theme.widget_net_up = colors.color1
|
||||
theme.widget_net_down = colors.color2
|
||||
|
||||
-- Generate taglist squares:
|
||||
--[[local taglist_square_size = dpi(4)
|
||||
|
|
BIN
linux/.local/bin/assets/capture.wav
Normal file
BIN
linux/.local/bin/assets/done.wav
Normal file
BIN
linux/.local/bin/assets/error.wav
Normal file
36
linux/.local/bin/autostart.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
COLORSCHEME="tokyonight"
|
||||
|
||||
run() {
|
||||
if ! pgrep "$1" ;
|
||||
then
|
||||
notify-send "autostart: starting $1"
|
||||
"$@" &
|
||||
else
|
||||
notify-send "autostart: $1 already running"
|
||||
fi
|
||||
}
|
||||
|
||||
notify-send "begin autostart"
|
||||
|
||||
xrdb ~/.config/xrdb/main.xrdb
|
||||
xrdb -merge "~/.config/xrdb/colors/$COLORSCHEME.xrdb"
|
||||
xmodmap -e "keysym Menu = Multi_key"
|
||||
|
||||
run pipewire
|
||||
|
||||
run picom --config ~/.config/picom.conf
|
||||
run xscreensaver -no-splash
|
||||
|
||||
run xmousepasteblock
|
||||
|
||||
run flameshot
|
||||
|
||||
# manual pgrep because env vars
|
||||
if ! pgrep "nicotine" ; then
|
||||
notify-send "autostart: starting nicotine"
|
||||
env GTK_CSD=0 LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0 nicotine &
|
||||
else
|
||||
notify-send "autostart: nicotine already running"
|
||||
fi
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
get_albumart() {
|
||||
rm /tmp/albumart.jpg
|
||||
local dir_name=$( dirname "$1" )
|
||||
local names=(folder cover albumart front "$2")
|
||||
for item in "${names[@]}" ; do
|
||||
img_file=$( find "$dir_name" -maxdepth 1 -iregex ".*$item*\.\(jpg\|jpeg\|gif\|png\|\)$" -print -quit )
|
||||
[ -n "$img_file" ] && cp "$img_file" /tmp/_albumart.jpg && break
|
||||
done
|
||||
[ -z "$img_file" ] && ffmpeg -i "$1" -an -v:c copy "/tmp/_albumart.jpg" -y && img_file="/tmp/_albumart.jpg"
|
||||
[ -n "$img_file" ] && ffmpeg -i /tmp/_albumart.jpg -vf scale=72:-1 /tmp/albumart.jpg && rm /tmp/_albumart.jpg
|
||||
local dir_name=$( dirname "$1" )
|
||||
local names=(folder cover albumart front "$2")
|
||||
for item in "${names[@]}" ; do
|
||||
img_file=$( find "$dir_name" -maxdepth 1 -iregex ".*$item*\.\(jpg\|jpeg\|gif\|png\|\)$" -print -quit )
|
||||
[ -n "$img_file" ] && cp "$img_file" /tmp/_albumart.jpg && break
|
||||
done
|
||||
[ -z "$img_file" ] && ffmpeg -i "$1" -an -vcodec copy "/tmp/_albumart.jpg" -y && img_file="/tmp/_albumart.jpg"
|
||||
[ -n "$img_file" ] && ffmpeg -i /tmp/_albumart.jpg -vf scale=72:-1 /tmp/albumart.jpg && rm /tmp/_albumart.jpg
|
||||
}
|
||||
|
||||
if [ $2 == "playing" ]; then
|
||||
|
@ -32,5 +32,23 @@ if [ $2 == "playing" ]; then
|
|||
duration_formatted+=$(printf '%02d:%02d' $(($_duration%3600/60)) $(($_duration%60)))
|
||||
fi
|
||||
|
||||
notify-send -t 5000 -i /tmp/albumart.jpg "$_title" "$_artist\n$_album\n$duration_formatted"
|
||||
details=""
|
||||
|
||||
if [ "$_artist" != "" ]; then
|
||||
details+="$_artist"
|
||||
fi
|
||||
if [ "$_album" != "" ]; then
|
||||
if [ "$details" != "" ]; then
|
||||
details+="\n"
|
||||
fi
|
||||
details+="$_album"
|
||||
fi
|
||||
if [ "$duration_formatted" != "" ]; then
|
||||
if [ "$details" != "" ]; then
|
||||
details+="\n"
|
||||
fi
|
||||
details+="$duration_formatted"
|
||||
fi
|
||||
|
||||
notify-send -t 5000 -i /tmp/albumart.jpg "$_title" "$details"
|
||||
fi
|
||||
|
|
|
@ -92,12 +92,14 @@ function upload_file_and_notify() {
|
|||
if [[ $macos == "true" ]]; then
|
||||
osascript -e "display notification \"${response}\" with title \"Success!\""
|
||||
else
|
||||
aplay "$HOME/.local/bin/assets/done.wav" &
|
||||
notify-send -t 5000 "Success!" "${response}" -i "${1}" --hint=int:transient:1
|
||||
fi
|
||||
else
|
||||
if [[ $macos == "true" ]]; then
|
||||
osascript -e "display notification \"Error uploading file\" with title \"Error!\""
|
||||
else
|
||||
aplay "$HOME/.local/bin/assets/error.wav" &
|
||||
notify-send -t 5000 "Error!" --hint=int:transient:1
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -26,11 +26,12 @@ mkdir -p "$screenshot_folder"
|
|||
date_str=$(date +'%Y-%m-%d-%H_%M_%S')
|
||||
target="$screenshot_folder/screenie-$date_str.png"
|
||||
|
||||
maim -s "$target"
|
||||
flameshot gui -r > "$target"
|
||||
|
||||
if [ ! -f "$target" ]; then
|
||||
notify-send -t 5000 "screenshot not found, skipping sending"
|
||||
if [ ! -s "$target" ]; then
|
||||
notify-send "screenshot aborted, skipping sending"
|
||||
else
|
||||
aplay "$HOME/.local/bin/assets/capture.wav" &
|
||||
notify-send -t 5000 "screenie: sending: $target"
|
||||
source ~/.secrets
|
||||
$elixiremanager "$target"
|
||||
|
|