aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/misc
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2025-07-04 00:38:29 +0200
committerdelta <darkussdelta@gmail.com>2025-07-04 00:38:29 +0200
commitb3530d7c4a102935fa26498a160ee1dc6c1e9c03 (patch)
treed7751206a694bc5de2d6b34b0c077cfcd1855798 /.config/awesome/misc
parentdf75ec5ed5e3848c497f0439acb43ec9246ad3e7 (diff)
:3
Diffstat (limited to '.config/awesome/misc')
-rw-r--r--.config/awesome/misc/autostart.lua11
-rw-r--r--.config/awesome/misc/cfg.lua13
-rw-r--r--.config/awesome/misc/keys.lua157
-rw-r--r--.config/awesome/misc/rules.lua39
4 files changed, 141 insertions, 79 deletions
diff --git a/.config/awesome/misc/autostart.lua b/.config/awesome/misc/autostart.lua
index b089068..291e39d 100644
--- a/.config/awesome/misc/autostart.lua
+++ b/.config/awesome/misc/autostart.lua
@@ -1,7 +1,7 @@
local awful = require "awful"
-local quarrel = require "quarrel"
+local qpersistent = require "quarrel.persistent"
-if quarrel.is_restart() then
+if qpersistent.is_restart() then
return
end
@@ -11,9 +11,10 @@ local programs = {
"clipcatd",
"wezterm",
"wezterm start --class code_term",
- "firefox",
- "discord",
- "LD_PRELOAD=/usr/lib/spotify-adblock.so spotify",
+ "librewolf",
+ "keepassxc",
+ "fractal",
+ -- "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 aceaa08..f62612f 100644
--- a/.config/awesome/misc/cfg.lua
+++ b/.config/awesome/misc/cfg.lua
@@ -3,21 +3,26 @@ local awful = require "awful"
local cfg = {
terminal = "wezterm",
tags = {
+ -- home
{
layout = awful.layout.suit.floating,
selected = true,
},
+ -- browser
{
+ -- layout = awful.layout.suit.fair,
layout = awful.layout.suit.floating,
},
+ -- messaging
{
layout = awful.layout.suit.tile.left,
master_width_factor = 0.7,
},
- {
- layout = awful.layout.suit.tile.top,
- master_width_factor = 0.2,
- },
+
+ -- {
+ -- layout = awful.layout.suit.tile.top,
+ -- master_width_factor = 0.2,
+ -- },
{
layout = awful.layout.suit.tile.right,
-- master_width_factor = 0.7,
diff --git a/.config/awesome/misc/keys.lua b/.config/awesome/misc/keys.lua
index 9d994ce..8d703b8 100644
--- a/.config/awesome/misc/keys.lua
+++ b/.config/awesome/misc/keys.lua
@@ -3,21 +3,22 @@ local backlight = require "services.backlight"
local beautiful = require "beautiful"
local cfg = require "misc.cfg"
local fresnel = require "ui.fresnel"
+local gtable = require "gears.table"
local gtimer = require "gears.timer"
local insightful = require "ui.insightful"
local naughty = require "naughty"
+-- local mpris = (require "services.mpris")
+local mpris = require "ui.statusbar.panel.widgets.mpris"
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, "" }
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings {
- qbind:new {
- triggers = qvars.btns.left,
+ qbind {
+ triggers = qbind.btns.left,
press = function(c)
c:activate {
context = "mouse_click",
@@ -26,9 +27,9 @@ client.connect_signal("request::default_mousebindings", function()
group = "client",
desc = "raise client",
},
- qbind:new {
- mods = qvars.mods.M,
- triggers = qvars.btns.left,
+ qbind {
+ mods = qbind.mods.M,
+ triggers = qbind.btns.left,
press = function(c)
c:activate {
context = "mouse_click",
@@ -38,9 +39,9 @@ client.connect_signal("request::default_mousebindings", function()
group = "client",
desc = "move client",
},
- qbind:new {
- mods = qvars.mods.M,
- triggers = qvars.btns.right,
+ qbind {
+ mods = qbind.mods.M,
+ triggers = qbind.btns.right,
press = function(c)
c:activate {
context = "mouse_click",
@@ -55,8 +56,8 @@ end)
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings {
- qbind:new {
- mods = qvars.mods.MC,
+ qbind {
+ mods = qbind.mods.MC,
triggers = "q",
press = function(c)
c:kill()
@@ -64,8 +65,8 @@ client.connect_signal("request::default_keybindings", function()
group = "client",
desc = "close",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "m",
press = function(c)
c.maximized = not c.maximized
@@ -73,8 +74,8 @@ client.connect_signal("request::default_keybindings", function()
group = "client",
desc = "(un)maximize",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "n",
press = function(c)
gtimer.delayed_call(function()
@@ -84,8 +85,8 @@ client.connect_signal("request::default_keybindings", function()
group = "client",
desc = "minimize",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "f",
press = function(c)
c.fullscreen = not c.fullscreen
@@ -97,15 +98,15 @@ client.connect_signal("request::default_keybindings", function()
end)
awful.keyboard.append_global_keybindings {
- qbind:new {
- mods = qvars.mods.MC,
+ qbind {
+ mods = qbind.mods.MC,
triggers = "r",
press = awesome.restart,
group = "awesome",
desc = "restart awesome",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "F1",
press = function()
insightful:toggle()
@@ -113,8 +114,8 @@ awful.keyboard.append_global_keybindings {
group = "awesome",
desc = "toggle insightful",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "space",
press = function()
fresnel:show()
@@ -122,17 +123,17 @@ awful.keyboard.append_global_keybindings {
group = "awesome",
desc = "toggle fresnel",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "p",
press = function()
- qstore.panel_toggle:press()
+ awful.screen.focused().bar:toggle()
end,
group = "awesome",
desc = "toggle bar panel",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "l",
press = function()
powermenu:toggle()
@@ -141,7 +142,7 @@ awful.keyboard.append_global_keybindings {
desc = "toggle powermenu",
},
- qbind:new {
+ qbind {
triggers = "XF86AudioMute",
press = function()
awful.spawn "wpctl set-mute @DEFAULT_SINK@ toggle"
@@ -149,46 +150,65 @@ awful.keyboard.append_global_keybindings {
group = "audio",
desc = "mute",
},
- qbind:new {
+ qbind {
triggers = {
{ "XF86AudioRaiseVolume", true },
{ "XF86AudioLowerVolume", false },
},
press = function(up)
if up then
- awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%+"
+ -- awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%+"
+ print "up"
else
- awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%-"
+ print "down"
+ -- awful.spawn "wpctl set-volume @DEFAULT_SINK@ 5%-"
end
end,
group = "audio",
desc = "increase/decrease volume",
},
- qbind:new {
+ qbind {
triggers = {
{ "XF86AudioNext", true },
{ "XF86AudioPrev", false },
},
press = function(next)
+ local active_player = playerctl:list()[mpris.active_player_index].instance
if next then
- playerctl:next()
+ playerctl:next(active_player)
else
- playerctl:previous()
+ playerctl:previous(active_player)
end
end,
group = "audio",
desc = "previous/next song",
},
- qbind:new {
+ qbind {
triggers = "XF86AudioPlay",
press = function()
- playerctl:play_pause()
+ playerctl:play_pause(playerctl:list()[mpris.active_player_index].instance)
end,
group = "audio",
desc = "(un)pause song",
},
+ qbind {
+ mods = qbind.mods.M,
+ triggers = {
+ { "Next", true },
+ { "Prior", false },
+ },
+ press = function(next)
+ if next then
+ mpris.next_player()
+ else
+ mpris.previous_player()
+ end
+ end,
+ group = "audio",
+ desc = "previous/next player",
+ },
- qbind:new {
+ qbind {
triggers = {
{ "XF86MonBrightnessUp", true },
{ "XF86MonBrightnessDown", false },
@@ -204,8 +224,8 @@ awful.keyboard.append_global_keybindings {
desc = "increase/decrease brightness",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "Return",
press = function()
awful.spawn(cfg.terminal)
@@ -214,7 +234,7 @@ awful.keyboard.append_global_keybindings {
desc = "launch terminal",
},
- qbind:new {
+ qbind {
triggers = "Print",
press = function()
local date = os.date "%Y%m%d_%H%M%S"
@@ -235,8 +255,8 @@ awful.keyboard.append_global_keybindings {
group = "screenshot",
desc = "take fullscreen screenshot",
},
- qbind:new {
- mods = qvars.mods.S,
+ qbind {
+ mods = qbind.mods.S,
triggers = "Print",
press = function()
local date = os.date "%Y%m%d_%H%M%S"
@@ -256,8 +276,8 @@ awful.keyboard.append_global_keybindings {
desc = "take region screenshot",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "Print",
press = function()
if recording[1] then
@@ -283,8 +303,8 @@ awful.keyboard.append_global_keybindings {
desc = "toggle recording",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "k",
press = function()
awful.spawn "xkblayout-state set +1"
@@ -292,8 +312,8 @@ awful.keyboard.append_global_keybindings {
group = "keyboard",
desc = "next keyboard layout",
},
- qbind:new {
- mods = qvars.mods.MS,
+ qbind {
+ mods = qbind.mods.MS,
triggers = "k",
press = function()
awful.spawn "xkblayout-state set -1"
@@ -302,22 +322,35 @@ awful.keyboard.append_global_keybindings {
desc = "previous keyboard layout",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "Up",
press = awful.tag.viewprev,
group = "tag",
desc = "switch to previous",
},
- qbind:new {
- mods = qvars.mods.M,
+ qbind {
+ mods = qbind.mods.M,
triggers = "Down",
press = awful.tag.viewnext,
group = "tag",
desc = "switch to next",
},
- qbind:new {
- mods = qvars.mods.MC,
+ qbind {
+ mods = qbind.mods.M,
+ triggers = gtable.join(awful.key.keygroups.numrow, awful.key.keygroups.numpad),
+ press = function(idx)
+ local tag = awful.screen.focused().tags[idx]
+ if not tag then
+ return
+ end
+ tag:view_only()
+ end,
+ group = "tag",
+ desc = "switch to the specified tag (if it exists)",
+ },
+ qbind {
+ mods = qbind.mods.MC,
triggers = "x",
press = function()
local tag = awful.screen.focused().selected_tag
@@ -326,4 +359,16 @@ awful.keyboard.append_global_keybindings {
group = "tag",
desc = "reset master width",
},
+ qbind {
+ mods = qbind.mods.M,
+ triggers = {
+ { "XF86AudioRaiseVolume", true }, -- volume roller produces these events
+ { "XF86AudioLowerVolume", false },
+ },
+ press = function(up)
+ awful.spawn("xdotool click " .. (up and "4" or "5"))
+ end,
+ group = "misc",
+ desc = "scroll up/down",
+ },
}
diff --git a/.config/awesome/misc/rules.lua b/.config/awesome/misc/rules.lua
index 92ac596..18b11f1 100644
--- a/.config/awesome/misc/rules.lua
+++ b/.config/awesome/misc/rules.lua
@@ -20,6 +20,17 @@ ruled.client.connect_signal("request::rules", function()
},
{
+ id = "unlock_db",
+ rule = {
+ name = "Unlock Database - KeePassXC",
+ },
+ properties = {
+ sticky = true,
+ floating = true,
+ },
+ },
+
+ {
id = "titlebars",
rule_any = {
type = {
@@ -56,7 +67,7 @@ ruled.client.connect_signal("request::rules", function()
{
id = "chat_tag",
rule_any = {
- class = { "discord" },
+ class = { "fractal" },
},
properties = {
screen = 1,
@@ -64,17 +75,17 @@ ruled.client.connect_signal("request::rules", function()
},
},
- {
- id = "music_tag",
- rule_any = {
- class = { "Spotify" },
- },
- properties = {
- screen = 1,
- tag = awful.screen.focused().tags[4],
- titlebars_enabled = false,
- },
- },
+ -- {
+ -- id = "music_tag",
+ -- rule_any = {
+ -- class = { "Spotify" },
+ -- },
+ -- properties = {
+ -- screen = 1,
+ -- tag = awful.screen.focused().tags[4],
+ -- titlebars_enabled = false,
+ -- },
+ -- },
{
id = "code_tag",
@@ -83,7 +94,7 @@ ruled.client.connect_signal("request::rules", function()
},
properties = {
screen = 1,
- tag = awful.screen.focused().tags[5],
+ tag = awful.screen.focused().tags[4],
},
},
@@ -94,7 +105,7 @@ ruled.client.connect_signal("request::rules", function()
},
properties = {
screen = 1,
- tag = awful.screen.focused().tags[6],
+ tag = awful.screen.focused().tags[5],
},
},
}