diff options
Diffstat (limited to '.config/awesome/misc')
-rw-r--r-- | .config/awesome/misc/autostart.lua | 6 | ||||
-rw-r--r-- | .config/awesome/misc/cfg.lua | 14 | ||||
-rw-r--r-- | .config/awesome/misc/keys.lua | 137 | ||||
-rw-r--r-- | .config/awesome/misc/rules.lua | 161 |
4 files changed, 176 insertions, 142 deletions
diff --git a/.config/awesome/misc/autostart.lua b/.config/awesome/misc/autostart.lua index 3cd70f9..b089068 100644 --- a/.config/awesome/misc/autostart.lua +++ b/.config/awesome/misc/autostart.lua @@ -1,7 +1,9 @@ local awful = require "awful" local quarrel = require "quarrel" -if quarrel.is_restart() then return end +if quarrel.is_restart() then + return +end local programs = { "picom -b", @@ -11,7 +13,7 @@ local programs = { "wezterm start --class code_term", "firefox", "discord", - "LD_PRELOAD=/usr/lib/spotify-adblock.so spotify" + "LD_PRELOAD=/usr/lib/spotify-adblock.so spotify", } for _, program in ipairs(programs) do diff --git a/.config/awesome/misc/cfg.lua b/.config/awesome/misc/cfg.lua index 05534b1..aceaa08 100644 --- a/.config/awesome/misc/cfg.lua +++ b/.config/awesome/misc/cfg.lua @@ -1,5 +1,4 @@ local awful = require "awful" -local phosphor = require "assets.phosphor" local cfg = { terminal = "wezterm", @@ -7,32 +6,27 @@ local cfg = { { layout = awful.layout.suit.floating, selected = true, - icon = phosphor.house_fill }, { layout = awful.layout.suit.floating, - icon = phosphor.browser_fill }, { layout = awful.layout.suit.tile.left, master_width_factor = 0.7, - icon = phosphor.discord_logo_fill }, { layout = awful.layout.suit.tile.top, master_width_factor = 0.2, - icon = phosphor.spotify_logo_fill }, { layout = awful.layout.suit.tile.right, - master_width_factor = 0.7, - icon = phosphor.code_fill + -- master_width_factor = 0.7, }, { layout = awful.layout.suit.floating, - icon = phosphor.game_controller_fill - } - } + }, + }, + backlight = "/sys/class/backlight/amdgpu_bl1/", } return cfg diff --git a/.config/awesome/misc/keys.lua b/.config/awesome/misc/keys.lua index 646be52..9d994ce 100644 --- a/.config/awesome/misc/keys.lua +++ b/.config/awesome/misc/keys.lua @@ -1,4 +1,5 @@ local awful = require "awful" +local backlight = require "services.backlight" local beautiful = require "beautiful" local cfg = require "misc.cfg" local fresnel = require "ui.fresnel" @@ -6,7 +7,9 @@ local gtimer = require "gears.timer" local insightful = require "ui.insightful" local naughty = require "naughty" local playerctl = require "services.playerctl" +local powermenu = require "ui.powermenu" local qbind = require "quarrel.bind" +local qstore = require "quarrel.store" local qvars = require "quarrel.vars" local recording = { false, "" } @@ -17,11 +20,11 @@ client.connect_signal("request::default_mousebindings", function() triggers = qvars.btns.left, press = function(c) c:activate { - context = "mouse_click" + context = "mouse_click", } end, group = "client", - desc = "raise client" + desc = "raise client", }, qbind:new { mods = qvars.mods.M, @@ -29,11 +32,11 @@ client.connect_signal("request::default_mousebindings", function() press = function(c) c:activate { context = "mouse_click", - action = "mouse_move" + action = "mouse_move", } end, group = "client", - desc = "move client" + desc = "move client", }, qbind:new { mods = qvars.mods.M, @@ -41,12 +44,12 @@ client.connect_signal("request::default_mousebindings", function() press = function(c) c:activate { context = "mouse_click", - action = "mouse_resize" + action = "mouse_resize", } end, group = "client", - desc = "resize client" - } + desc = "resize client", + }, } end) @@ -59,7 +62,7 @@ client.connect_signal("request::default_keybindings", function() c:kill() end, group = "client", - desc = "close" + desc = "close", }, qbind:new { mods = qvars.mods.M, @@ -68,7 +71,7 @@ client.connect_signal("request::default_keybindings", function() c.maximized = not c.maximized end, group = "client", - desc = "(un)maximize" + desc = "(un)maximize", }, qbind:new { mods = qvars.mods.M, @@ -79,7 +82,7 @@ client.connect_signal("request::default_keybindings", function() end) end, group = "client", - desc = "minimize" + desc = "minimize", }, qbind:new { mods = qvars.mods.M, @@ -88,8 +91,8 @@ client.connect_signal("request::default_keybindings", function() c.fullscreen = not c.fullscreen end, group = "client", - desc = "toggle fullscreen" - } + desc = "toggle fullscreen", + }, } end) @@ -99,7 +102,7 @@ awful.keyboard.append_global_keybindings { triggers = "r", press = awesome.restart, group = "awesome", - desc = "restart awesome" + desc = "restart awesome", }, qbind:new { mods = qvars.mods.M, @@ -108,7 +111,7 @@ awful.keyboard.append_global_keybindings { insightful:toggle() end, group = "awesome", - desc = "toggle insightful" + desc = "toggle insightful", }, qbind:new { mods = qvars.mods.M, @@ -117,36 +120,54 @@ awful.keyboard.append_global_keybindings { fresnel:show() end, group = "awesome", - desc = "toggle fresnel" + desc = "toggle fresnel", + }, + qbind:new { + mods = qvars.mods.M, + triggers = "p", + press = function() + qstore.panel_toggle:press() + end, + group = "awesome", + desc = "toggle bar panel", + }, + qbind:new { + mods = qvars.mods.M, + triggers = "l", + press = function() + powermenu:toggle() + end, + group = "awesome", + desc = "toggle powermenu", }, qbind:new { triggers = "XF86AudioMute", press = function() - awful.spawn("wpctl set-mute @DEFAULT_SINK@ toggle") + awful.spawn "wpctl set-mute @DEFAULT_SINK@ toggle" end, group = "audio", - desc = "mute" + desc = "mute", }, qbind:new { triggers = { { "XF86AudioRaiseVolume", true }, - { "XF86AudioLowerVolume", false } + { "XF86AudioLowerVolume", false }, }, press = function(up) if up then - awful.spawn("wpctl set-volume @DEFAULT_SINK@ 5%+") + awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%+" else - awful.spawn("wpctl set-volume @DEFAULT_SINK@ 5%-") + awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%-" end end, group = "audio", - desc = "increase/decrease volume" + desc = "increase/decrease volume", }, qbind:new { triggers = { { "XF86AudioNext", true }, - { "XF86AudioPrev", false } + { "XF86AudioPrev", false }, }, press = function(next) if next then @@ -156,7 +177,7 @@ awful.keyboard.append_global_keybindings { end end, group = "audio", - desc = "previous/next song" + desc = "previous/next song", }, qbind:new { triggers = "XF86AudioPlay", @@ -164,23 +185,23 @@ awful.keyboard.append_global_keybindings { playerctl:play_pause() end, group = "audio", - desc = "(un)pause song" + desc = "(un)pause song", }, qbind:new { triggers = { { "XF86MonBrightnessUp", true }, - { "XF86MonBrightnessDown", false } + { "XF86MonBrightnessDown", false }, }, press = function(up) if up then - awful.spawn("brightnessctl set +51") + backlight.set(backlight.get() + 51) else - awful.spawn("brightnessctl set 51-") + backlight.set(backlight.get() - 51) end end, group = "brightness", - desc = "increase/decrease brightness" + desc = "increase/decrease brightness", }, qbind:new { @@ -190,33 +211,49 @@ awful.keyboard.append_global_keybindings { awful.spawn(cfg.terminal) end, group = "launcher", - desc = "launch terminal" + desc = "launch terminal", }, qbind:new { triggers = "Print", press = function() - local date = os.date("%Y%m%d_%H%M%S") - local path = os.getenv("HOME") .. "/Pictures/" .. date .. ".png" + local date = os.date "%Y%m%d_%H%M%S" + local path = os.getenv "HOME" .. "/Pictures/" .. date .. ".png" -- Can't use naughty.notification cause it gets in the screenshot -- Also can't use easy_async_with_shell cause it's buggy - awful.spawn.with_shell("maim --hidecursor " .. path .. " && xclip -selection clipboard -t image/png " .. path .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] .. path .. [["]]) + awful.spawn.with_shell( + "maim --hidecursor " + .. path + .. " && xclip -selection clipboard -t image/png " + .. path + .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] + .. path + .. [["]] + ) end, group = "screenshot", - desc = "take fullscreen screenshot" + desc = "take fullscreen screenshot", }, qbind:new { mods = qvars.mods.S, triggers = "Print", press = function() - local date = os.date("%Y%m%d_%H%M%S") - local path = os.getenv("HOME") .. "/Pictures/" .. date .. ".png" + local date = os.date "%Y%m%d_%H%M%S" + local path = os.getenv "HOME" .. "/Pictures/" .. date .. ".png" - awful.spawn.with_shell("maim --hidecursor -s " .. path .. " && xclip -selection clipboard -t image/png " .. path .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] .. path .. [["]]) + awful.spawn.with_shell( + "maim --hidecursor -s " + .. path + .. " && xclip -selection clipboard -t image/png " + .. path + .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] + .. path + .. [["]] + ) end, group = "screenshot", - desc = "take region screenshot" + desc = "take region screenshot", }, qbind:new { @@ -224,45 +261,45 @@ awful.keyboard.append_global_keybindings { triggers = "Print", press = function() if recording[1] then - awful.spawn("giph --stop") + awful.spawn "giph --stop" naughty.notification { app_name = "Giph", title = "Recording stopped", - message = "Saved at " .. recording[2] + message = "Saved at " .. recording[2], } recording[1] = false recording[2] = "" else recording[1] = true - recording[2] = os.getenv("HOME") .. "/Videos/" .. os.date("%Y%m%d_%H%M%S") .. ".mp4" + recording[2] = os.getenv "HOME" .. "/Videos/" .. os.date "%Y%m%d_%H%M%S" .. ".mp4" awful.spawn("giph --format mp4 --framerate 30 " .. recording[2]) naughty.notification { app_name = "Giph", - title = "Recording started" + title = "Recording started", } end end, group = "video", - desc = "toggle recording" + desc = "toggle recording", }, qbind:new { mods = qvars.mods.M, triggers = "k", press = function() - awful.spawn("xkblayout-state set +1") + awful.spawn "xkblayout-state set +1" end, group = "keyboard", - desc = "next keyboard layout" + desc = "next keyboard layout", }, qbind:new { mods = qvars.mods.MS, triggers = "k", press = function() - awful.spawn("xkblayout-state set -1") + awful.spawn "xkblayout-state set -1" end, group = "keyboard", - desc = "previous keyboard layout" + desc = "previous keyboard layout", }, qbind:new { @@ -270,14 +307,14 @@ awful.keyboard.append_global_keybindings { triggers = "Up", press = awful.tag.viewprev, group = "tag", - desc = "switch to previous" + desc = "switch to previous", }, qbind:new { mods = qvars.mods.M, triggers = "Down", press = awful.tag.viewnext, group = "tag", - desc = "switch to next" + desc = "switch to next", }, qbind:new { mods = qvars.mods.MC, @@ -287,6 +324,6 @@ awful.keyboard.append_global_keybindings { tag.master_width_factor = cfg.tags[tonumber(tag.name)].master_width_factor or beautiful.master_width_factor end, group = "tag", - desc = "reset master width" - } + desc = "reset master width", + }, } diff --git a/.config/awesome/misc/rules.lua b/.config/awesome/misc/rules.lua index b4d1dfa..92ac596 100644 --- a/.config/awesome/misc/rules.lua +++ b/.config/awesome/misc/rules.lua @@ -3,98 +3,99 @@ local beautiful = require "beautiful" local ruled = require "ruled" ruled.client.connect_signal("request::rules", function() - ruled.client.append_rule({ - id = "global", - rule = {}, - properties = { - border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - raise = true, - screen = awful.screen.preferred, - placement = awful.placement.centered+awful.placement.no_offscreen, - floating = false, - honor_padding = true - } - }) + ruled.client.append_rules { + { + id = "global", + rule = {}, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + screen = awful.screen.preferred, + placement = awful.placement.centered + awful.placement.no_offscreen, + floating = false, + honor_padding = true, + }, + }, - ruled.client.append_rule({ - id = "titlebars", - rule_any = { - type = { - "normal", - "dialog" - } + { + id = "titlebars", + rule_any = { + type = { + "normal", + "dialog", + }, + }, + properties = { + titlebars_enabled = true, + }, }, - properties = { - titlebars_enabled = true - } - }) - ruled.client.append_rule({ - id = "pip", - rule = { - name = "Picture-in-Picture" + { + id = "pip", + rule = { + name = "Picture-in-Picture", + }, + properties = { + ontop = true, + }, }, - properties = { - ontop = true - } - }) - ruled.client.append_rule({ - id = "browser_tag", - rule_any = { - instance = { "Navigator" } + { + id = "browser_tag", + rule_any = { + instance = { "Navigator" }, + }, + properties = { + screen = 1, + tag = awful.screen.focused().tags[2], + }, }, - properties = { - screen = 1, - tag = screen[1].tags[2] - } - }) - ruled.client.append_rule({ - id = "chat_tag", - rule_any = { - class = { "discord" } + { + id = "chat_tag", + rule_any = { + class = { "discord" }, + }, + properties = { + screen = 1, + tag = awful.screen.focused().tags[3], + }, }, - properties = { - screen = 1, - tag = screen[1].tags[3] - } - }) - - ruled.client.append_rule({ - id = "music_tag", - rule_any = { - class = { "Spotify" } + { + id = "music_tag", + rule_any = { + class = { "Spotify" }, + }, + properties = { + screen = 1, + tag = awful.screen.focused().tags[4], + titlebars_enabled = false, + }, }, - properties = { - screen = 1, - tag = screen[1].tags[4], - titlebars_enabled = false - } - }) - ruled.client.append_rule({ - id = "code_tag", - rule_any = { - class = { "lite-xl", "code_term" } + { + id = "code_tag", + rule_any = { + class = { "lite-xl", "code_term" }, + }, + properties = { + screen = 1, + tag = awful.screen.focused().tags[5], + }, }, - properties = { - screen = 1, - tag = screen[1].tags[5] - } - }) - ruled.client.append_rule({ - id = "steam", - rule_any = { - class = { "steam" } + { + id = "steam", + rule_any = { + class = { "steam" }, + }, + properties = { + screen = 1, + tag = awful.screen.focused().tags[6], + }, }, - properties = { - screen = 1, - tag = screen[1].tags[6] - } - }) + } end) |