mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
39 lines
944 B
Bash
Executable File
39 lines
944 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Set or toggle rounded Mako notification corners
|
|
# omarchy:args=[toggle|sharp|round]
|
|
# omarchy:examples=omarchy style corners mako toggle | omarchy style corners mako round | omarchy style corners mako sharp
|
|
|
|
TOGGLES_CONFIG="$HOME/.local/state/omarchy/toggles/mako.ini"
|
|
|
|
set_radius() {
|
|
local radius="$1"
|
|
|
|
mkdir -p "$(dirname "$TOGGLES_CONFIG")"
|
|
touch "$TOGGLES_CONFIG"
|
|
|
|
if grep -q '^border-radius=' "$TOGGLES_CONFIG"; then
|
|
sed -i "s/^border-radius=.*/border-radius=$radius/" "$TOGGLES_CONFIG"
|
|
else
|
|
echo "border-radius=$radius" >>"$TOGGLES_CONFIG"
|
|
fi
|
|
}
|
|
|
|
case "${1:-toggle}" in
|
|
round) set_radius 6 ;;
|
|
sharp) set_radius 0 ;;
|
|
toggle)
|
|
if [[ -f $TOGGLES_CONFIG ]] && grep -q '^border-radius=6$' "$TOGGLES_CONFIG"; then
|
|
set_radius 0
|
|
else
|
|
set_radius 6
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: omarchy-style-corners-mako [toggle|sharp|round]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
makoctl reload
|