From fa63fd37ce424bc231ceb7164b8d12f6a124f9a5 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Tue, 9 Jan 2024 20:38:24 -0500 Subject: [PATCH] format everything --- configs/awesome/.stylua.toml | 6 + configs/awesome/binds/awesome.lua | 74 +++---- configs/awesome/binds/client.lua | 320 +++++++++++------------------ configs/awesome/binds/init.lua | 16 +- configs/awesome/binds/launcher.lua | 197 ++++++++---------- configs/awesome/binds/layout.lua | 58 +++--- configs/awesome/binds/media.lua | 132 +++++------- configs/awesome/binds/mouse.lua | 56 +---- configs/awesome/binds/screen.lua | 30 ++- configs/awesome/binds/tag.lua | 117 +++++------ configs/awesome/core/init.lua | 63 +++--- configs/awesome/rc.lua | 47 ++--- configs/awesome/rules/init.lua | 100 ++++----- configs/awesome/signals/init.lua | 199 +++++++----------- configs/awesome/theme.lua | 98 ++++----- configs/awesome/wibar/init.lua | 168 +++++++-------- configs/awesome/wibar/taglist.lua | 57 ++--- configs/awesome/wibar/tasklist.lua | 50 ++--- configs/awesome/wibar/widgets.lua | 40 ++-- configs/x11/xinitrc | 4 +- configs/x11/xprofile | 4 +- readme.md | 12 +- scripts/copy_and_link | 22 +- scripts/install_min_fedora | 22 +- scripts/install_min_ubuntu | 4 +- scripts/nvim_clean | 4 +- 26 files changed, 784 insertions(+), 1116 deletions(-) create mode 100644 configs/awesome/.stylua.toml diff --git a/configs/awesome/.stylua.toml b/configs/awesome/.stylua.toml new file mode 100644 index 0000000..139e939 --- /dev/null +++ b/configs/awesome/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +call_parentheses = "None" diff --git a/configs/awesome/binds/awesome.lua b/configs/awesome/binds/awesome.lua index 83cb3ca..af19ff1 100644 --- a/configs/awesome/binds/awesome.lua +++ b/configs/awesome/binds/awesome.lua @@ -1,56 +1,36 @@ -- Binds that affect awesome globalkeys = Gears.table.join( - globalkeys, + globalkeys, - Awful.key( - { Modkey, "Shift" }, "e", awesome.quit, - { - description = "quit awesome", - group = "awesome" - } - ), + Awful.key({ Modkey, 'Shift' }, 'e', awesome.quit, { + description = 'quit awesome', + group = 'awesome', + }), - Awful.key( - { Modkey, "Shift" }, "p", - function() - Awful.spawn.easy_async_with_shell("doorsbg", - function() - awesome.restart() - end) - end, - { - description = "set new random wallpaper/color scheme", - group = "awesome" - } - ), + Awful.key({ Modkey, 'Shift' }, 'p', function() + Awful.spawn.easy_async_with_shell('doorsbg', function() + awesome.restart() + end) + end, { + description = 'set new random wallpaper/color scheme', + group = 'awesome', + }), - Awful.key( - { Modkey, }, "BackSpace", - awesome.restart, - { - description = "reload awesome", - group = "awesome" - } - ), + Awful.key({ Modkey }, 'BackSpace', awesome.restart, { + description = 'reload awesome', + group = 'awesome', + }), - Awful.key( - { Modkey, }, "F1", - Hotkeys_popup.show_help, - { - description = "show help", - group = "awesome" - } - ), + Awful.key({ Modkey }, 'F1', Hotkeys_popup.show_help, { + description = 'show help', + group = 'awesome', + }), - Awful.key( - {}, "Print", - function() - os.execute("maimpick") - end, - { - description = "run screenshot script", - group = "awesome" - } - ) + Awful.key({}, 'Print', function() + os.execute 'maimpick' + end, { + description = 'run screenshot script', + group = 'awesome', + }) ) diff --git a/configs/awesome/binds/client.lua b/configs/awesome/binds/client.lua index 822a63a..f10baa3 100644 --- a/configs/awesome/binds/client.lua +++ b/configs/awesome/binds/client.lua @@ -4,220 +4,148 @@ inc = 50 clientkeys = Gears.table.join( - clientkeys, + clientkeys, - Awful.key( - { Modkey, }, "f", - function(c) - c.fullscreen = not c.fullscreen - c:raise() - end, - { - description = "toggle fullscreen", - group = "client" - } - ), + Awful.key({ Modkey }, 'f', function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, { + description = 'toggle fullscreen', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1" }, "h", - function(c) - c:relative_move(-inc, 0, 0, 0) - end, - { - description = "move floating left", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1' }, 'h', function(c) + c:relative_move(-inc, 0, 0, 0) + end, { + description = 'move floating left', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1", "Shift" }, "h", - function(c) - c:relative_move(-inc, 0, inc, 0) - end, - { - description = "resize floating horizontal +", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1', 'Shift' }, 'h', function(c) + c:relative_move(-inc, 0, inc, 0) + end, { + description = 'resize floating horizontal +', + group = 'client', + }), - Awful.key( - { Modkey, }, "j", - function() - Awful.client.focus.byidx(1) - end, - { - description = "focus next by index", - group = "client" - } - ), + Awful.key({ Modkey }, 'j', function() + Awful.client.focus.byidx(1) + end, { + description = 'focus next by index', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1" }, "j", - function(c) - c:relative_move(0, inc, 0, 0) - end, - { - description = "move floating down", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1' }, 'j', function(c) + c:relative_move(0, inc, 0, 0) + end, { + description = 'move floating down', + group = 'client', + }), - Awful.key( - { Modkey, "Shift" }, "j", - function() - Awful.client.swap.byidx(1) - end, - { - description = "swap next by index", - group = "client" - } - ), + Awful.key({ Modkey, 'Shift' }, 'j', function() + Awful.client.swap.byidx(1) + end, { + description = 'swap next by index', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1", "Shift" }, "j", - function(c) - c:relative_move(0, inc, 0, -inc) - end, - { - description = "resize floating vertical -", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1', 'Shift' }, 'j', function(c) + c:relative_move(0, inc, 0, -inc) + end, { + description = 'resize floating vertical -', + group = 'client', + }), - Awful.key( - { Modkey, }, "k", - function() - Awful.client.focus.byidx(-1) - end, - { - description = "focus previous by index", - group = "client" - } - ), + Awful.key({ Modkey }, 'k', function() + Awful.client.focus.byidx(-1) + end, { + description = 'focus previous by index', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1" }, "k", - function(c) - c:relative_move(0, -inc, 0, 0) - end, - { - description = "move floating up", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1' }, 'k', function(c) + c:relative_move(0, -inc, 0, 0) + end, { + description = 'move floating up', + group = 'client', + }), - Awful.key( - { Modkey, "Shift" }, "k", - function() - Awful.client.swap.byidx(-1) - end, - { - description = "swap previous by index", - group = "client" - } - ), + Awful.key({ Modkey, 'Shift' }, 'k', function() + Awful.client.swap.byidx(-1) + end, { + description = 'swap previous by index', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1", "Shift" }, "k", - function(c) - c:relative_move(0, -inc, 0, inc) - end, - { - description = "resize floating vertical +", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1', 'Shift' }, 'k', function(c) + c:relative_move(0, -inc, 0, inc) + end, { + description = 'resize floating vertical +', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1" }, "l", - function(c) - c:relative_move(inc, 0, 0, 0) - end, - { - description = "move floating right", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1' }, 'l', function(c) + c:relative_move(inc, 0, 0, 0) + end, { + description = 'move floating right', + group = 'client', + }), - Awful.key( - { Modkey, "Mod1", "Shift" }, "l", - function(c) - c:relative_move(inc, 0, -inc, 0) - end, - { - description = "resize floating horizontal -", - group = "client" - } - ), + Awful.key({ Modkey, 'Mod1', 'Shift' }, 'l', function(c) + c:relative_move(inc, 0, -inc, 0) + end, { + description = 'resize floating horizontal -', + group = 'client', + }), - Awful.key( - { Modkey, "Shift" }, "n", - function(c) - c.maximized = not c.maximized - c:raise() - end, - { - description = "(un)maximize", - group = "client" - } - ), + Awful.key({ Modkey, 'Shift' }, 'n', function(c) + c.maximized = not c.maximized + c:raise() + end, { + description = '(un)maximize', + group = 'client', + }), - Awful.key( - { Modkey, }, "o", - function(c) c:move_to_screen() end, - { - description = "move focused to next screen", - group = "client" - } - ), + Awful.key({ Modkey }, 'o', function(c) + c:move_to_screen() + end, { + description = 'move focused to next screen', + group = 'client', + }), - Awful.key( - { Modkey, }, "q", - function(c) c:kill() end, - { - description = "close", - group = "client" - } - ), + Awful.key({ Modkey }, 'q', function(c) + c:kill() + end, { + description = 'close', + group = 'client', + }), - Awful.key( - { Modkey, }, "t", - function(c) c.ontop = not c.ontop end, - { - description = "toggle keep on top", - group = "client" - } - ), + Awful.key({ Modkey }, 't', function(c) + c.ontop = not c.ontop + end, { + description = 'toggle keep on top', + group = 'client', + }), - Awful.key( - { Modkey, "Shift" }, "Return", - function(c) - c:swap(Awful.client.getmaster()) - end, - { - description = "move focused to master", - group = "client" - } - ), + Awful.key({ Modkey, 'Shift' }, 'Return', function(c) + c:swap(Awful.client.getmaster()) + end, { + description = 'move focused to master', + group = 'client', + }), - Awful.key( - { Modkey, }, "space", - Awful.client.floating.toggle, - { - description = "toggle floating", - group = "client" - } - ), + Awful.key({ Modkey }, 'space', Awful.client.floating.toggle, { + description = 'toggle floating', + group = 'client', + }), - Awful.key( - { Modkey, }, "Tab", - function() - Awful.client.focus.history.previous() - if client.focus then client.focus:raise() end - end, - { - description = "focus previous", - group = "client" - } - ) + Awful.key({ Modkey }, 'Tab', function() + Awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end, { + description = 'focus previous', + group = 'client', + }) ) diff --git a/configs/awesome/binds/init.lua b/configs/awesome/binds/init.lua index 4de1f38..67e1a1a 100644 --- a/configs/awesome/binds/init.lua +++ b/configs/awesome/binds/init.lua @@ -1,12 +1,12 @@ -- Group by appearance in help menu (Modkey + F1) -require('binds.awesome') -require('binds.client') -require('binds.launcher') -require('binds.layout') -require('binds.media') -require('binds.mouse') -require('binds.screen') -require('binds.tag') +require 'binds.awesome' +require 'binds.client' +require 'binds.launcher' +require 'binds.layout' +require 'binds.media' +require 'binds.mouse' +require 'binds.screen' +require 'binds.tag' -- Apply all above root.keys(globalkeys) diff --git a/configs/awesome/binds/launcher.lua b/configs/awesome/binds/launcher.lua index ea2b85c..69e506a 100644 --- a/configs/awesome/binds/launcher.lua +++ b/configs/awesome/binds/launcher.lua @@ -1,130 +1,103 @@ -- Binds that launch programs globalkeys = Gears.table.join( - globalkeys, + globalkeys, - Awful.key( - { Modkey, }, "c", - function() Awful.spawn("caprine") end, - { - description = "open caprine", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'c', function() + Awful.spawn 'caprine' + end, { + description = 'open caprine', + group = 'launcher', + }), - Awful.key( - { Modkey, "Shift" }, "c", - function() Awful.spawn("telegram-desktop") end, - { - description = "open telegram-desktop", - group = "launcher" - } - ), + Awful.key({ Modkey, 'Shift' }, 'c', function() + Awful.spawn 'telegram-desktop' + end, { + description = 'open telegram-desktop', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "d", - function() Awful.spawn("discord") end, - { - description = "open discord", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'd', function() + Awful.spawn 'discord' + end, { + description = 'open discord', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "e", - function() Awful.spawn(Email) end, - { - description = "open editor", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'e', function() + Awful.spawn(Email) + end, { + description = 'open editor', + group = 'launcher', + }), - Awful.key( - { Modkey, "Shift" }, "e", - function() Awful.spawn("thunderbird") end, - { - description = "open thunderbird", - group = "launcher" - } - ), + Awful.key({ Modkey, 'Shift' }, 'e', function() + Awful.spawn 'thunderbird' + end, { + description = 'open thunderbird', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "g", - function() Awful.spawn("steam-native") end, - { - description = "open steam", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'g', function() + Awful.spawn 'steam-native' + end, { + description = 'open steam', + group = 'launcher', + }), - Awful.key( - { Modkey, "Shift" }, "g", - function() Awful.spawn("lutris") end, - { - description = "open lutris", - group = "launcher" - } - ), + Awful.key({ Modkey, 'Shift' }, 'g', function() + Awful.spawn 'lutris' + end, { + description = 'open lutris', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "i", - function() Awful.spawn("gimp") end, - { - description = "open gimp", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'i', function() + Awful.spawn 'gimp' + end, { + description = 'open gimp', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "m", - function() Awful.spawn(Music) end, - { - description = "open spotify", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'm', function() + Awful.spawn(Music) + end, { + description = 'open spotify', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "r", - function() Awful.screen.focused().mypromptbox:run() end, - { - description = "run prompt", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'r', function() + Awful.screen.focused().mypromptbox:run() + end, { + description = 'run prompt', + group = 'launcher', + }), - Awful.key({ Modkey, }, "v", - function() Awful.spawn("virt-manager") end, - { - description = "open virt-manager", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'v', function() + Awful.spawn 'virt-manager' + end, { + description = 'open virt-manager', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "w", - function() Awful.spawn(Browser) end, - { - description = "open browser", - group = "launcher" - } - ), + Awful.key({ Modkey }, 'w', function() + Awful.spawn(Browser) + end, { + description = 'open browser', + group = 'launcher', + }), - Awful.key( - { Modkey, "Shift" }, "w", - function() Awful.spawn(Browser2) end, - { - description = "open browser2", - group = "launcher" - } - ), + Awful.key({ Modkey, 'Shift' }, 'w', function() + Awful.spawn(Browser2) + end, { + description = 'open browser2', + group = 'launcher', + }), - Awful.key( - { Modkey, }, "Return", - function() Awful.spawn(Terminal) end, - { - description = "open a terminal", - group = "launcher" - } - ) + Awful.key({ Modkey }, 'Return', function() + Awful.spawn(Terminal) + end, { + description = 'open a terminal', + group = 'launcher', + }) ) diff --git a/configs/awesome/binds/layout.lua b/configs/awesome/binds/layout.lua index 8c566da..a65050e 100644 --- a/configs/awesome/binds/layout.lua +++ b/configs/awesome/binds/layout.lua @@ -1,41 +1,33 @@ -- Binds that affect layout globalkeys = Gears.table.join( - globalkeys, + globalkeys, - Awful.key( - { Modkey, "Shift" }, "h", - function() Awful.tag.incmwfact(-0.05) end, - { - description = "resize split -", - group = "layout" - } - ), + Awful.key({ Modkey, 'Shift' }, 'h', function() + Awful.tag.incmwfact(-0.05) + end, { + description = 'resize split -', + group = 'layout', + }), - Awful.key( - { Modkey, "Shift" }, "l", - function() Awful.tag.incmwfact(0.05) end, - { - description = "resize split +", - group = "layout" - } - ), + Awful.key({ Modkey, 'Shift' }, 'l', function() + Awful.tag.incmwfact(0.05) + end, { + description = 'resize split +', + group = 'layout', + }), - Awful.key( - { Modkey, }, "[", - function() Awful.layout.inc(1) end, - { - description = "select next", - group = "layout" - } - ), + Awful.key({ Modkey }, '[', function() + Awful.layout.inc(1) + end, { + description = 'select next', + group = 'layout', + }), - Awful.key( - { Modkey, }, "]", - function() Awful.layout.inc(-1) end, - { - description = "select previous", - group = "layout" - } - ) + Awful.key({ Modkey }, ']', function() + Awful.layout.inc(-1) + end, { + description = 'select previous', + group = 'layout', + }) ) diff --git a/configs/awesome/binds/media.lua b/configs/awesome/binds/media.lua index 21a83bd..5931e5d 100644 --- a/configs/awesome/binds/media.lua +++ b/configs/awesome/binds/media.lua @@ -1,94 +1,62 @@ -- Binds related to media globalkeys = Gears.table.join( - globalkeys, + globalkeys, - -- Media - Awful.key( - {}, "XF86AudioLowerVolume", - function() - os.execute("pamixer -d 3") - end, - { - description = "lower volume", - group = "media" - } - ), + -- Media + Awful.key({}, 'XF86AudioLowerVolume', function() + os.execute 'pamixer -d 3' + end, { + description = 'lower volume', + group = 'media', + }), - Awful.key( - {}, "XF86AudioMicMute", - function() - os.execute("pactl set-source-mute @DEFAULT_SOURCE@ toggle") - end, - { - description = "mute mic", - group = "media" - } - ), + Awful.key({}, 'XF86AudioMicMute', function() + os.execute 'pactl set-source-mute @DEFAULT_SOURCE@ toggle' + end, { + description = 'mute mic', + group = 'media', + }), - Awful.key( - {}, "XF86AudioMute", - function() - os.execute("pamixer -t") - end, - { - description = "mute audio", - group = "media" - } - ), + Awful.key({}, 'XF86AudioMute', function() + os.execute 'pamixer -t' + end, { + description = 'mute audio', + group = 'media', + }), - Awful.key( - {}, "XF86AudioNext", - function() - os.execute("playerctl next") - end, - { - description = "next", - group = "media" - } - ), + Awful.key({}, 'XF86AudioNext', function() + os.execute 'playerctl next' + end, { + description = 'next', + group = 'media', + }), - Awful.key( - {}, "XF86AudioPlay", - function() - os.execute("playerctl play-pause") - end, - { - description = "play/pause", - group = "media" - } - ), + Awful.key({}, 'XF86AudioPlay', function() + os.execute 'playerctl play-pause' + end, { + description = 'play/pause', + group = 'media', + }), - Awful.key( - {}, "XF86AudioPrev", - function() - os.execute("playerctl previous") - end, - { - description = "previous", - group = "media" - } - ), + Awful.key({}, 'XF86AudioPrev', function() + os.execute 'playerctl previous' + end, { + description = 'previous', + group = 'media', + }), - Awful.key( - {}, "XF86AudioRaiseVolume", - function() - os.execute("pamixer -i 3") - end, - { - description = "raise volume", - group = "media" - } - ), + Awful.key({}, 'XF86AudioRaiseVolume', function() + os.execute 'pamixer -i 3' + end, { + description = 'raise volume', + group = 'media', + }), - Awful.key( - {}, "XF86AudioStop", - function() - os.execute("playerctl stop") - end, - { - description = "stop", - group = "media" - } - ) + Awful.key({}, 'XF86AudioStop', function() + os.execute 'playerctl stop' + end, { + description = 'stop', + group = 'media', + }) ) diff --git a/configs/awesome/binds/mouse.lua b/configs/awesome/binds/mouse.lua index 56279d9..8cc91da 100644 --- a/configs/awesome/binds/mouse.lua +++ b/configs/awesome/binds/mouse.lua @@ -1,51 +1,17 @@ -- Binds related to the mouse --- root.buttons( --- Gears.table.join( --- Awful.button( --- {}, 4, --- Awful.tag.viewnext --- ), --- Awful.button( --- {}, 5, --- Awful.tag.viewprev --- ) --- ) --- ) - clientbuttons = Gears.table.join( - Awful.button( - {}, 1, - function(c) - c:emit_signal( - "request::activate", - "mouse_click", - { raise = true } - ) - end - ), + Awful.button({}, 1, function(c) + c:emit_signal('request::activate', 'mouse_click', { raise = true }) + end), - Awful.button( - { Modkey }, 1, - function(c) - c:emit_signal( - "request::activate", - "mouse_click", - { raise = true } - ) - Awful.mouse.client.move(c) - end - ), + Awful.button({ Modkey }, 1, function(c) + c:emit_signal('request::activate', 'mouse_click', { raise = true }) + Awful.mouse.client.move(c) + end), - Awful.button( - { Modkey }, 3, - function(c) - c:emit_signal( - "request::activate", - "mouse_click", - { raise = true } - ) - Awful.mouse.client.resize(c) - end - ) + Awful.button({ Modkey }, 3, function(c) + c:emit_signal('request::activate', 'mouse_click', { raise = true }) + Awful.mouse.client.resize(c) + end) ) diff --git a/configs/awesome/binds/screen.lua b/configs/awesome/binds/screen.lua index f15ed28..1ccf7db 100644 --- a/configs/awesome/binds/screen.lua +++ b/configs/awesome/binds/screen.lua @@ -1,23 +1,19 @@ -- Binds related to screens globalkeys = Gears.table.join( - globalkeys, + globalkeys, - Awful.key( - { Modkey, }, "h", - function() Awful.screen.focus_relative(-1) end, - { - description = "focus previous screen", - group = "screen" - } - ), + Awful.key({ Modkey }, 'h', function() + Awful.screen.focus_relative(-1) + end, { + description = 'focus previous screen', + group = 'screen', + }), - Awful.key( - { Modkey, }, "l", - function() Awful.screen.focus_relative(1) end, - { - description = "focus next screen", - group = "screen" - } - ) + Awful.key({ Modkey }, 'l', function() + Awful.screen.focus_relative(1) + end, { + description = 'focus next screen', + group = 'screen', + }) ) diff --git a/configs/awesome/binds/tag.lua b/configs/awesome/binds/tag.lua index d7ab7b9..f6f4bb2 100644 --- a/configs/awesome/binds/tag.lua +++ b/configs/awesome/binds/tag.lua @@ -3,76 +3,57 @@ -- Be careful: we use keycodes to make it work on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, 9 do - globalkeys = Gears.table.join( - globalkeys, + globalkeys = Gears.table.join( + globalkeys, - -- View tag only. - Awful.key( - { Modkey }, "#" .. i + 9, - function() - local screen = Awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end - end, + -- View tag only. + Awful.key({ Modkey }, '#' .. i + 9, function() + local screen = Awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, { + description = 'view tag #' .. i, + group = 'tag', + }), - { - description = "view tag #" .. i, - group = "tag" - } - ), + -- Toggle tag display. + Awful.key({ Modkey, 'Control' }, '#' .. i + 9, function() + local screen = Awful.screen.focused() + local tag = screen.tags[i] + if tag then + Awful.tag.viewtoggle(tag) + end + end, { + description = 'toggle tag #' .. i, + group = 'tag', + }), - -- Toggle tag display. - Awful.key( - { Modkey, "Control" }, "#" .. i + 9, - function() - local screen = Awful.screen.focused() - local tag = screen.tags[i] - if tag then - Awful.tag.viewtoggle(tag) - end - end, + -- Move client to tag. + Awful.key({ Modkey, 'Shift' }, '#' .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, { + description = 'move focused client to tag #' .. i, + group = 'tag', + }), - { - description = "toggle tag #" .. i, - group = "tag" - } - ), - - -- Move client to tag. - Awful.key( - { Modkey, "Shift" }, "#" .. i + 9, - function() - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - { - description = "move focused client to tag #" .. i, - group = "tag" - } - ), - - -- Toggle tag on focused client. - Awful.key( - { Modkey, "Control", "Shift" }, "#" .. i + 9, - function() - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - - { - description = "toggle focused client on tag #" .. i, - group = "tag" - } - ) - ) + -- Toggle tag on focused client. + Awful.key({ Modkey, 'Control', 'Shift' }, '#' .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, { + description = 'toggle focused client on tag #' .. i, + group = 'tag', + }) + ) end diff --git a/configs/awesome/core/init.lua b/configs/awesome/core/init.lua index 4214f6a..a78886b 100644 --- a/configs/awesome/core/init.lua +++ b/configs/awesome/core/init.lua @@ -1,47 +1,40 @@ -- Handle startup errors if awesome.startup_errors then - Naughty.notify( - { - preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors - } - ) + Naughty.notify { + preset = naughty.config.presets.critical, + title = 'Oops, there were errors during startup!', + text = awesome.startup_errors, + } end -- Handle runtime errors after startup do - local in_error = false + local in_error = false - awesome.connect_signal( - "debug::error", - function(err) - -- Make sure we don't go into an endless error loop - if in_error then - return - end + awesome.connect_signal('debug::error', function(err) + -- Make sure we don't go into an endless error loop + if in_error then + return + end - in_error = true + in_error = true - Naughty.notify( - { - preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) - } - ) - in_error = false - end - ) + Naughty.notify { + preset = naughty.config.presets.critical, + title = 'Oops, an error happened!', + text = tostring(err), + } + in_error = false + end) end -require("awful.autofocus") -require("awful.hotkeys_popup.keys") +require 'awful.autofocus' +require 'awful.hotkeys_popup.keys' -Awful = require("awful") -Beautiful = require("beautiful") -Gears = require("gears") -Hotkeys_popup = require("awful.hotkeys_popup") -Menubar = require("menubar") -Naughty = require("naughty") -Wibox = require("wibox") +Awful = require 'awful' +Beautiful = require 'beautiful' +Gears = require 'gears' +Hotkeys_popup = require 'awful.hotkeys_popup' +Menubar = require 'menubar' +Naughty = require 'naughty' +Wibox = require 'wibox' diff --git a/configs/awesome/rc.lua b/configs/awesome/rc.lua index 5a9d06a..95ea2e7 100644 --- a/configs/awesome/rc.lua +++ b/configs/awesome/rc.lua @@ -1,40 +1,37 @@ -require('core') +require 'core' -- Set up key remaps -os.execute('setxkbmap -option "caps:escape,altwin:menu_win,altwin:meta_win"') +os.execute 'setxkbmap -option "caps:escape,altwin:menu_win,altwin:meta_win"' -- Some defaults -Browser = "firefox-developer-edition" -Browser2 = "chromium" -Editor = "nvim" -Email = "thunderbird" -Modkey = "Mod4" -Music = "spotify-launcher" -Terminal = "alacritty" -Beautiful.init(".config/awesome/theme.lua") +Browser = 'firefox-developer-edition' +Browser2 = 'chromium' +Editor = 'nvim' +Email = 'thunderbird' +Modkey = 'Mod4' +Music = 'spotify-launcher' +Terminal = 'alacritty' +Beautiful.init '.config/awesome/theme.lua' -- Define layouts Awful.layout.layouts = { - Awful.layout.suit.tile.right, - Awful.layout.suit.tile.bottom, - Awful.layout.suit.tile.left, - Awful.layout.suit.tile.top, + Awful.layout.suit.tile.right, + Awful.layout.suit.tile.bottom, + Awful.layout.suit.tile.left, + Awful.layout.suit.tile.top, } -- Set the terminal for applications that require it Menubar.utils.terminal = Terminal -- Split up the rest for readability -require('binds') -- keyboard/mouse -require('rules') -- client specific rules -require('signals') -- client signals -require('wibar') -- bar/screen/wallpaper stuff +require 'binds' -- keyboard/mouse +require 'rules' -- client specific rules +require 'signals' -- client signals +require 'wibar' -- bar/screen/wallpaper stuff -- Collect garbage to prevent memory leaks from widgets -Gears.timer.start_new( - 10, - function() - collectgarbage("step", 20000) - return true - end -) +Gears.timer.start_new(10, function() + collectgarbage('step', 20000) + return true +end) diff --git a/configs/awesome/rules/init.lua b/configs/awesome/rules/init.lua index e6ea8d2..b08086d 100644 --- a/configs/awesome/rules/init.lua +++ b/configs/awesome/rules/init.lua @@ -1,57 +1,57 @@ Awful.rules.rules = { - -- All clients will match this rule. - { - rule = {}, - properties = { - border_width = Beautiful.border_width, - border_color = Beautiful.border_normal, - focus = Awful.client.focus.filter, - raise = true, - keys = clientkeys, - buttons = clientbuttons, - screen = Awful.screen.preferred, - placement = Awful.placement.no_overlap + Awful.placement.no_offscreen - } + -- All clients will match this rule. + { + rule = {}, + properties = { + border_width = Beautiful.border_width, + border_color = Beautiful.border_normal, + focus = Awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = Awful.screen.preferred, + placement = Awful.placement.no_overlap + Awful.placement.no_offscreen, }, + }, - -- Floating clients. - { - rule_any = { - instance = { - "DTA", -- Firefox addon DownThemAll. - "copyq", -- Includes session name in class. - "pinentry", - }, - class = { - "Arandr", - "Blueman-manager", - "Gpick", - "Kruler", - "MessageWin", -- kalarm. - "Sxiv", - "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. - "Wpa_gui", - "veromix", - "xtightvncviewer" }, + -- Floating clients. + { + rule_any = { + instance = { + 'DTA', -- Firefox addon DownThemAll. + 'copyq', -- Includes session name in class. + 'pinentry', + }, + class = { + 'Arandr', + 'Blueman-manager', + 'Gpick', + 'Kruler', + 'MessageWin', -- kalarm. + 'Sxiv', + 'Tor Browser', -- Needs a fixed window size to avoid fingerprinting by screen size. + 'Wpa_gui', + 'veromix', + 'xtightvncviewer', + }, - -- Note that the name property shown in xprop might be set slightly after creation of the client - -- and the name shown there might not match defined rules here. - name = { - "Event Tester", -- xev. - }, - role = { - "AlarmWindow", -- Thunderbird's calendar. - "ConfigManager", -- Thunderbird's about:config. - "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. - } - }, - properties = { floating = true } + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + 'Event Tester', -- xev. + }, + role = { + 'AlarmWindow', -- Thunderbird's calendar. + 'ConfigManager', -- Thunderbird's about:config. + 'pop-up', -- e.g. Google Chrome's (detached) Developer Tools. + }, }, + properties = { floating = true }, + }, - -- Add titlebars to normal clients and dialogs - { - rule_any = { type = { "normal", "dialog" } - }, - properties = { titlebars_enabled = false } - }, + -- Add titlebars to normal clients and dialogs + { + rule_any = { type = { 'normal', 'dialog' } }, + properties = { titlebars_enabled = false }, + }, } diff --git a/configs/awesome/signals/init.lua b/configs/awesome/signals/init.lua index b79fd5b..97ebead 100644 --- a/configs/awesome/signals/init.lua +++ b/configs/awesome/signals/init.lua @@ -1,136 +1,93 @@ -client.connect_signal( - "manage", - function(c) - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- if not awesome.startup then awful.client.setslave(c) end +client.connect_signal('manage', function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end - if awesome.startup - and not c.size_hints.user_position - and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count changes. - Awful.placement.no_offscreen(c) - end - end -) + if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + Awful.placement.no_offscreen(c) + end +end) -- Add a titlebar if titlebars_enabled is set to true in the rules. -client.connect_signal( - "request::titlebars", - function(c) - -- buttons for the titlebar - local buttons = Gears.table.join( - Awful.button( - {}, 1, - function() - c:emit_signal( - "request::activate", "titlebar", - { raise = true } - ) - Awful.mouse.client.move(c) - end - ), - Awful.button( - {}, 3, - function() - c:emit_signal( - "request::activate", "titlebar", - { raise = true } - ) - Awful.mouse.client.resize(c) - end - ) - ) +client.connect_signal('request::titlebars', function(c) + -- buttons for the titlebar + local buttons = Gears.table.join( + Awful.button({}, 1, function() + c:emit_signal('request::activate', 'titlebar', { raise = true }) + Awful.mouse.client.move(c) + end), + Awful.button({}, 3, function() + c:emit_signal('request::activate', 'titlebar', { raise = true }) + Awful.mouse.client.resize(c) + end) + ) - Awful.titlebar(c):setup { - { -- Left - Awful.titlebar.widget.iconwidget(c), - buttons = buttons, - layout = Wibox.layout.fixed.horizontal - }, - { -- Middle - { -- Title - align = "center", - widget = Awful.titlebar.widget.titlewidget(c) - }, - buttons = buttons, - layout = Wibox.layout.flex.horizontal - }, - { -- Right - Awful.titlebar.widget.floatingbutton(c), - Awful.titlebar.widget.maximizedbutton(c), - Awful.titlebar.widget.stickybutton(c), - Awful.titlebar.widget.ontopbutton(c), - Awful.titlebar.widget.closebutton(c), - layout = Wibox.layout.fixed.horizontal() - }, - layout = Wibox.layout.align.horizontal - } - end -) + Awful.titlebar(c):setup { + { -- Left + Awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = Wibox.layout.fixed.horizontal, + }, + { -- Middle + { -- Title + align = 'center', + widget = Awful.titlebar.widget.titlewidget(c), + }, + buttons = buttons, + layout = Wibox.layout.flex.horizontal, + }, + { -- Right + Awful.titlebar.widget.floatingbutton(c), + Awful.titlebar.widget.maximizedbutton(c), + Awful.titlebar.widget.stickybutton(c), + Awful.titlebar.widget.ontopbutton(c), + Awful.titlebar.widget.closebutton(c), + layout = Wibox.layout.fixed.horizontal(), + }, + layout = Wibox.layout.align.horizontal, + } +end) --- Enable sloppy focus, so that focus follows mouse. --- client.connect_signal( --- "mouse::enter", --- function(c) --- c:emit_signal( --- "request::activate", "mouse_enter", --- { raise = false } --- ) --- end --- ) +client.connect_signal('focus', function(c) + c.border_color = Beautiful.border_focus +end) -client.connect_signal( - "focus", - function(c) - c.border_color = Beautiful.border_focus - end -) +client.connect_signal('unfocus', function(c) + c.border_color = Beautiful.border_normal +end) -client.connect_signal( - "unfocus", - function(c) - c.border_color = Beautiful.border_normal - end -) +awesome.connect_signal('exit', function(reason_restart) + if not reason_restart then + return + end -awesome.connect_signal( - 'exit', - function(reason_restart) - if not reason_restart then - return - end + local file = io.open('/tmp/awesomewm-last-selected-tags', 'w+') - local file = io.open('/tmp/awesomewm-last-selected-tags', 'w+') + for s in screen do + file:write(s.selected_tag.index, '\n') + end - for s in screen do - file:write(s.selected_tag.index, '\n') - end + file:close() +end) - file:close() - end -) +awesome.connect_signal('startup', function() + local file = io.open('/tmp/awesomewm-last-selected-tags', 'r') + if not file then + return + end -awesome.connect_signal( - 'startup', - function() - local file = io.open('/tmp/awesomewm-last-selected-tags', 'r') - if not file then - return - end + local selected_tags = {} - local selected_tags = {} + for line in file:lines() do + table.insert(selected_tags, tonumber(line)) + end - for line in file:lines() do - table.insert(selected_tags, tonumber(line)) - end + for s in screen do + local i = selected_tags[s.index] + local t = s.tags[i] + t:view_only() + end - for s in screen do - local i = selected_tags[s.index] - local t = s.tags[i] - t:view_only() - end - - file:close() - end -) + file:close() +end) diff --git a/configs/awesome/theme.lua b/configs/awesome/theme.lua index ed4be97..3723a20 100644 --- a/configs/awesome/theme.lua +++ b/configs/awesome/theme.lua @@ -1,70 +1,62 @@ -local xresources = require("beautiful.xresources") +local xresources = require 'beautiful.xresources' -local dpi = xresources.apply_dpi -local gfs = require("gears.filesystem") -local theme = {} -local theme_assets = require("beautiful.theme_assets") -local themes_path = gfs.get_themes_dir() -local xrdb = xresources.get_current_theme() +local dpi = xresources.apply_dpi +local gfs = require 'gears.filesystem' +local theme = {} +local theme_assets = require 'beautiful.theme_assets' +local themes_path = gfs.get_themes_dir() +local xrdb = xresources.get_current_theme() -theme.font = "monospace 11" -theme.wallpaper = '.cache/wal/bg' -theme.useless_gap = dpi(8) -theme.border_width = dpi(1) -theme.menu_height = dpi(15) -theme.menu_width = dpi(100) +theme.font = 'monospace 11' +theme.wallpaper = '.cache/wal/bg' +theme.useless_gap = dpi(8) +theme.border_width = dpi(1) +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) -- Colors -theme.bg_focus = xrdb.color4 -theme.bg_minimize = xrdb.color4 -theme.bg_normal = xrdb.background -theme.bg_systray = theme.bg_normal -theme.bg_urgent = xrdb.color1 +theme.bg_focus = xrdb.color4 +theme.bg_minimize = xrdb.color4 +theme.bg_normal = xrdb.background +theme.bg_systray = theme.bg_normal +theme.bg_urgent = xrdb.color1 -theme.border_focus = xrdb.color4 -theme.border_marked = xrdb.color10 -theme.border_normal = xrdb.color5 +theme.border_focus = xrdb.color4 +theme.border_marked = xrdb.color10 +theme.border_normal = xrdb.color5 -theme.fg_focus = xrdb.foreground -theme.fg_minimize = xrdb.foreground -theme.fg_normal = xrdb.foreground -theme.fg_urgent = xrdb.foreground +theme.fg_focus = xrdb.foreground +theme.fg_minimize = xrdb.foreground +theme.fg_normal = xrdb.foreground +theme.fg_urgent = xrdb.foreground -- Generate taglist squares: -local taglist_square_size = dpi(4) +local taglist_square_size = dpi(4) -theme.taglist_squares_sel = theme_assets.taglist_squares_sel( - taglist_square_size, - theme.fg_normal -) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel(taglist_square_size, theme.fg_normal) -theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( - taglist_square_size, - theme.fg_normal -) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(taglist_square_size, theme.fg_normal) -- You can use your own layout icons like this: -theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png" -theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png" -theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png" -theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png" -theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png" -theme.layout_fairh = themes_path .. "default/layouts/fairhw.png" -theme.layout_fairv = themes_path .. "default/layouts/fairvw.png" -theme.layout_floating = themes_path .. "default/layouts/floatingw.png" -theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png" -theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png" -theme.layout_max = themes_path .. "default/layouts/maxw.png" -theme.layout_spiral = themes_path .. "default/layouts/spiralw.png" -theme.layout_tile = themes_path .. "default/layouts/tilew.png" -theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png" -theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png" -theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png" +theme.layout_cornerne = themes_path .. 'default/layouts/cornernew.png' +theme.layout_cornernw = themes_path .. 'default/layouts/cornernww.png' +theme.layout_cornerse = themes_path .. 'default/layouts/cornersew.png' +theme.layout_cornersw = themes_path .. 'default/layouts/cornersww.png' +theme.layout_dwindle = themes_path .. 'default/layouts/dwindlew.png' +theme.layout_fairh = themes_path .. 'default/layouts/fairhw.png' +theme.layout_fairv = themes_path .. 'default/layouts/fairvw.png' +theme.layout_floating = themes_path .. 'default/layouts/floatingw.png' +theme.layout_fullscreen = themes_path .. 'default/layouts/fullscreenw.png' +theme.layout_magnifier = themes_path .. 'default/layouts/magnifierw.png' +theme.layout_max = themes_path .. 'default/layouts/maxw.png' +theme.layout_spiral = themes_path .. 'default/layouts/spiralw.png' +theme.layout_tile = themes_path .. 'default/layouts/tilew.png' +theme.layout_tilebottom = themes_path .. 'default/layouts/tilebottomw.png' +theme.layout_tileleft = themes_path .. 'default/layouts/tileleftw.png' +theme.layout_tiletop = themes_path .. 'default/layouts/tiletopw.png' -- Define the icon theme for application icons. If not set then the icons -- from /usr/share/icons and /usr/share/icons/hicolor will be used. -theme.icon_theme = nil +theme.icon_theme = nil return theme - --- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/configs/awesome/wibar/init.lua b/configs/awesome/wibar/init.lua index f420abf..4b8d7ba 100644 --- a/configs/awesome/wibar/init.lua +++ b/configs/awesome/wibar/init.lua @@ -1,117 +1,93 @@ -require('wibar.widgets') -require('wibar.taglist') -require('wibar.tasklist') +require 'wibar.widgets' +require 'wibar.taglist' +require 'wibar.tasklist' local function set_wallpaper(s) - -- Wallpaper - if Beautiful.wallpaper then - local wallpaper = Beautiful.wallpaper - -- If wallpaper is a function, call it with the screen - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - Gears.wallpaper.maximized(wallpaper, s, true) + -- Wallpaper + if Beautiful.wallpaper then + local wallpaper = Beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == 'function' then + wallpaper = wallpaper(s) end + Gears.wallpaper.maximized(wallpaper, s, true) + end end -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -screen.connect_signal( - "property::geometry", - set_wallpaper -) +screen.connect_signal('property::geometry', set_wallpaper) -Awful.screen.connect_for_each_screen( - function(s) - -- Each screen has its own tag table. - Awful.tag( - { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, - s, - Awful.layout.layouts[1] - ) +Awful.screen.connect_for_each_screen(function(s) + -- Each screen has its own tag table. + Awful.tag({ '1', '2', '3', '4', '5', '6', '7', '8', '9' }, s, Awful.layout.layouts[1]) - -- Create a promptbox for each screen - s.mypromptbox = Awful.widget.prompt() + -- Create a promptbox for each screen + s.mypromptbox = Awful.widget.prompt() - -- Create an imagebox widget which will contain an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = Awful.widget.layoutbox(s) + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = Awful.widget.layoutbox(s) - s.mylayoutbox:buttons( - Gears.table.join( - Awful.button( - {}, 3, - function() - Awful.layout.inc(-1) - end - ), + s.mylayoutbox:buttons(Gears.table.join( + Awful.button({}, 3, function() + Awful.layout.inc(-1) + end), - Awful.button( - {}, 4, - function() - Awful.layout.inc(1) - end - ), + Awful.button({}, 4, function() + Awful.layout.inc(1) + end), - Awful.button( - {}, 5, - function() - Awful.layout.inc(-1) - end - ) - ) - ) + Awful.button({}, 5, function() + Awful.layout.inc(-1) + end) + )) - -- Create a taglist widget - s.mytaglist = Awful.widget.taglist { - screen = s, - filter = Awful.widget.taglist.filter.all, - buttons = Taglist_buttons - } + -- Create a taglist widget + s.mytaglist = Awful.widget.taglist { + screen = s, + filter = Awful.widget.taglist.filter.all, + buttons = Taglist_buttons, + } - -- Create a tasklist widget - s.mytasklist = Awful.widget.tasklist { - screen = s, - filter = Awful.widget.tasklist.filter.currenttags, - buttons = Tasklist_buttons - } + -- Create a tasklist widget + s.mytasklist = Awful.widget.tasklist { + screen = s, + filter = Awful.widget.tasklist.filter.currenttags, + buttons = Tasklist_buttons, + } - -- Create the Wibox - s.myWibox = Awful.wibar( - { - position = "top", - screen = s - } - ) + -- Create the Wibox + s.myWibox = Awful.wibar { + position = 'top', + screen = s, + } - -- Add widgets to the Wibox - s.myWibox:setup { - layout = Wibox.layout.align.horizontal, + -- Add widgets to the Wibox + s.myWibox:setup { + layout = Wibox.layout.align.horizontal, - -- Left - { - layout = Wibox.layout.fixed.horizontal, - s.mytaglist, - s.mypromptbox, - }, + -- Left + { + layout = Wibox.layout.fixed.horizontal, + s.mytaglist, + s.mypromptbox, + }, - -- Middle - s.mytasklist, + -- Middle + s.mytasklist, - -- Right - { - layout = Wibox.layout.fixed.horizontal, - Cpu_widget(), - Ram_widget(), - Batteryarc_widget( - { enable_battery_warning = false } - ), - Wibox.widget.systray(), - Mytextclock, - s.mylayoutbox, - }, - } - end -) + -- Right + { + layout = Wibox.layout.fixed.horizontal, + Cpu_widget(), + Ram_widget(), + Batteryarc_widget { enable_battery_warning = false }, + Wibox.widget.systray(), + Mytextclock, + s.mylayoutbox, + }, + } +end) --os.execute('nitrogen --set-zoom-fill $(awk {print} ~/.cache/wal/wal)') -os.execute('wal -Rsq') +os.execute 'wal -Rsq' diff --git a/configs/awesome/wibar/taglist.lua b/configs/awesome/wibar/taglist.lua index e7d93aa..0a4bac2 100644 --- a/configs/awesome/wibar/taglist.lua +++ b/configs/awesome/wibar/taglist.lua @@ -1,44 +1,27 @@ Taglist_buttons = Gears.table.join( - Awful.button( - {}, 1, - function(t) - t:view_only() - end - ), + Awful.button({}, 1, function(t) + t:view_only() + end), - Awful.button( - { Modkey }, 1, - function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end - ), + Awful.button({ Modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), - Awful.button( - {}, 3, - Awful.tag.viewtoggle - ), + Awful.button({}, 3, Awful.tag.viewtoggle), - Awful.button( - { Modkey }, 3, - function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end - ), + Awful.button({ Modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), - Awful.button({}, 4, - function(t) - Awful.tag.viewnext(t.screen) - end - ), + Awful.button({}, 4, function(t) + Awful.tag.viewnext(t.screen) + end), - Awful.button( - {}, 5, - function(t) - Awful.tag.viewprev(t.screen) - end - ) + Awful.button({}, 5, function(t) + Awful.tag.viewprev(t.screen) + end) ) diff --git a/configs/awesome/wibar/tasklist.lua b/configs/awesome/wibar/tasklist.lua index d61e604..84046ca 100644 --- a/configs/awesome/wibar/tasklist.lua +++ b/configs/awesome/wibar/tasklist.lua @@ -1,37 +1,19 @@ Tasklist_buttons = Gears.table.join( - Awful.button( - {}, 1, - function(c) - if c == client.focus then - c.minimized = true - else - c:emit_signal( - "request::activate", - "tasklist", - { raise = true } - ) - end - end - ), + Awful.button({}, 1, function(c) + if c == client.focus then + c.minimized = true + else + c:emit_signal('request::activate', 'tasklist', { raise = true }) + end + end), - Awful.button( - {}, 3, - function() - Awful.menu.client_list( - { theme = { width = 250 } } - ) - end - ), - Awful.button( - {}, 4, - function() - Awful.client.focus.byidx(1) - end - ), - Awful.button( - {}, 5, - function() - Awful.client.focus.byidx(-1) - end - ) + Awful.button({}, 3, function() + Awful.menu.client_list { theme = { width = 250 } } + end), + Awful.button({}, 4, function() + Awful.client.focus.byidx(1) + end), + Awful.button({}, 5, function() + Awful.client.focus.byidx(-1) + end) ) diff --git a/configs/awesome/wibar/widgets.lua b/configs/awesome/wibar/widgets.lua index 0051e01..13ad7c5 100644 --- a/configs/awesome/wibar/widgets.lua +++ b/configs/awesome/wibar/widgets.lua @@ -1,28 +1,22 @@ -Calendar_widget = require("awesome-wm-widgets.calendar-widget.calendar") -Cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget") -Ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget") -Batteryarc_widget = require("awesome-wm-widgets.batteryarc-widget.batteryarc") - +Calendar_widget = require 'awesome-wm-widgets.calendar-widget.calendar' +Cpu_widget = require 'awesome-wm-widgets.cpu-widget.cpu-widget' +Ram_widget = require 'awesome-wm-widgets.ram-widget.ram-widget' +Batteryarc_widget = require 'awesome-wm-widgets.batteryarc-widget.batteryarc' Mytextclock = Wibox.widget { - format = ' %a %b %d, %I:%M%P ', - widget = Wibox.widget.textclock + format = ' %a %b %d, %I:%M%P ', + widget = Wibox.widget.textclock, } -local cw = Calendar_widget( - { - placement = 'top_right', - start_sunday = 'true', - previous_month_button = 4, - next_month_button = 5, - } -) +local cw = Calendar_widget { + placement = 'top_right', + start_sunday = 'true', + previous_month_button = 4, + next_month_button = 5, +} -Mytextclock:connect_signal( - "button::press", - function(_, _, _, button) - if button == 1 then - cw.toggle() - end - end -) +Mytextclock:connect_signal('button::press', function(_, _, _, button) + if button == 1 then + cw.toggle() + end +end) diff --git a/configs/x11/xinitrc b/configs/x11/xinitrc index fb0089f..825c259 100755 --- a/configs/x11/xinitrc +++ b/configs/x11/xinitrc @@ -4,9 +4,9 @@ # Run xprofile if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then - . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" + . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" else - . "$HOME/.xprofile" + . "$HOME/.xprofile" fi # Set system colors diff --git a/configs/x11/xprofile b/configs/x11/xprofile index 6f4fc91..ce02274 100755 --- a/configs/x11/xprofile +++ b/configs/x11/xprofile @@ -9,8 +9,8 @@ fi # Tint screen at night redshift -l \ - $(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" \ - | sed 's/.*"lat": \(-\?[0-9.]*\).*"lng": \(-\?[0-9.]*\).*/\1:\2/') & + "$(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" \ + | sed 's/.*"lat": \(-\?[0-9.]*\).*"lng": \(-\?[0-9.]*\).*/\1:\2/')" & # Password prompt popup /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & diff --git a/readme.md b/readme.md index 89afe94..574ee6e 100644 --- a/readme.md +++ b/readme.md @@ -19,7 +19,7 @@ This started as a script for quick deployment of some tools when connected to a The meat and potatoes - [Yay](https://github.com/Jguer/yay) - Easier to use Arch package manager that supports AUR -- [bat](https://github.com/sharkdp/bat) - Better cat for quickly viewing files +- [bat](https://github.com/sharkdp/bat) - Better cat for quickly viewing files - [btop](https://github.com/aristocratos/btop) - Top++ - [byobu](https://www.byobu.org/) - Comfy multiplexer - [fd](https://github.com/sharkdp/fd) - Alternative to find, used by bat and made by the same guy @@ -29,7 +29,7 @@ The meat and potatoes - [neovim](https://github.com/neovim/neovim) - Edit text blazingly fast (even over ssh!) - [nnn](https://github.com/jarun/nnn) - Lightning fast file manager - [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh) - Community enhancements for zsh. Easier than DIY -- [pywal](https://github.com/dylanaraps/pywal) - Set whole system color scheme from wallpaper colors +- [pywal](https://github.com/dylanaraps/pywal) - Set whole system color scheme from wallpaper colors - [ripgrep](https://github.com/BurntSushi/ripgrep) - Extremely fast grep replacement - [rsync](https://rsync.samba.org/) - For my 'push' alias - [sl](https://github.com/eyJhb/sl) - For when you're too fast @@ -42,6 +42,7 @@ The meat and potatoes AwesomeWM starter kit Base: + - [acpi](https://wiki.archlinux.org/title/ACPI_modules) - For battery widget - [alacritty](https://github.com/alacritty/alacritty) - Terminal emulator - [arandr](https://christian.amsuess.com/tools/arandr) - To configure screens @@ -78,15 +79,15 @@ Eye candy, bloat, stuff that won't install on ARM devices - [thunderbird](https://www.thunderbird.net) - Email client - [wal-telegram-git](https://github.com/guillaumeboehm/wal-telegram) - Generate telegram-desktop theme - ## Install + The install script clones this repo, installs a few dependencies and copies my configs to `~/.config/`. It then links `~/.xinitrc` and `~/.zprofile` to the ones copied from the repo, all while creating a **SINGLE** backup for any files that already exist. **NOTE:** Only **ONE** backup per file is saved to prevent piling up backups. It's only meant to catch small oversights and is very verbose. In other words, if you run the installer twice **IT WILL OVERWRITE THE BACKUP!** The install script is only for Arch right now but I plan to include any distro with this software in their repos. At least the popular ones 1. Create a new user or backup your home directory if you're unsure about anything. If you have nothing to lose then go ahead and YOLO it. Just don't complain if something gets overwritten -1. ```sh <(curl -s https://doors.doordesk.net/setup)``` +1. `sh <(curl -s https://doors.doordesk.net/setup)` 1. Choose your adventure 1. Log out and log back in @@ -100,11 +101,14 @@ Just run `startx` or start awesome from your display manager if you have one ## Post Install ### Colors + Some manual setup is required for theming if you want eye candy. My scripts should handle everything else + - Install [pywalfox](https://addons.mozilla.org/en-US/firefox/addon/pywalfox/) for firefox, then open it and click the "Fetch Pywal colors" button. You shouldn't have to touch it ever again - Point telegram to [wal-telegram](https://github.com/guillaumeboehm/wal-telegram#set-the-color-palette)'s generated theme. It should handle itself from here ## Future: + - Polish nvim - nnn setup - posix compliance diff --git a/scripts/copy_and_link b/scripts/copy_and_link index 9ad09f0..1275a6a 100755 --- a/scripts/copy_and_link +++ b/scripts/copy_and_link @@ -3,23 +3,23 @@ set -e # Copy configs and make a backup if it already exists -echo -e "\nInstalling Configs..." - for file in configs/* - do - echo -e "\n$file..." - cp -rbv $file $HOME/.config/ - done +printf "\nInstalling Configs..." +for file in configs/* +do + printf "\n%s..." "$file" + cp -rbv "$file" "$HOME"/.config/ +done # Copy scripts and make a backup if it already exists -echo -e "\nInstalling Scripts..." +printf "\nInstalling Scripts..." if [ ! -d "$HOME/.local/bin" ]; then mkdir "$HOME/.local/bin" fi -cp -rbv bin $HOME/.local +cp -rbv bin "$HOME"/.local # Link shell files and make a backup if it already exists -echo -e "\nLinking shell..." - cp -sbv $HOME/.config/shell/profile ~/.zprofile - cp -sbv $HOME/.config/x11/xinitrc ~/.xinitrc +printf "\nLinking shell..." +cp -sbv "$HOME"/.config/shell/profile ~/.zprofile +cp -sbv "$HOME"/.config/x11/xinitrc ~/.xinitrc diff --git a/scripts/install_min_fedora b/scripts/install_min_fedora index ef8a71e..8415ef2 100755 --- a/scripts/install_min_fedora +++ b/scripts/install_min_fedora @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Minimal setup for Fedora @@ -7,16 +7,16 @@ set -e cd sudo dnf -y install \ -sl \ -btop \ -neovim \ -byobu \ -zsh \ -nnn \ -mosh \ -clang \ + sl \ + btop \ + neovim \ + byobu \ + zsh \ + nnn \ + mosh \ + clang \ -# Packer + # Packer if ! test -d ~/.local/share/nvim/site/pack/packer/start/packer.nvim; then git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ~/.local/share/nvim/site/pack/packer/start/packer.nvim @@ -28,4 +28,4 @@ if ! test -d .config/zsh/ohmyzsh; then fi # Set shell -sudo usermod -s /bin/zsh $USER +sudo usermod -s /bin/zsh "$USER" diff --git a/scripts/install_min_ubuntu b/scripts/install_min_ubuntu index f01c085..63a7e0c 100755 --- a/scripts/install_min_ubuntu +++ b/scripts/install_min_ubuntu @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Minimal setup for Ubuntu @@ -37,4 +37,4 @@ if ! test -d .config/zsh/ohmyzsh; then fi # Set shell -sudo chsh -s /bin/zsh $USER +sudo chsh -s /bin/zsh "$USER" diff --git a/scripts/nvim_clean b/scripts/nvim_clean index 4fd0c70..a501bd2 100755 --- a/scripts/nvim_clean +++ b/scripts/nvim_clean @@ -1,4 +1,4 @@ #!/bin/sh -rm -rf $HOME/.local/share/nvim -rm -rf $HOME/.config/nvim +rm -rf "$HOME"/.local/share/nvim +rm -rf "$HOME"/.config/nvim