mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
feat: Updates to hyprland, adds waybar (default config for now), adds arch linux notes file to start tracking things that are needed when setting up a new system.
This commit is contained in:
13
scripts/arch/lid.sh
Executable file
13
scripts/arch/lid.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
INTERNAL="eDP-1" # or eDP-1, check with `hyprctl monitors`
|
||||
DEVICE="/dev/input/event0" # replace with your lid event device
|
||||
|
||||
evtest --grab "$DEVICE" |
|
||||
while read -r line; do
|
||||
if echo "$line" | grep -q "SW_LID.*value 1"; then
|
||||
hyprctl keyword monitor "$INTERNAL,disable"
|
||||
elif echo "$line" | grep -q "SW_LID.*value 0"; then
|
||||
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
||||
fi
|
||||
done
|
||||
24
scripts/arch/window-toggle-floating
Executable file
24
scripts/arch/window-toggle-floating
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Float's a window, setting it's height and width and centering.
|
||||
|
||||
# The percentage of the screen size for the floating window.
|
||||
WIDTH_PERCENT=80
|
||||
HEIGHT_PERCENT=80
|
||||
|
||||
floating=$(hyprctl activewindow -j | jq '.floating')
|
||||
|
||||
if [ "$floating" = "true" ]; then
|
||||
hyprctl dispatch togglefloating
|
||||
else
|
||||
monitor=$(hyprctl monitors -j | jq '.[] | select(.focused == true)')
|
||||
mw=$(echo "$monitor" | jq '.width')
|
||||
mh=$(echo "$monitor" | jq '.height')
|
||||
|
||||
neww=$((mw * $WIDTH_PERCENT / 100))
|
||||
newh=$((mh * $HEIGHT_PERCENT / 100))
|
||||
|
||||
hyprctl dispatch togglefloating \
|
||||
&& hyprctl dispatch resizeactive exact $neww $newh \
|
||||
&& hyprctl dispatch centerwindow
|
||||
fi
|
||||
Reference in New Issue
Block a user