mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Move flags to persistent setup so hyprctl reload doesn't reset them
This commit is contained in:
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a Hyprland flag is currently disabled (missing).
|
||||
|
||||
[[ ! -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a Hyprland flag is currently enabled.
|
||||
|
||||
[[ -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely.
|
||||
|
||||
ENABLED_NOTIFICATION=""
|
||||
DISABLED_NOTIFICATION=""
|
||||
|
||||
while [[ $# -gt 1 ]]; do
|
||||
case $1 in
|
||||
--enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
--disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
FLAG_NAME="$1"
|
||||
flag="$HOME/.local/state/omarchy/flags/hypr/$FLAG_NAME.conf"
|
||||
flag_source="$OMARCHY_PATH/default/hypr/flags/$FLAG_NAME.conf"
|
||||
|
||||
if [[ -f $flag ]]; then
|
||||
rm $flag
|
||||
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
||||
elif [[ -f $flag_source ]]; then
|
||||
cp $flag_source $flag
|
||||
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
||||
else
|
||||
echo "Flag not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hyprctl reload
|
||||
@@ -1,29 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle the internal laptop display on/off.
|
||||
# Useful when connected to an external monitor and you want to close the lid
|
||||
# or just use the external display only.
|
||||
# Toggle the internal laptop display on/off using the flag system.
|
||||
|
||||
INTERNAL=$(hyprctl monitors all -j | jq -r '.[] | select(.name | startswith("eDP")) | .name')
|
||||
|
||||
if [[ -z $INTERNAL ]]; then
|
||||
notify-send -u low " No internal display found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DISABLED=$(hyprctl monitors all -j | jq -r --arg m "$INTERNAL" '.[] | select(.name == $m) | .disabled')
|
||||
|
||||
if [[ $DISABLED == "true" ]]; then
|
||||
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
||||
hyprctl dispatch movecursor 0 0
|
||||
notify-send -u low " Internal display on"
|
||||
else
|
||||
if omarchy-hyprland-flag-missing internal-monitor-disable; then
|
||||
ACTIVE_COUNT=$(hyprctl monitors -j | jq 'length')
|
||||
if [[ $ACTIVE_COUNT -le 1 ]]; then
|
||||
notify-send -u low " Can't disable the only active display"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hyprctl keyword monitor "$INTERNAL,disable"
|
||||
notify-send -u low " Internal display off"
|
||||
fi
|
||||
|
||||
omarchy-hyprland-flag-toggle \
|
||||
--enabled-notification " Internal display off" \
|
||||
--disabled-notification " Internal display on" \
|
||||
internal-monitor-disable
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check current single_window_aspect_ratio setting
|
||||
CURRENT_VALUE=$(hyprctl getoption "layout:single_window_aspect_ratio" 2>/dev/null | head -1)
|
||||
# Toggle single-window square aspect ratio using the flag system.
|
||||
|
||||
# Parse vec2 output: "vec2: [1, 1]" or "vec2: [0, 0]"
|
||||
if [[ $CURRENT_VALUE == *"[1, 1]"* ]]; then
|
||||
hyprctl keyword layout:single_window_aspect_ratio "0 0"
|
||||
notify-send -u low " Disable single-window square aspect ratio"
|
||||
else
|
||||
hyprctl keyword layout:single_window_aspect_ratio "1 1"
|
||||
notify-send -u low " Enable single-window square aspect"
|
||||
fi
|
||||
omarchy-hyprland-flag-toggle \
|
||||
--enabled-notification " Enable single-window square aspect ratio" \
|
||||
--disabled-notification " Disable single-window square aspect ratio" \
|
||||
single-window-aspect-ratio
|
||||
|
||||
@@ -19,5 +19,8 @@ source = ~/.config/hypr/bindings.conf
|
||||
source = ~/.config/hypr/looknfeel.conf
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
|
||||
# Toggle config flags dynamically
|
||||
source = ~/.local/state/omarchy/flags/hypr/*.conf
|
||||
|
||||
# Add any other personal Hyprland configuration below
|
||||
# windowrule = workspace 5, match:class qemu
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# This directory is intended for permanent config toggle flags.
|
||||
# Do not remove this file (as the directory always needs at least one file).
|
||||
@@ -0,0 +1,2 @@
|
||||
# Disable the internal laptop monitor
|
||||
monitor=eDP-1,disable
|
||||
@@ -0,0 +1,5 @@
|
||||
# Avoid overly wide single-window layouts on wide screens
|
||||
layout {
|
||||
single_window_aspect_ratio = 1 1
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ run_logged $OMARCHY_INSTALL/config/unmount-fuse.sh
|
||||
run_logged $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh
|
||||
run_logged $OMARCHY_INSTALL/config/input-group.sh
|
||||
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh
|
||||
run_logged $OMARCHY_INSTALL/config/omarchy-config-flags.sh
|
||||
run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh
|
||||
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
|
||||
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Flags are used to toggle certain features on/off in a persistent way
|
||||
mkdir -p ~/.local/state/omarchy/flags/hypr
|
||||
cp $OMARCHY_PATH/default/hypr/flags/flags.conf ~/.local/state/omarchy/flags/hypr/
|
||||
@@ -0,0 +1,9 @@
|
||||
echo "Add flags sourcing to hyprland.conf"
|
||||
|
||||
HYPR_CONF=~/.config/hypr/hyprland.conf
|
||||
|
||||
source $OMARCHY_PATH/install/config/omarchy-config-flags.sh
|
||||
|
||||
if [[ -f $HYPR_CONF ]] && ! grep -q "flags/hypr/\*\.conf" "$HYPR_CONF"; then
|
||||
echo -e "\n# Toggle config flags dynamically\nsource = ~/.local/state/omarchy/flags/hypr/*.conf" >> "$HYPR_CONF"
|
||||
fi
|
||||
Reference in New Issue
Block a user