From 89b5f3f87c8022f2d32c422c3516fca2f1538d69 Mon Sep 17 00:00:00 2001 From: tcmal Date: Tue, 6 Aug 2024 14:39:55 +0100 Subject: Add tags/workspaces --- src/config.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 9cbfc40..3182ba7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,8 +6,11 @@ use xkeysym::Keysym; use crate::{ bind, + clients::TagFocus, conn_info::Colour, - helpers::{focus_next, focus_prev, spawn, toggle_floating, toggle_fullscreen}, + helpers::{ + focus_next, focus_prev, set_tag, set_tag_focus, spawn, toggle_floating, toggle_fullscreen, + }, keys::{Keybind, Keybinds}, }; @@ -34,6 +37,25 @@ pub const KEYBINDS: Keybinds = Keybinds(&[ bind!(MAIN_MODIFIER , k -> &focus_prev), bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , space -> &toggle_floating), bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , f -> &toggle_fullscreen), + bind!(MAIN_MODIFIER , _1 -> &|wm| set_tag_focus(wm, TagFocus::Tag(1))), + bind!(MAIN_MODIFIER , _2 -> &|wm| set_tag_focus(wm, TagFocus::Tag(2))), + bind!(MAIN_MODIFIER , _3 -> &|wm| set_tag_focus(wm, TagFocus::Tag(3))), + bind!(MAIN_MODIFIER , _4 -> &|wm| set_tag_focus(wm, TagFocus::Tag(4))), + bind!(MAIN_MODIFIER , _5 -> &|wm| set_tag_focus(wm, TagFocus::Tag(5))), + bind!(MAIN_MODIFIER , _6 -> &|wm| set_tag_focus(wm, TagFocus::Tag(6))), + bind!(MAIN_MODIFIER , _7 -> &|wm| set_tag_focus(wm, TagFocus::Tag(7))), + bind!(MAIN_MODIFIER , _8 -> &|wm| set_tag_focus(wm, TagFocus::Tag(8))), + bind!(MAIN_MODIFIER , _9 -> &|wm| set_tag_focus(wm, TagFocus::Tag(9))), + bind!(MAIN_MODIFIER , _0 -> &|wm| set_tag_focus(wm, TagFocus::All)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _1 -> &|wm| set_tag(wm, 1)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _2 -> &|wm| set_tag(wm, 2)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _3 -> &|wm| set_tag(wm, 3)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _4 -> &|wm| set_tag(wm, 4)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _5 -> &|wm| set_tag(wm, 5)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _6 -> &|wm| set_tag(wm, 6)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _7 -> &|wm| set_tag(wm, 7)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _8 -> &|wm| set_tag(wm, 8)), + bind!(MAIN_MODIFIER.union(ModMask::SHIFT) , _9 -> &|wm| set_tag(wm, 9)), // { MODKEY, XK_j, focusstack, {.i = +1 } }, // { MODKEY, XK_k, focusstack, {.i = -1 } }, // { MODKEY, XK_i, incnmaster, {.i = +1 } }, -- cgit v1.2.3