eww integration
This commit is contained in:
parent
09a6557e45
commit
541ee65efc
5 changed files with 81 additions and 3 deletions
|
@ -1 +0,0 @@
|
|||
/home/shaked/.config/eww/scripts
|
3
eww/scripts/move_to_window.sh
Executable file
3
eww/scripts/move_to_window.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
window_id=$(hyprctl clients | rg 'Window ([A-Fa-f0-9]+)' | grep -F "$*" | sed -E 's/Window (.*) \->.*/\1/g')
|
||||
hyprctl dispatch focuswindow address:0x$window_id > /dev/null
|
||||
eww close example
|
41
eww/scripts/windows.sh
Executable file
41
eww/scripts/windows.sh
Executable file
|
@ -0,0 +1,41 @@
|
|||
#! /bin/bash
|
||||
trun() {
|
||||
window=$1
|
||||
OLD_IFS="$IFS"
|
||||
IFS=$' '
|
||||
for word in $window; do
|
||||
if [[ $count == $word_per_line ]]; then
|
||||
str="$str$word\n"
|
||||
count=0
|
||||
else
|
||||
str="$str$word "
|
||||
count=$(($count + 1))
|
||||
fi
|
||||
done
|
||||
IFS=$OLD_IFS
|
||||
echo $str
|
||||
}
|
||||
|
||||
img() {
|
||||
window=$1
|
||||
windows_images_dir=$HOME/.config/hyprmsn/windows
|
||||
echo "$windows_images_dir/$(ls $windows_images_dir | grep -F $window)"
|
||||
}
|
||||
|
||||
word_per_line=3
|
||||
echo "(box"
|
||||
OLD_IFS="$IFS"
|
||||
IFS=$'\n'
|
||||
windows=$(hyprctl clients | rg 'Window ([A-Fa-f0-9]+)' | sed -E 's/.*\-> (.*):/\1/g')
|
||||
for window in $windows; do
|
||||
window_str=$(trun $window)
|
||||
window_img=$(img $window)
|
||||
eww="(box :orientation \"v\" :class \"window-box\" (image :path \"$window_img\" :image-width 192 :image-height 108) (button :onclick \"scripts/move_to_window.sh \'$window\'\" :class \"window-button\" (box :orientation \"v\" "
|
||||
for string in $(echo -e $window_str); do
|
||||
eww="$eww $(echo -e "(label :text \"$string\")")"
|
||||
done
|
||||
eww="$eww)))"
|
||||
echo $eww
|
||||
done
|
||||
IFS=$OLD_IFS
|
||||
echo ")"
|
Loading…
Add table
Add a link
Reference in a new issue