Compare commits

...

3 Commits

Author SHA1 Message Date
Sravan Balaji
81bb55f185 Idle Inhibitor Active on Startup
- Make killall waybar fail silently if waybar
  isn't already running
- Update launch script to run in foreground
- Use verbose version of waybar CLI args
- Automatically restart waybar if it exits
  with non 143 (SIGTERM) exit code so random
  crashes (e.g., when opening LibreOffice or
  some games) don't persist and bar gets
  restarted
2024-12-29 16:20:39 -05:00
Sravan Balaji
fcee83d388 Fix for media with quotes in metadata 2024-11-07 09:24:24 -05:00
Sravan Balaji
82392f2bba Add window rules to start programs on certain tags 2024-11-03 16:29:43 -05:00
5 changed files with 72 additions and 22 deletions

View File

@@ -340,13 +340,35 @@ static const char *const autostart[] = {
*** Window Rules *** Window Rules
#+BEGIN_SRC c :tangle config.h Use ~dwlmsg -w -c~ to get the title and appid of focused clients.
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
#+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[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */ /* app_id title tags mask isfloating monitor */
/* examples: */ /* examples: */
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ { "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" */ { "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 #+END_SRC
@@ -573,11 +595,20 @@ static const Button buttons[] = {
** Launch Script ** Launch Script
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/launch.sh #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/launch.sh
killall waybar killall waybar || true
/usr/bin/waybar \ until /usr/bin/waybar \
-c $HOME/.config/dwl/waybar/config.jsonc \ --config $HOME/.config/dwl/waybar/config.jsonc \
-s $HOME/.config/dwl/waybar/style.css & --style $HOME/.config/dwl/waybar/style.css;
do
if [ $? -ne 143 ]; then
echo "Dwl Waybar stopped with exit code $?. Respawning..." >&2;
sleep 1;
else
echo "Dwl Waybar manually killed with SIGTERM";
break;
fi
done
#+END_SRC #+END_SRC
** Start Configuration ** Start Configuration
@@ -957,7 +988,7 @@ fi
"tooltip": true, "tooltip": true,
"tooltip-format-activated": "Idle Inhibitor: {status}", "tooltip-format-activated": "Idle Inhibitor: {status}",
"tooltip-format-deactivated": "Idle Inhibitor: {status}", "tooltip-format-deactivated": "Idle Inhibitor: {status}",
"start-activated": false, "start-activated": true,
}, },
#+END_SRC #+END_SRC
@@ -1144,7 +1175,7 @@ else
fi fi
fi fi
echo '{"text":"'$mediaSourceIcon'","tooltip":"󰝚\t'$title'\r󰠃\t'$artist'\r󰀥\t'$album'\r󰐎\t'$status'"}' echo '{"text":"'$mediaSourceIcon'","tooltip":"󰝚\t'${title//'"'/'\"'}'\r󰠃\t'${artist//'"'/'\"'}'\r󰀥\t'${album//'"'/'\"'}'\r󰐎\t'${status//'"'/'\"'}'"}'
#+END_SRC #+END_SRC
*** Power Menu *** Power Menu

View File

@@ -53,12 +53,22 @@ static const char *const autostart[] = {
}; };
#endif // AUTOSTART_PATCH #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[] = { static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */ /* app_id title tags mask isfloating monitor */
/* examples: */ { "thunderbird-esr", NULL, 1 << 0, 0, -1 }, /* Start on ONLY tag "1" */
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ { "Beeper", NULL, 1 << 1, 0, -1 }, /* Start on ONLY tag "2" */
{ "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ { "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[] = { static const Layout layouts[] = {

View File

@@ -177,7 +177,7 @@
"tooltip": true, "tooltip": true,
"tooltip-format-activated": "Idle Inhibitor: {status}", "tooltip-format-activated": "Idle Inhibitor: {status}",
"tooltip-format-deactivated": "Idle Inhibitor: {status}", "tooltip-format-deactivated": "Idle Inhibitor: {status}",
"start-activated": false, "start-activated": true,
}, },
"memory": { "memory": {

View File

@@ -1,6 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
killall waybar killall waybar || true
/usr/bin/waybar \ until /usr/bin/waybar \
-c $HOME/.config/dwl/waybar/config.jsonc \ --config $HOME/.config/dwl/waybar/config.jsonc \
-s $HOME/.config/dwl/waybar/style.css & --style $HOME/.config/dwl/waybar/style.css;
do
if [ $? -ne 143 ]; then
echo "Dwl Waybar stopped with exit code $?. Respawning..." >&2;
sleep 1;
else
echo "Dwl Waybar manually killed with SIGTERM";
break;
fi
done

View File

@@ -30,4 +30,4 @@ else
fi fi
fi fi
echo '{"text":"'$mediaSourceIcon'","tooltip":"󰝚\t'$title'\r󰠃\t'$artist'\r󰀥\t'$album'\r󰐎\t'$status'"}' echo '{"text":"'$mediaSourceIcon'","tooltip":"󰝚\t'${title//'"'/'\"'}'\r󰠃\t'${artist//'"'/'\"'}'\r󰀥\t'${album//'"'/'\"'}'\r󰐎\t'${status//'"'/'\"'}'"}'