From fc761cb33bffea687662d9c43c318919c0d3974e Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 17 Jul 2022 20:29:08 -0700 Subject: [PATCH] Cleaned up keybinds --- binds/awesome.lua | 10 ---- binds/layout.lua | 44 +----------------- binds/system.lua | 14 ------ binds/unused.lua | 83 ---------------------------------- clients/binds/keys.lua | 52 ++++++--------------- modules/backlight/keybinds.lua | 35 -------------- modules/backlight/util.lua | 2 + modules/i3lock/init.lua | 2 +- modules/screenshot/init.lua | 13 +----- 9 files changed, 22 insertions(+), 233 deletions(-) delete mode 100755 binds/unused.lua diff --git a/binds/awesome.lua b/binds/awesome.lua index 84a1d4d..985b709 100755 --- a/binds/awesome.lua +++ b/binds/awesome.lua @@ -27,16 +27,6 @@ return gears.table.join( } ), - awful.key( {"Mod4"}, "x", - function () - awful.screen.focused().mypromptbox:run() - end, - { - description = "Run prompt", - group = "Launcher" - } - ), - awful.key( {"Mod4"}, "Return", function () awful.spawn(config.core.terminal) diff --git a/binds/layout.lua b/binds/layout.lua index 0e6dea2..a6f9f1f 100755 --- a/binds/layout.lua +++ b/binds/layout.lua @@ -1,7 +1,7 @@ local layoutmanager = require("core.layouts.layoutmanager") return gears.table.join( - awful.key( {"Mod4"}, "j", + awful.key( {"Mod4"}, "+", function () awful.tag.incmwfact( 0.05) end, @@ -11,7 +11,7 @@ return gears.table.join( } ), - awful.key({"Mod4"}, "h", + awful.key({"Mod4"}, "-", function () awful.tag.incmwfact(-0.05) end, @@ -21,46 +21,6 @@ return gears.table.join( } ), - awful.key( {"Mod4", "Shift"}, "h", - function () - awful.tag.incnmaster(1, nil, true) - end, - { - description = "increase the number of master clients", - group = "Layout" - } - ), - - awful.key( {"Mod4", "Shift"}, "l", - function () - awful.tag.incnmaster(-1, nil, true) - end, - { - description = "decrease the number of master clients", - group = "Layout" - } - ), - - awful.key( {"Mod4", "Control"}, "h", - function () - awful.tag.incncol(1, nil, true) - end, - { - description = "increase the number of columns", - group = "Layout" - } - ), - - awful.key( {"Mod4", "Control"}, "l", - function () - awful.tag.incncol(-1, nil, true) - end, - { - description = "decrease the number of columns", - group = "Layout" - } - ), - awful.key( {"Mod4"}, "l", function () layoutmanager:next() diff --git a/binds/system.lua b/binds/system.lua index f30889b..eef1d4b 100644 --- a/binds/system.lua +++ b/binds/system.lua @@ -20,19 +20,5 @@ return gears.table.join( description = "Shutdown", group = "System" } - ), - - - - awful.key( {"Mod4", "Control"}, "x", - function () - -- requires sudoers rule - awful.spawn("sudo systemctl restart lightdm") - end, - - { - description = "Restart lightdm", - group = "System" - } ) ) diff --git a/binds/unused.lua b/binds/unused.lua deleted file mode 100755 index f47d7d0..0000000 --- a/binds/unused.lua +++ /dev/null @@ -1,83 +0,0 @@ ---[[ - - - - -awful.key({"Mod4", "Control"}, "j", - function () - awful.screen.focus_relative( 1) - end, - { - description = "focus the next screen", - group = "screen" - } -), - - - - - -awful.key({"Mod4", "Control"}, "k", - function () - awful.screen.focus_relative(-1) - end, - { - description = "focus the previous screen", - group = "screen" - } -) - - - - - --- Bind all key numbers to tags. --- 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, - -- View tag only. - awful.key({ "Mod4" }, "#" .. 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"}), - -- Toggle tag display. - awful.key({ "Mod4", "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"}), - -- Move client to tag. - awful.key({ "Mod4", "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({ "Mod4", "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/clients/binds/keys.lua b/clients/binds/keys.lua index 4104c66..7c94bf3 100755 --- a/clients/binds/keys.lua +++ b/clients/binds/keys.lua @@ -36,17 +36,6 @@ return gears.table.join( } ), - awful.key( {"Mod4"}, "f", - function (c) - c.fullscreen = not c.fullscreen - c:raise() - end, - { - description = "toggle fullscreen", - group = "client" - } - ), - awful.key( {"Mod4", "Shift"}, "c", function (c) c:kill() @@ -57,7 +46,17 @@ return gears.table.join( } ), - awful.key( {"Mod4", "Control"}, "space", + awful.key( {"Mod4", "Control"}, "Return", + function (c) + c:swap(awful.client.getmaster()) + end, + { + description = "move to master", + group = "client" + } + ), + + awful.key( {"Mod4"}, "f", awful.client.floating.toggle, { description = "toggle floating", @@ -65,12 +64,13 @@ return gears.table.join( } ), - awful.key( {"Mod4", "Control"}, "Return", + awful.key( {"Mod4"}, "g", function (c) - c:swap(awful.client.getmaster()) + c.fullscreen = not c.fullscreen + c:raise() end, { - description = "move to master", + description = "toggle fullscreen", group = "client" } ), @@ -103,27 +103,5 @@ return gears.table.join( { description = "(un)maximize", group = "client" } - ), - - awful.key( {"Mod4", "Control"}, "m", - function (c) - c.maximized_vertical = not c.maximized_vertical - c:raise() - end, - { - description = "(un)maximize vertically", - group = "client" - } - ), - - awful.key( {"Mod4", "Shift"}, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() - end, - { - description = "(un)maximize horizontally", - group = "client" - } ) ) diff --git a/modules/backlight/keybinds.lua b/modules/backlight/keybinds.lua index 372e47f..4099c42 100755 --- a/modules/backlight/keybinds.lua +++ b/modules/backlight/keybinds.lua @@ -19,40 +19,5 @@ return gears.table.join( description = "Lower brightness", group = "System" } - ), - - awful.key( { "Mod4" }, "o", - function () - backlight.redshift(5600) - end, - { - description = "Default redshift", - group = "System" - } - ), - - awful.key( { "Mod4", "Shift" }, "o", - function () - backlight.reset_redshift() - end, - { - description = "Reset redshift", - group = "System" - } - ), - - awful.key( { "Mod4", "Shift", "Control" }, "o", - function () - backlight.reset_redshift() - awful.prompt.run { - prompt = "Color temperature: ", - textbox = awful.screen.focused().mypromptbox.widget, - exe_callback = backlight.redshift - } - end, - { - description = "Set redshift", - group = "System" - } ) ) diff --git a/modules/backlight/util.lua b/modules/backlight/util.lua index fadef6c..29fc2ff 100755 --- a/modules/backlight/util.lua +++ b/modules/backlight/util.lua @@ -50,6 +50,7 @@ backlight.backlight_down = function() backlight.exec_hooks() end +--[[ backlight.redshift = function(temp) awful.spawn("redshift -O " .. tostring(temp), false) end @@ -57,6 +58,7 @@ end backlight.reset_redshift = function() awful.spawn("redshift -x", false) end +--]] return backlight diff --git a/modules/i3lock/init.lua b/modules/i3lock/init.lua index 48e2d56..386bb62 100644 --- a/modules/i3lock/init.lua +++ b/modules/i3lock/init.lua @@ -3,7 +3,7 @@ script = script .. " " return { keybinds = gears.table.join( - awful.key( {"Mod4"}, "a", + awful.key( {"Mod4"}, "l", function () awful.spawn(script .. beautiful.icons.lockicon, false) end, diff --git a/modules/screenshot/init.lua b/modules/screenshot/init.lua index 06e7c8a..f3998ce 100644 --- a/modules/screenshot/init.lua +++ b/modules/screenshot/init.lua @@ -2,9 +2,11 @@ local script = conf_dir .. "modules/screenshot/screenshot.fish" script = script .. " " +--[[ local function capture(source, target) awful.spawn(script .. "capture " .. source .. " " .. target, false) end +]]-- local function flameshot() awful.spawn("flameshot gui", false) @@ -13,17 +15,6 @@ end return { keybinds = gears.table.join( - awful.key( {"Control"}, "Print", - function () - capture("region", "ocr") - end, - - { - description = "OCR a region to the clipboard", - group = "Desktop" - } - ), - awful.key( {}, "Print", function () flameshot()