aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/cow/cow.conf4
-rwxr-xr-x.config/cow/scripts/after-start.sh58
2 files changed, 60 insertions, 2 deletions
diff --git a/.config/cow/cow.conf b/.config/cow/cow.conf
index c370171..fce1d7e 100644
--- a/.config/cow/cow.conf
+++ b/.config/cow/cow.conf
@@ -447,8 +447,6 @@ rule -g -T on-map -n cowpager -s /cowpager:/ script {
}
}
-exec sh "$HOME/.config/cow/after-start.sh"
-
# Clipboard persistence (retain clipboard content after an app closes):
#exec wl-clip-persist --clipboard regular
@@ -550,3 +548,5 @@ mouse I:0+right "menu-show WindowOps"
# If a window menu is not invoked from a known window context, use
# pick-window so the selected menu action targets the picked window.
# bind M+w "pick-window menu-show WindowOps"
+
+exec sh "$HOME/.config/cow/scripts/after-start.sh"
diff --git a/.config/cow/scripts/after-start.sh b/.config/cow/scripts/after-start.sh
new file mode 100755
index 0000000..6c08dc1
--- /dev/null
+++ b/.config/cow/scripts/after-start.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Authentication dialog
+
+pkill -9 /usr/local/libexec/polkit-gnome-authentication-agent-1
+/usr/local/libexec/polkit-gnome-authentication-agent-1 &
+
+# Start xdg-desktop-portal-wlr
+
+pkill -9 /usr/local/libexec/xdg-desktop-portal-wlr
+/usr/local/libexec/xdg-desktop-portal-wlr &
+
+# Start Kanshi
+pkill -9 kanshi
+kanshi &
+
+# $wallpaper is set in your shells config file like below.
+read -r wallpaper<"$HOME/.cache/wallpaper"
+pkill -9 swaybg
+swaybg -m fill -i "$wallpaper" &
+
+pkill -9 dunst
+dunst &
+
+pkill -9 wlsunset
+wlsunset -l 57.4 -L -1.9 &
+
+# Restore previous brightness
+backlight "$(grep 'brightness:' ~/.cache/brightness | awk '{print $2}')"
+
+# Restore audio volume
+mixer vol.volume="$(grep 'vol.volume=' ~/.cache/audio-volume | awk -F ':' '{print $2}')"
+mixer vol.mute="$(grep 'vol.mute=' ~/.cache/audio-volume | awk -F '=' '{print $2}')"
+
+pkill -9 swayidle
+sh "$HOME/.config/waybar/scripts/swayidle-update.sh"
+
+# kill any running instances if they exist
+pkill -9 cowpager
+pkill -9 cowbuttons
+sleep 0.2
+
+# start cowpager and cowbuttons for each monitor
+monitors=$(moocow show output | jq -r '.data[] | .name' | wc -l | xargs)
+
+i=$monitors
+while [ "$i" -ge 1 ]; do
+ output=$(moocow show output | jq -r '.data[] | .name' | awk 'FNR == '$i' {print}')
+ moocow focus -o "$output"
+ # Slow script down as it causes problems with the positioning rules in cow.conf
+ sleep 0.2
+ cowpager -m "$output" &
+ cowbuttons &
+ # Focus the lowest active tag (desk nr)
+ num=$(moocow show desk | jq -r '.data.desks | map(select(.active == true)) | sort_by(.nr) | .[0].nr')
+ moocow desk -t "$output" -d "$num"
+ i=$((i-1))
+done