mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
hl config: remove unused bash scripts
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
curr_workspace="$(hyprctl activeworkspace -j | jq -r ".id")"
|
|
||||||
dispatcher="$1"
|
|
||||||
shift ## The target is now in $1, not $2
|
|
||||||
|
|
||||||
if [[ -z "${dispatcher}" || "${dispatcher}" == "--help" || "${dispatcher}" == "-h" || -z "$1" ]]; then
|
|
||||||
echo "Usage: $0 <dispatcher> <target>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ "$1" == *"+"* || "$1" == *"-"* ]]; then ## Is this something like r+1 or -1?
|
|
||||||
hyprctl dispatch "${dispatcher}" "$1" ## $1 = workspace id since we shifted earlier.
|
|
||||||
elif [[ "$1" =~ ^[0-9]+$ ]]; then ## Is this just a number?
|
|
||||||
target_workspace=$((((curr_workspace - 1) / 10 ) * 10 + $1))
|
|
||||||
hyprctl dispatch "${dispatcher}" "${target_workspace}"
|
|
||||||
else
|
|
||||||
hyprctl dispatch "${dispatcher}" "$1" ## In case the target in a string, required for special workspaces.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Controls Hyprland's cursor zoom_factor, clamped between 1.0 and 3.0
|
|
||||||
|
|
||||||
# Get current zoom level
|
|
||||||
get_zoom() {
|
|
||||||
hyprctl getoption -j cursor:zoom_factor | jq '.float'
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clamp a value between 1.0 and 3.0
|
|
||||||
clamp() {
|
|
||||||
local val="$1"
|
|
||||||
awk "BEGIN {
|
|
||||||
v = $val;
|
|
||||||
if (v < 1.0) v = 1.0;
|
|
||||||
if (v > 3.0) v = 3.0;
|
|
||||||
print v;
|
|
||||||
}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set zoom level
|
|
||||||
set_zoom() {
|
|
||||||
local value="$1"
|
|
||||||
clamped=$(clamp "$value")
|
|
||||||
hyprctl keyword cursor:zoom_factor "$clamped"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
reset)
|
|
||||||
set_zoom 1.0
|
|
||||||
;;
|
|
||||||
increase)
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
echo "Usage: $0 increase STEP"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
current=$(get_zoom)
|
|
||||||
new=$(awk "BEGIN { print $current + $2 }")
|
|
||||||
set_zoom "$new"
|
|
||||||
;;
|
|
||||||
decrease)
|
|
||||||
if [[ -z "$2" ]]; then
|
|
||||||
echo "Usage: $0 decrease STEP"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
current=$(get_zoom)
|
|
||||||
new=$(awk "BEGIN { print $current - $2 }")
|
|
||||||
set_zoom "$new"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {reset|increase STEP|decrease STEP}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
Reference in New Issue
Block a user