mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-02 21:30:39 -04:00
New Scripts
This commit is contained in:
parent
4875c2f2df
commit
bcac3c08e4
6 changed files with 116 additions and 7 deletions
50
.config/hypr/scripts/gaps_out.sh
Executable file
50
.config/hypr/scripts/gaps_out.sh
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Function to get current gaps_out
|
||||
get_current_gaps_out() {
|
||||
hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}'
|
||||
}
|
||||
|
||||
# Function to set new gaps_out
|
||||
set_new_gaps_out() {
|
||||
hyprctl keyword general:gaps_out $1
|
||||
}
|
||||
|
||||
# Check if an argument is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 [up|down]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current gaps_out
|
||||
current_gaps=$(get_current_gaps_out)
|
||||
|
||||
# If current_gaps is empty or not a number, set it to 0
|
||||
if ! [[ "$current_gaps" =~ ^[0-9]+$ ]] ; then
|
||||
current_gaps=0
|
||||
fi
|
||||
|
||||
# Adjust gaps based on argument
|
||||
case $1 in
|
||||
"up")
|
||||
new_gaps=$((current_gaps + 10))
|
||||
;;
|
||||
"down")
|
||||
new_gaps=$((current_gaps - 10))
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument. Use up or down"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Ensure gaps don't go negative
|
||||
if [ $new_gaps -lt 0 ]; then
|
||||
new_gaps=0
|
||||
fi
|
||||
|
||||
# Set the new gaps_out
|
||||
set_new_gaps_out $new_gaps
|
||||
|
||||
echo "Gaps_out changed from $current_gaps to $new_gaps"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue