Trying out wayland

This commit is contained in:
agryphus 2023-12-05 22:12:36 -05:00
parent a643a1f9e9
commit d93e1ab61b
7 changed files with 540 additions and 0 deletions

32
.local/bin/hyprdwm Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env sh
# This is a script aimed at replicating the functionality of DWM where
# there are 9 workspaces per monitor.
if [ ! "$1" = "goto" ] && [ ! "$1" = "moveto" ]; then
echo "Invalid instruction"
exit 1
fi
case $2 in
''|*[!0-9]*)
echo "Provide a number"
exit 1
;;
*) ;;
esac
monitor="$(hyprctl activeworkspace | grep "monitorID:" | awk '{print $2}')"
workspace="$(($monitor * 10 + $2))"
hyprctl dispatch moveworkspacetomonitor "$workspace" "$monitor"
hyprctl dispatch focusmonitor "$monitor"
case "$1" in
goto)
hyprctl dispatch workspace "$workspace"
;;
moveto)
hyprctl dispatch movetoworkspace "$workspace"
;;
*) ;;
esac

29
.local/bin/hyprgaps Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env sh
increase=0
if [ "$1" != "-i" ] && [ "$1" != "-d" ] || [ -z "$2" ]; then
echo "Wrong number of arguments"
exit 1
else
[ "$1" = "-i" ] && increase=1
fi
amount="$2"
curr_out="$(hyprctl -j getoption general:gaps_out | jq '.int')"
if [ $increase = 1 ]; then
new_out=$(($curr_out + $amount))
else
new_out=$(($curr_out - $amount))
fi
new_in="$(($new_out / 2))"
if [ $new_out -lt 0 ] || [ $new_in -lt 0 ]; then
new_out=0
new_in=0
fi
hyprctl keyword general:gaps_out "$new_out"
hyprctl keyword general:gaps_in "$new_in"