summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2023-11-27 14:30:09 -0500
committerFreya Murphy <freya@freyacat.org>2023-11-27 14:30:09 -0500
commit24561a73baa76e9d39ce12652af56e8671476890 (patch)
treed84f6aae5700b95c561b131933b7103bfc239105
parentdocs (diff)
downloaddotfiles-arch-24561a73baa76e9d39ce12652af56e8671476890.tar.gz
dotfiles-arch-24561a73baa76e9d39ce12652af56e8671476890.tar.bz2
dotfiles-arch-24561a73baa76e9d39ce12652af56e8671476890.zip
fix project script
-rwxr-xr-x.config/sway/scripts.d/project.sh17
-rw-r--r--packages1
2 files changed, 11 insertions, 7 deletions
diff --git a/.config/sway/scripts.d/project.sh b/.config/sway/scripts.d/project.sh
index f7353e1..97b8f41 100755
--- a/.config/sway/scripts.d/project.sh
+++ b/.config/sway/scripts.d/project.sh
@@ -58,20 +58,23 @@ get_id() {
i=0
while true; do
NAME="$(get_name $i)"
- if [ "$NAME" == "$1" ]; then
+ if [ $(echo "$NAME" | grep "^$1") ]; then
echo "$i"
- exit 0
+ return 0
elif [ "$NAME" == "null" ]; then
- notify-send -u critical -t 3000 "Sway" "Failed to get display"
- kill $PID
- exit 1
+ return 1
fi
((i=i+1))
done
}
-PRIMARY=$(get_id "eDP-1")
-EXTERNAL=$(get_id "DP-1" || get_id "HDMI-1" || get_id "HDMI-A-1")
+die() {
+ notify-send -u critical -t 3000 "Sway" "Failed to get display"
+ kill $PID
+}
+
+PRIMARY=$(get_id "eDP-1" || die)
+EXTERNAL=$(get_id "DP" || get_id "HDMI" || die)
PRIMARY_SCALE=1.5
EXTERNAL_SCALE=1
diff --git a/packages b/packages
index e0f805d..35e5a30 100644
--- a/packages
+++ b/packages
@@ -29,6 +29,7 @@ grub
htop
imv
iwd
+jq
krita
less
lib32-libva-mesa-driver