New backup 2025-03-11 21:00:06

This commit is contained in:
Penelope Gwen 2025-03-11 21:00:06 -07:00
parent 3fe005b4d2
commit 0fc4ce4573
3 changed files with 33 additions and 17 deletions

View file

@ -16,19 +16,26 @@
(profile) (profile)
(workspaces :array workspacesArray) (workspaces :array workspacesArray)
(windowtitle) (windowtitle)
(scratchpad))) (scratchpad :array scratchpadArray)))
(defwidget scratchpad [] (defpoll scratchpadArray :interval 5s
'scripts/bar/scratchpad')
(defwidget scratchpad [array]
(box :orientation "v" (box :orientation "v"
:space-evenly false :space-evenly false
(box :space-evenly false (box :space-evenly false
(image :path "/usr/share/icons/hicolor/scalable/apps/org.kde.dolphin.svg" (for entry in array
(image :path "${entry.icon}"
:image-width 25 :image-width 25
:image-height 25) :image-height 25)
(image :path "/usr/share/icons/hicolor/32x32/apps/librewolf.png" ${entry.name}
:image-width 25 ; (image :path "/usr/share/icons/hicolor/scalable/apps/org.kde.dolphin.svg"
:image-height 25 ; :image-width 25
)))) ; :image-height 25)
; (image :path "/usr/share/icons/hicolor/32x32/apps/librewolf.png"
; :image-width 25
; :image-height 25
)))
(defwidget centergroup [] (defwidget centergroup []
(box :class "centergroup" :orientation "h" :space-evenly false :halign "start" (box :class "centergroup" :orientation "h" :space-evenly false :halign "start"

View file

@ -157,6 +157,7 @@ ws_fmt='%s'
app_fmt='%-15.15s' app_fmt='%-15.15s'
title_fmt='%s' title_fmt='%s'
applist_array=()
swaymsg -t get_tree | swaymsg -t get_tree |
# get list of windows as tab-separated columns # get list of windows as tab-separated columns
jq -r "$jq_get_windows | $jq_windows_to_tsv" | jq -r "$jq_get_windows | $jq_windows_to_tsv" |
@ -166,11 +167,19 @@ column -s $'\t' -o $'\t' -t | while IFS=$'\t' read -r win_id ws_name app_name wi
icon=$( get_icon "$app_name" "$pid" ) icon=$( get_icon "$app_name" "$pid" )
[[ "$verbose" ]] && printf "[%s]=%s\n" "$app_name" "$icon" >&2 [[ "$verbose" ]] && printf "[%s]=%s\n" "$app_name" "$icon" >&2
# shellcheck disable=SC2059 # shellcheck disable=SC2059
printf "img:$icon:text:${id_fmt}\t${app_fmt}\t${ws_fmt}\t${title_fmt}\n" \ applist_array_item=$(jq -n --arg icon "${icon}" --arg name "${app_name##*.}}" '{icon: $icon,name: $name}')
"$win_id" \ # echo "${applist_array_item}"
"${app_name##*.}" \ applist_array+=("${applist_array_item}")
"$ws_name" \ # echo "${applist_array[@]}"
"$win_title" # jq -n --arg icon "${icon}" --arg name "${app_name##*.}" '{icon: $icon,name: $name}'
done | # printf "img:$icon:text:${id_fmt}\t${app_fmt}\t${ws_fmt}\t${title_fmt}\n" \
sort -k3 -k2 # "$win_id" \
# "${app_name##*.}" \
# "$ws_name" \
# "$win_title"
done
printf '%s\n' "${applist_array[@]}"
applist=$(printf '%s\n' "${applist_array[@]}" | jq -s .)
echo ${applist_array[@]}
#sort -k3 -k2
#wofi --cache-file=/dev/null --insensitive --allow-images --show dmenu --prompt='Focus a window' #wofi --cache-file=/dev/null --insensitive --allow-images --show dmenu --prompt='Focus a window'