Skip to content

Commit

Permalink
fix for ags switching
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaw353 committed Nov 17, 2024
1 parent c431451 commit df783d0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions roles/hyprland/files/hypr/scripts/switch-ags.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#!/bin/bash
pgrep ags > /dev/null
if [[ "$?" != "0" ]]; then
agsv1 -q; ags run ~/.config/agsv2/config.js

# Check if ags is running
if pgrep -x "ags" > /dev/null; then
# If ags is running, kill it and start agsv1
echo "Stopping ags and starting agsv1..."
ags quit -i js
agsv1 run &
elif pgrep -x "agsv1" > /dev/null; then
# If agsv1 is running, kill it and start ags
echo "Stopping agsv1 and starting ags..."
agsv1 -q
ags run -d ~/.config/agsv2 &
else
ags quit; agsv1
# If neither are running, start ags
echo "Neither ags nor agsv1 are running. Starting ags..."
#ags run -d ~/.config/agsv2 &
fi

0 comments on commit df783d0

Please sign in to comment.