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/eww.scss
|
14
eww/eww.scss
Normal file
14
eww/eww.scss
Normal file
|
@ -0,0 +1,14 @@
|
|||
*{
|
||||
all: unset; //Unsets everything so you can style everything from scratch
|
||||
}
|
||||
.window-button {
|
||||
background-color: rgb(44, 44, 44);
|
||||
}
|
||||
|
||||
.window-button:hover {
|
||||
background-color: rgb(27, 27, 27);
|
||||
}
|
||||
|
||||
.window-button:active {
|
||||
background-color: rgb(17, 17, 17);
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
/home/shaked/.config/eww/eww.yuck
|
23
eww/eww.yuck
Normal file
23
eww/eww.yuck
Normal file
|
@ -0,0 +1,23 @@
|
|||
(defpoll windows :interval "1s"
|
||||
:initial "initial-value" ; optional, defaults to poll at startup
|
||||
:run-while time-visible ; optional, defaults to 'true'
|
||||
`scripts/windows.sh`)
|
||||
|
||||
(defwidget windows_widget []
|
||||
(box
|
||||
(literal :content windows)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow example
|
||||
:monitor 0
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:width "50%"
|
||||
:height "30%"
|
||||
:anchor "center center")
|
||||
:stacking "fg"
|
||||
:windowtype "dock"
|
||||
(windows_widget)
|
||||
)
|
|
@ -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