From 82392f2bba7fc91f991ff52dca45808f3fde8240 Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sun, 3 Nov 2024 16:29:43 -0500 Subject: [PATCH] Add window rules to start programs on certain tags --- README.org | 32 +++++++++++++++++++++++++++----- config.h | 20 +++++++++++++++----- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index b54fa22..08ab66f 100644 --- a/README.org +++ b/README.org @@ -340,13 +340,35 @@ static const char *const autostart[] = { *** Window Rules -#+BEGIN_SRC c :tangle config.h -/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ +Use ~dwlmsg -w -c~ to get the title and appid of focused clients. + +#+BEGIN_EXAMPLE c +/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g., leave at least one example) */ static const Rule rules[] = { - /* app_id title tags mask isfloating monitor */ + /* app_id title tags mask isfloating monitor */ /* examples: */ - { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ - { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ + { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ + { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ +}; +#+END_EXAMPLE + +#+BEGIN_SRC c :tangle config.h +static const Rule rules[] = { + /* app_id title tags mask isfloating monitor */ + { "thunderbird-esr", NULL, 1 << 0, 0, -1 }, /* Start on ONLY tag "1" */ + { "Beeper", NULL, 1 << 1, 0, -1 }, /* Start on ONLY tag "2" */ + { "obsidian", NULL, 1 << 2, 0, -1 }, /* Start on ONLY tag "3" */ + { "pocket-casts-linux", NULL, 1 << 3, 0, -1 }, /* Start on ONLY tag "4" */ + { "Spotify", NULL, 1 << 3, 0, -1 }, /* Start on ONLY tag "4" */ + { "Vivaldi-stable", NULL, 1 << 4, 0, -1 }, /* Start on ONLY tag "5" */ + { "kitty", NULL, 1 << 5, 0, -1 }, /* Start on ONLY tag "6" */ + { "Emacs", NULL, 1 << 6, 0, -1 }, /* Start on ONLY tag "7" */ + { "steam", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "lutris", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "net.davidotek.pupgui2", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "gamescope", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "syncthing-gtk", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ + { "openrgb", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ }; #+END_SRC diff --git a/config.h b/config.h index fbb479a..7c82d4a 100644 --- a/config.h +++ b/config.h @@ -53,12 +53,22 @@ static const char *const autostart[] = { }; #endif // AUTOSTART_PATCH -/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ static const Rule rules[] = { - /* app_id title tags mask isfloating monitor */ - /* examples: */ - { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ - { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ + /* app_id title tags mask isfloating monitor */ + { "thunderbird-esr", NULL, 1 << 0, 0, -1 }, /* Start on ONLY tag "1" */ + { "Beeper", NULL, 1 << 1, 0, -1 }, /* Start on ONLY tag "2" */ + { "obsidian", NULL, 1 << 2, 0, -1 }, /* Start on ONLY tag "3" */ + { "pocket-casts-linux", NULL, 1 << 3, 0, -1 }, /* Start on ONLY tag "4" */ + { "Spotify", NULL, 1 << 3, 0, -1 }, /* Start on ONLY tag "4" */ + { "Vivaldi-stable", NULL, 1 << 4, 0, -1 }, /* Start on ONLY tag "5" */ + { "kitty", NULL, 1 << 5, 0, -1 }, /* Start on ONLY tag "6" */ + { "Emacs", NULL, 1 << 6, 0, -1 }, /* Start on ONLY tag "7" */ + { "steam", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "lutris", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "net.davidotek.pupgui2", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "gamescope", NULL, 1 << 7, 0, -1 }, /* Start on ONLY tag "8" */ + { "syncthing-gtk", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ + { "openrgb", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ }; static const Layout layouts[] = {