From 39835d2a822f68f474ec414e1bb895dd281e592b Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Fri, 28 Jan 2022 22:38:59 +0100 Subject: [PATCH] add alt+ta switcher --- .gitignore | 1 + install-deps.sh | 1 + rc.lua | 29 ++++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4c77264..b94c4fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ battery-widget keyboard-layout-indicator revelation +awesome-switcher diff --git a/install-deps.sh b/install-deps.sh index 994dc48..5257686 100644 --- a/install-deps.sh +++ b/install-deps.sh @@ -1,4 +1,5 @@ git clone https://github.com/deficient/battery-widget.git git clone https://github.com/deficient/keyboard-layout-indicator.git git clone https://github.com/guotsuan/awesome-revelation revelation +git clone https://github.com/berlam/awesome-switcher.git awesome-switcher sudo apt-get install acpid diff --git a/rc.lua b/rc.lua index 1a42b82..56dab33 100644 --- a/rc.lua +++ b/rc.lua @@ -22,6 +22,24 @@ local revelation=require("revelation") local debian = require("debian.menu") local has_fdo, freedesktop = pcall(require, "freedesktop") +local switcher = require("awesome-switcher") + + switcher.settings.preview_box = true -- display preview-box + switcher.settings.preview_box_bg = "#ddddddaa" -- background color + switcher.settings.preview_box_border = "#22222200" -- border-color + switcher.settings.preview_box_fps = 30 -- refresh framerate + switcher.settings.preview_box_delay = 150 -- delay in ms + switcher.settings.preview_box_title_font = {"sans","italic","normal"}-- the font for cairo + switcher.settings.preview_box_title_font_size_factor = 0.8 -- the font sizing factor + switcher.settings.preview_box_title_color = {0,0,0,1} -- the font color + + switcher.settings.client_opacity = false -- opacity for unselected clients + switcher.settings.client_opacity_value = 0.5 -- alpha-value for any client + switcher.settings.client_opacity_value_in_focus = 0.5 -- alpha-value for the client currently in focus + switcher.settings.client_opacity_value_selected = 1 -- alpha-value for the selected client + + switcher.settings.cycle_raise_client = true -- raise clients on cycle + local KEY_ALT = "Mod1" local tag1 = "1:idea" @@ -351,6 +369,15 @@ root.buttons(gears.table.join( -- {{{ Key bindings -- mod + s = show help globalkeys = gears.table.join( + awful.key({ "Mod1", }, "Tab", + function () + switcher.switch( 1, "Mod1", "Alt_L", "Shift", "Tab") + end), + + awful.key({ "Mod1", "Shift" }, "Tab", + function () + switcher.switch(-1, "Mod1", "Alt_L", "Shift", "Tab") + end), -- mod + e -> custom widget revelation awful.key({ modkey, }, "e", revelation), awful.key({ modkey, }, "s", hotkeys_popup.show_help, @@ -793,5 +820,5 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n -- }}} -- -- {{{ autostart -awful.spawn.with_shell("~/.config/awesome/autorun.sh") + awful.spawn.with_shell("~/.config/awesome/autorun.sh") -- }}}