Fix showing Wayland windows

This commit is contained in:
q3aql 2025-07-30 18:09:27 +02:00
parent 6059d9eafc
commit 2c57dfa391
2 changed files with 6 additions and 7 deletions

View File

@ -19,23 +19,23 @@ function generate_spaces() {
done done
} }
function check_wmctrl() { function check_dependencies() {
wmctrl -h &> /dev/null swaymsg &> /dev/null
error=$? error=$?
if [ ${error} -ne 0 ] ; then if [ ${error} -ne 0 ] ; then
echo " Error: You need install 'wmctrl'" | wofi --dmenu -p " window" echo " Error: You need install 'swaymsg'" | wofi --dmenu -p " window"
exit exit
fi fi
} }
function list_applications_icons() { function list_applications_icons() {
wmctrl -l | while read current_app ; do swaymsg -t get_tree | jq -r '.. | .nodes?[]? | select(.type == "con" and .focused == false and .name != null) | .name' | while read current_app ; do
echo " ${current_app}" echo " ${current_app}"
done done
generate_spaces 75 generate_spaces 75
} }
check_wmctrl check_dependencies
list_output=$(list_applications_icons | wofi -s ~/.config/wofi/wofi.css --dmenu -i -p " window") list_output=$(list_applications_icons | wofi -s ~/.config/wofi/wofi.css --dmenu -i -p " window")
run_output=$(echo ${list_output} | cut -c 5-999) run_output=$(echo ${list_output} | cut -c 5-999)
echo "# Selected: ${run_output}" echo "# Selected: ${run_output}"
@ -43,5 +43,5 @@ run_output=$(echo "${run_output}" | cut -d " " -f 1)
if [ -z "${run_output}" ] ; then if [ -z "${run_output}" ] ; then
echo "# Selection window canceled" echo "# Selection window canceled"
else else
wmctrl -ia "${run_output}" &> /dev/null swaymsg "[title=\"${run_output}\"] focus" &> /dev/null
fi fi

View File

@ -1,5 +1,4 @@
* { * {
/*font-family: 'Noto Sans', 'UbuntuMono Nerd Font', sans-serif; /* Reemplaza 'TuFuente' con el nombre de la fuente que deseas */
font-family: 'UbuntuMono Nerd Font', sans-serif; /* Reemplaza 'TuFuente' con el nombre de la fuente que deseas */ font-family: 'UbuntuMono Nerd Font', sans-serif; /* Reemplaza 'TuFuente' con el nombre de la fuente que deseas */
font-size: 15px; /* Ajusta el tamaño de la fuente según tus preferencias */ font-size: 15px; /* Ajusta el tamaño de la fuente según tus preferencias */
} }