Adjust waybar startup

- Create a launch script for waybar
- Use waybar launch script in autostart array
- Add a sleep between killing existing waybars
  launching new instance so it hopefully works
  reboot
- Adjust justfile to use launch script
This commit is contained in:
Sravan Balaji
2024-09-29 09:57:52 -04:00
parent 0a0a8f788f
commit 85892f3517
4 changed files with 27 additions and 4 deletions

View File

@@ -36,6 +36,7 @@
- [[#commands][Commands]]
- [[#buttons][Buttons]]
- [[#waybar][Waybar]]
- [[#launch-script][Launch Script]]
- [[#start-configuration][Start Configuration]]
- [[#bar][Bar]]
- [[#configuration-1][Configuration]]
@@ -278,7 +279,6 @@ static const Env envs[] = {
static const char *const autostart[] = {
/* Display / Compositor Setup */
"/usr/bin/shikane", NULL,
"/usr/bin/waybar", "-c", "/home/sravan/.config/dwl/waybar/config.jsonc", "-s", "/home/sravan/.config/dwl/waybar/style.css", NULL,
"/usr/bin/bash", "/home/sravan/.azotebg", NULL,
"/usr/bin/gammastep", "-x", NULL,
/* Background Processes */
@@ -293,6 +293,8 @@ static const char *const autostart[] = {
"/usr/bin/nm-applet", NULL,
"/usr/bin/kdeconnect-indicator", NULL,
"/usr/bin/udiskie", "-a", "-n", "-s", NULL,
/* Status Bar */
"/usr/bin/sh", "-c", "/home/sravan/.config/dwl/waybar/launch.sh", NULL,
/* GUI Applications */
"/usr/bin/nextcloud", NULL,
"/usr/bin/syncthing-gtk", NULL,
@@ -517,6 +519,18 @@ static const Button buttons[] = {
* Waybar
** Launch Script
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/launch.sh
killall waybar
sleep 5
/usr/bin/waybar \
-c $HOME/.config/dwl/waybar/config.jsonc \
-s $HOME/.config/dwl/waybar/style.css &
#+END_SRC
** Start Configuration
#+BEGIN_SRC jsonc :tangle waybar/config.jsonc
@@ -796,5 +810,5 @@ dwl-rebuild:
# Run waybar with dwl configuration
dwl-launch-waybar:
/usr/bin/waybar -c /home/sravan/.config/dwl/waybar/config.jsonc -s /home/sravan/.config/dwl/waybar/style.css
./waybar/launch.sh
#+END_SRC

View File

@@ -49,7 +49,6 @@ static const Env envs[] = {
static const char *const autostart[] = {
/* Display / Compositor Setup */
"/usr/bin/shikane", NULL,
"/usr/bin/waybar", "-c", "/home/sravan/.config/dwl/waybar/config.jsonc", "-s", "/home/sravan/.config/dwl/waybar/style.css", NULL,
"/usr/bin/bash", "/home/sravan/.azotebg", NULL,
"/usr/bin/gammastep", "-x", NULL,
/* Background Processes */
@@ -64,6 +63,8 @@ static const char *const autostart[] = {
"/usr/bin/nm-applet", NULL,
"/usr/bin/kdeconnect-indicator", NULL,
"/usr/bin/udiskie", "-a", "-n", "-s", NULL,
/* Status Bar */
"/usr/bin/sh", "-c", "/home/sravan/.config/dwl/waybar/launch.sh", NULL,
/* GUI Applications */
"/usr/bin/nextcloud", NULL,
"/usr/bin/syncthing-gtk", NULL,

View File

@@ -10,4 +10,4 @@ dwl-rebuild:
# Run waybar with dwl configuration
dwl-launch-waybar:
/usr/bin/waybar -c /home/sravan/.config/dwl/waybar/config.jsonc -s /home/sravan/.config/dwl/waybar/style.css
./waybar/launch.sh

8
waybar/launch.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
killall waybar
sleep 5
/usr/bin/waybar \
-c $HOME/.config/dwl/waybar/config.jsonc \
-s $HOME/.config/dwl/waybar/style.css &