diff options
| author | Mosder <xmosder12@gmail.com> | 2026-08-20 15:24:39 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-08-20 15:24:58 +0200 |
| commit | a406ba6f9f2b6c8e4fa76ef1eb77c4825b4f18b8 (patch) | |
| tree | 1db2dd5bad06e9603e7bcd3e00f2a4950dc12a1a /common/home/mosder/.config/hypr/scripts | |
| parent | 9c8afb5cc83cf3fe6a804603850b9dc720cc81d1 (diff) | |
vibecoded rewrite of hyprland configs from hyprlang to lua - need to test it and prolly check if claude didn't do anything stupid
Diffstat (limited to 'common/home/mosder/.config/hypr/scripts')
| -rwxr-xr-x | common/home/mosder/.config/hypr/scripts/equalize-windows.sh | 87 | ||||
| -rwxr-xr-x | common/home/mosder/.config/hypr/scripts/zoom.sh | 4 |
2 files changed, 2 insertions, 89 deletions
diff --git a/common/home/mosder/.config/hypr/scripts/equalize-windows.sh b/common/home/mosder/.config/hypr/scripts/equalize-windows.sh deleted file mode 100755 index cd43729..0000000 --- a/common/home/mosder/.config/hypr/scripts/equalize-windows.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -ITERS=3 - -# get address of the window to return to -address=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}') - -# define move directions -dir1=$1 -dir2=r -if [[ $dir1 == u ]]; then - dir2=d -fi - -# move max to the left/top -prev_window="" -window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}') -while [[ $window != $prev_window ]]; do - hyprctl dispatch movefocus $dir1 - prev_window=$window - window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}') -done - -# get start location -at=$(hyprctl activewindow | awk -F" " 'NR==4 {print $2}') -if [[ $dir1 == l ]]; then - start_location=$(echo $at | awk -F"," '{print $1}') -else - start_location=$(echo $at | awk -F"," '{print $2}') -fi - -# count windows in the line -window_count=0 -prev_window="" -while [[ $window != $prev_window ]]; do - hyprctl dispatch movefocus $dir2 - prev_window=$window - window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}') - window_count=$(($window_count+1)) -done - -# get end location -at=$(hyprctl activewindow | awk -F" " 'NR==4 {print $2}') -size=$(hyprctl activewindow | awk -F" " 'NR==5 {print $2}') -if [[ $dir1 == l ]]; then - at=$(echo $at | awk -F"," '{print $1}') - size=$(echo $size | awk -F"," '{print $1}') -else - at=$(echo $at | awk -F"," '{print $2}') - size=$(echo $size | awk -F"," '{print $2}') -fi -end_location=$(($at+$size)) - -# calculate full size and size per window -full_size=$(($end_location - $start_location)) -size_per_window=$(($full_size / $window_count)) - -# set sizes -i=0 -while [[ $i -lt $ITERS ]]; do - i=$(($i+1)) - window=0 - while [[ $window -lt $window_count ]]; do - window=$(($window+1)) - size=$(hyprctl activewindow | awk -F" " 'NR==5 {print $2}') - if [[ $dir1 == l ]]; then - #other_side=$(echo $size | awk -F"," '{print $2}') - #hyprctl dispatch resizeactive exact $size_per_window $other_side - size=$(echo $size | awk -F"," '{print $1}') - diff=$(($size_per_window - $size)) - hyprctl dispatch resizeactive $diff 0 - else - #other_side=$(echo $size | awk -F"," '{print $1}') - #hyprctl dispatch resizeactive exact $other_side $size_per_window - size=$(echo $size | awk -F"," '{print $2}') - diff=$(($size_per_window - $size)) - hyprctl dispatch resizeactive 0 $diff - fi - hyprctl dispatch movefocus $dir1 - done - temp=$dir1 - dir1=$dir2 - dir2=$temp -done - -# return to starting window -hyprctl dispatch focuswindow address:0x$address diff --git a/common/home/mosder/.config/hypr/scripts/zoom.sh b/common/home/mosder/.config/hypr/scripts/zoom.sh index 433f899..1bb07f6 100755 --- a/common/home/mosder/.config/hypr/scripts/zoom.sh +++ b/common/home/mosder/.config/hypr/scripts/zoom.sh @@ -1,9 +1,9 @@ #!/bin/bash -ZOOM=$(hyprctl getoption cursor:zoom_factor | grep float | awk -F" " '{print $2}') +ZOOM=$(hyprctl repl 'hl.get_config("cursor.zoom_factor")') ZOOM=$(echo "scale=0; ($ZOOM+1)/1" | bc) if [[ $ZOOM -gt $MAX_ZOOM ]]; then ZOOM=1 fi -hyprctl -q keyword cursor:zoom_factor $ZOOM +hyprctl -q eval "hl.config({ cursor = { zoom_factor = $ZOOM } })" |
