From 60e20e190ad2a78423aab26ac463e65c87dd50bc Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Wed, 10 Apr 2024 17:15:03 -0600 Subject: [PATCH] New backup 2024-04-10 17:15:03 --- de/home/.config/sway/scripts/profiles.sh | 5 +++-- de/home/.config/sway/scripts/ws-rename | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/de/home/.config/sway/scripts/profiles.sh b/de/home/.config/sway/scripts/profiles.sh index d7f7d3c..221e8ae 100755 --- a/de/home/.config/sway/scripts/profiles.sh +++ b/de/home/.config/sway/scripts/profiles.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -profiles=( "Personal" "Development" "School" "Work" ) -icons=( "~" "" "" "" ) +profiles=( "Personal" "Development" "School" "Work" "a" ) +icons=( "~" "" "" "" "a" ) #echo ${profiles[@]/School//} | cut -d/ -f1 | wc -w | tr -d ' ' profilem=$((${#profiles[@]}-1)) @@ -36,6 +36,7 @@ case $1 in ;; esac +[[ "$op" -gt "$profilem" ]] && exit [[ $op -eq "0" ]] && p_num="" || p_num="$op" p_icon="${icons[$op]}" diff --git a/de/home/.config/sway/scripts/ws-rename b/de/home/.config/sway/scripts/ws-rename index 09b721a..b13e2c5 100755 --- a/de/home/.config/sway/scripts/ws-rename +++ b/de/home/.config/sway/scripts/ws-rename @@ -2,6 +2,10 @@ active_wsname=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .name') ws_prefix=$(echo $active_wsname | tr -d '"' | grep -o "[1-9]*:[^a-zA-Z1-9]") -new_wsname="${ws_prefix}$(wofi -i --dmenu --height 1)" +wsname=$(echo "${active_wsname}" | sed 's/'"${ws_prefix}"'//'| tr -d '"') + +echo $wsname + +new_wsname="${ws_prefix}$(wofi -i --dmenu --height 1 --search ${wsname})" swaymsg 'rename workspace "'"${active_wsname}"'" to "'"${new_wsname}"'"'