mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Update all hyprland references to new lua ones
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
step="${1:-+5%}"
|
||||
|
||||
if [[ $step == "off" ]]; then
|
||||
hyprctl dispatch dpms off >/dev/null 2>&1
|
||||
hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })' >/dev/null 2>&1 || hyprctl dispatch dpms off >/dev/null 2>&1
|
||||
exit 0
|
||||
elif [[ $step == "on" ]]; then
|
||||
hyprctl dispatch dpms on >/dev/null 2>&1
|
||||
hyprctl dispatch 'hl.dsp.dpms({ action = "enable" })' >/dev/null 2>&1 || hyprctl dispatch dpms on >/dev/null 2>&1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -30,6 +30,7 @@ for candidate in amdgpu_bl* intel_backlight acpi_video*; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if omarchy-hyprland-monitor-focused-apple; then
|
||||
omarchy-brightness-display-apple "$step"
|
||||
exit
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Clear the internal-monitor-disable toggle if no external display is connected.
|
||||
|
||||
TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf"
|
||||
TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua"
|
||||
|
||||
if [[ -f $TOGGLE ]] && ! omarchy-hw-external-monitors; then
|
||||
rm -f "$TOGGLE"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:args=<on|off|toggle|recover>
|
||||
|
||||
TOGGLE="internal-monitor-disable"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua"
|
||||
MIRROR_TOGGLE="internal-monitor-mirror"
|
||||
|
||||
# Get internal monitor name dynamically
|
||||
@@ -24,14 +24,14 @@ off() {
|
||||
fi
|
||||
|
||||
if omarchy-hyprland-toggle-disabled $TOGGLE && omarchy-hyprland-toggle-disabled $MIRROR_TOGGLE; then
|
||||
echo "monitor=$INTERNAL,disable" >"$TOGGLE_FLAG"
|
||||
printf 'hl.monitor({ output = "%s", disabled = true })\n' "$INTERNAL" >"$TOGGLE_FLAG"
|
||||
omarchy-notification-send -g "Laptop display disabled"
|
||||
hyprctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
recover() {
|
||||
if ! omarchy-hw-external-monitors; then
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:args=<on|off|toggle|recover>
|
||||
|
||||
TOGGLE="internal-monitor-mirror"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua"
|
||||
DISABLE_TOGGLE="internal-monitor-disable"
|
||||
|
||||
# Get names dynamically
|
||||
@@ -24,9 +24,12 @@ on() {
|
||||
fi
|
||||
|
||||
omarchy-hyprland-toggle $DISABLE_TOGGLE off
|
||||
echo "monitor=$EXTERNAL, preferred, auto, 1, mirror, $INTERNAL" >"$TOGGLE_FLAG"
|
||||
omarchy-notification-send -g "Mirroring enabled ($EXTERNAL)"
|
||||
hyprctl reload
|
||||
|
||||
if omarchy-hyprland-toggle-disabled $TOGGLE; then
|
||||
printf 'hl.monitor({ output = "%s", mode = "preferred", position = "auto", scale = 1, mirror = "%s" })\n' "$EXTERNAL" "$INTERNAL" >"$TOGGLE_FLAG"
|
||||
omarchy-notification-send -g "Mirroring enabled ($EXTERNAL)"
|
||||
hyprctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
off() {
|
||||
@@ -45,7 +48,7 @@ toggle() {
|
||||
}
|
||||
|
||||
recover() {
|
||||
if ! omarchy-hw-external-monitors; then
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ CURRENT_IDX=$(awk -v s="$CURRENT_SCALE" -v list="${SCALES[*]}" 'BEGIN {
|
||||
print best
|
||||
}')
|
||||
|
||||
if [[ "$1" == "--reverse" ]]; then
|
||||
if [[ $1 == "--reverse" ]]; then
|
||||
NEW_IDX=$(( (CURRENT_IDX - 1 + ${#SCALES[@]}) % ${#SCALES[@]} ))
|
||||
else
|
||||
NEW_IDX=$(( (CURRENT_IDX + 1) % ${#SCALES[@]} ))
|
||||
@@ -32,19 +32,16 @@ fi
|
||||
|
||||
NEW_SCALE=${SCALES[$NEW_IDX]}
|
||||
|
||||
hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE"
|
||||
hyprctl eval "hl.monitor({ output = \"$ACTIVE_MONITOR\", mode = \"${WIDTH}x${HEIGHT}@${REFRESH_RATE}\", position = \"auto\", scale = $NEW_SCALE })" >/dev/null
|
||||
|
||||
# Persist to monitors.conf if the user has a single generic catch-all line
|
||||
# (ignoring disabled monitors), so the scale survives reboots.
|
||||
MONITOR_CONF="$HOME/.config/hypr/monitors.conf"
|
||||
if [[ -f $MONITOR_CONF ]]; then
|
||||
mapfile -t ACTIVE_LINES < <(grep -E '^[[:space:]]*monitor=' "$MONITOR_CONF" | grep -vE 'disable[[:space:]]*$')
|
||||
if [[ ${#ACTIVE_LINES[@]} -eq 1 ]] && [[ "${ACTIVE_LINES[0]}" =~ ^monitor=,preferred,auto, ]]; then
|
||||
sed -i -E \
|
||||
-e "s|^(monitor=,preferred,auto,).*|\\1${NEW_SCALE}|" \
|
||||
-e "s|^([[:space:]]*env[[:space:]]*=[[:space:]]*GDK_SCALE,).*|\\1${NEW_SCALE}|" \
|
||||
"$MONITOR_CONF"
|
||||
fi
|
||||
# Persist to monitors.lua if the user has a single generic catch-all line,
|
||||
# so the scale survives reboots.
|
||||
MONITOR_LUA="$HOME/.config/hypr/monitors.lua"
|
||||
if [[ -f $MONITOR_LUA ]] && grep -q '^hl\.monitor({ output = "", mode = "preferred", position = "auto", scale = ' "$MONITOR_LUA"; then
|
||||
sed -i -E \
|
||||
-e "s|^(hl\.monitor\(\{ output = \"\", mode = \"preferred\", position = \"auto\", scale = )([^ ]+)( \}\))|\\1${NEW_SCALE}\\3|" \
|
||||
-e 's|^hl\.env\("GDK_SCALE", ".*"\)|hl.env("GDK_SCALE", "'"$NEW_SCALE"'")|' \
|
||||
"$MONITOR_LUA"
|
||||
fi
|
||||
|
||||
notify-send -u low " Display scaling set to ${NEW_SCALE}x"
|
||||
|
||||
@@ -1,29 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely.
|
||||
# omarchy:args=<flag-name> [on|off]
|
||||
# omarchy:args=[--enabled-notification <text>] [--disabled-notification <text>] <flag-name> [on|off|toggle]
|
||||
|
||||
ENABLED_NOTIFICATION=""
|
||||
DISABLED_NOTIFICATION=""
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
--enabled-notification)
|
||||
if (($# < 2)); then
|
||||
echo "Missing value for $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
ENABLED_NOTIFICATION="$2"
|
||||
shift 2
|
||||
;;
|
||||
--disabled-notification)
|
||||
if (($# < 2)); then
|
||||
echo "Missing value for $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
DISABLED_NOTIFICATION="$2"
|
||||
shift 2
|
||||
;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if (($# < 1)); then
|
||||
echo "Usage: omarchy-hyprland-toggle [--enabled-notification <text>] [--disabled-notification <text>] <flag-name> [on|off|toggle]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FLAG_NAME="$1"
|
||||
ACTION="${2:-toggle}"
|
||||
FLAG="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.conf"
|
||||
FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.conf"
|
||||
FLAG_FILE="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.lua"
|
||||
FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.lua"
|
||||
|
||||
on() {
|
||||
if [[ -f $FLAG_SOURCE ]]; then
|
||||
mkdir -p "$(dirname "$FLAG")"
|
||||
cp "$FLAG_SOURCE" "$FLAG"
|
||||
mkdir -p "$(dirname "$FLAG_FILE")"
|
||||
cp "$FLAG_SOURCE" "$FLAG_FILE"
|
||||
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
||||
else
|
||||
echo "Flag not found: $FLAG_NAME"
|
||||
echo "Flag not found: $FLAG_NAME" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
off() {
|
||||
rm -f "$FLAG"
|
||||
rm -f "$FLAG_FILE"
|
||||
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if [[ -f $FLAG ]]; then
|
||||
if [[ -f $FLAG_FILE ]]; then
|
||||
off
|
||||
echo "off"
|
||||
else
|
||||
@@ -37,7 +69,7 @@ case $ACTION in
|
||||
off) off ;;
|
||||
toggle) toggle ;;
|
||||
*)
|
||||
echo "Usage: omarchy-hyprland-toggle <flag-name> [on|off]"
|
||||
echo "Usage: omarchy-hyprland-toggle [--enabled-notification <text>] [--disabled-notification <text>] <flag-name> [on|off|toggle]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# omarchy:summary=Check if a Hyprland toggle is currently disabled (missing).
|
||||
# omarchy:args=<flag-name>
|
||||
|
||||
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]]
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# omarchy:summary=Check if a Hyprland toggle is currently enabled.
|
||||
# omarchy:args=<flag-name>
|
||||
|
||||
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]]
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
hyprctl clients -j | \
|
||||
jq -r ".[].address" | \
|
||||
xargs -I{} hyprctl dispatch closewindow address:{}
|
||||
while read -r addr; do
|
||||
hyprctl dispatch "hl.dsp.window.close(\"address:$addr\")" >/dev/null 2>&1 || hyprctl dispatch closewindow "address:$addr"
|
||||
done
|
||||
|
||||
# Move to first workspace
|
||||
hyprctl dispatch workspace 1
|
||||
hyprctl dispatch 'hl.dsp.focus({ workspace = "1" })' >/dev/null 2>&1 || hyprctl dispatch workspace 1
|
||||
|
||||
@@ -11,24 +11,30 @@ y=${4:-}
|
||||
active=$(hyprctl activewindow -j)
|
||||
pinned=$(echo "$active" | jq ".pinned")
|
||||
addr=$(echo "$active" | jq -r ".address")
|
||||
window="address:$addr"
|
||||
|
||||
hypr_dispatch() {
|
||||
local lua="$1"
|
||||
shift
|
||||
|
||||
hyprctl dispatch "$lua" >/dev/null 2>&1 || hyprctl dispatch "$@" >/dev/null
|
||||
}
|
||||
|
||||
if [[ $pinned == "true" ]]; then
|
||||
hyprctl -q --batch \
|
||||
"dispatch pin address:$addr;" \
|
||||
"dispatch togglefloating address:$addr;" \
|
||||
"dispatch tagwindow -pop address:$addr;"
|
||||
hypr_dispatch "hl.dsp.window.pin({ window = \"$window\" })" pin "$window"
|
||||
hypr_dispatch "hl.dsp.window.float({ window = \"$window\", action = \"toggle\" })" togglefloating "$window"
|
||||
hypr_dispatch "hl.dsp.window.tag({ window = \"$window\", tag = \"-pop\" })" tagwindow -pop "$window"
|
||||
elif [[ -n $addr ]]; then
|
||||
hyprctl dispatch togglefloating address:$addr
|
||||
hyprctl dispatch resizeactive exact $width $height address:$addr
|
||||
hypr_dispatch "hl.dsp.window.float({ window = \"$window\", action = \"toggle\" })" togglefloating "$window"
|
||||
hypr_dispatch "hl.dsp.window.resize({ window = \"$window\", x = $width, y = $height })" resizeactive exact "$width" "$height" "$window"
|
||||
|
||||
if [[ -n $x && -n $y ]]; then
|
||||
hyprctl dispatch moveactive $x $y address:$addr
|
||||
hypr_dispatch "hl.dsp.window.move({ window = \"$window\", x = $x, y = $y })" moveactive "$x" "$y" "$window"
|
||||
else
|
||||
hyprctl dispatch centerwindow address:$addr
|
||||
hypr_dispatch "hl.dsp.window.center({ window = \"$window\" })" centerwindow "$window"
|
||||
fi
|
||||
|
||||
hyprctl -q --batch \
|
||||
"dispatch pin address:$addr;" \
|
||||
"dispatch alterzorder top address:$addr;" \
|
||||
"dispatch tagwindow +pop address:$addr;"
|
||||
hypr_dispatch "hl.dsp.window.pin({ window = \"$window\" })" pin "$window"
|
||||
hypr_dispatch "hl.dsp.window.alter_zorder({ window = \"$window\", mode = \"top\" })" alterzorder top "$window"
|
||||
hypr_dispatch "hl.dsp.window.tag({ window = \"$window\", tag = \"+pop\" })" tagwindow +pop "$window"
|
||||
fi
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
# omarchy:summary=Toggles transparency for the currently focused window.
|
||||
|
||||
hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle
|
||||
addr=$(hyprctl activewindow -j | jq -r '.address')
|
||||
hyprctl dispatch "hl.dsp.window.set_prop({ window = \"address:$addr\", prop = \"opaque\", value = \"toggle\" })" >/dev/null 2>&1 || \
|
||||
hyprctl dispatch setprop "address:$addr" opaque toggle
|
||||
|
||||
@@ -10,5 +10,6 @@ case "$CURRENT_LAYOUT" in
|
||||
*) NEW_LAYOUT=dwindle ;;
|
||||
esac
|
||||
|
||||
hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
|
||||
hyprctl eval "hl.workspace_rule({ workspace = \"$ACTIVE_WORKSPACE\", layout = \"$NEW_LAYOUT\" })" >/dev/null 2>&1 || \
|
||||
hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
|
||||
notify-send -u low " Workspace layout set to $NEW_LAYOUT"
|
||||
|
||||
@@ -13,7 +13,7 @@ LAUNCH_COMMAND="${2:-"uwsm-app -- $WINDOW_PATTERN"}"
|
||||
WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + $p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1)
|
||||
|
||||
if [[ -n $WINDOW_ADDRESS ]]; then
|
||||
hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
|
||||
hyprctl dispatch "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
|
||||
else
|
||||
eval exec setsid $LAUNCH_COMMAND
|
||||
fi
|
||||
|
||||
@@ -20,35 +20,31 @@ walker -q
|
||||
focused=$(omarchy-hyprland-monitor-focused)
|
||||
terminal=$(xdg-terminal-exec --print-id)
|
||||
|
||||
hypr_focus_monitor() {
|
||||
hyprctl dispatch "hl.dsp.focus({ monitor = \"$1\" })" >/dev/null 2>&1 || hyprctl dispatch focusmonitor "$1" >/dev/null
|
||||
}
|
||||
|
||||
hypr_exec() {
|
||||
local command="$1"
|
||||
|
||||
hyprctl dispatch "hl.dsp.exec_cmd([[$command]])" >/dev/null 2>&1 || hyprctl dispatch exec -- bash -lc "$command" >/dev/null
|
||||
}
|
||||
|
||||
for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
hyprctl dispatch focusmonitor $m
|
||||
hypr_focus_monitor "$m"
|
||||
|
||||
case $terminal in
|
||||
*Alacritty*)
|
||||
hyprctl dispatch exec -- \
|
||||
alacritty --class=org.omarchy.screensaver \
|
||||
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \
|
||||
-e omarchy-screensaver
|
||||
hypr_exec "alacritty --class=org.omarchy.screensaver --config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml -e omarchy-screensaver"
|
||||
;;
|
||||
*ghostty*)
|
||||
hyprctl dispatch exec -- \
|
||||
ghostty --class=org.omarchy.screensaver \
|
||||
--config-file=~/.local/share/omarchy/default/ghostty/screensaver \
|
||||
--font-size=18 \
|
||||
-e omarchy-screensaver
|
||||
hypr_exec "ghostty --class=org.omarchy.screensaver --config-file=~/.local/share/omarchy/default/ghostty/screensaver --font-size=18 -e omarchy-screensaver"
|
||||
;;
|
||||
*foot*)
|
||||
hyprctl dispatch exec -- \
|
||||
foot --app-id=org.omarchy.screensaver \
|
||||
--config="$OMARCHY_PATH/default/foot/screensaver.ini" \
|
||||
-e omarchy-screensaver
|
||||
hypr_exec "foot --app-id=org.omarchy.screensaver --config=\"$OMARCHY_PATH/default/foot/screensaver.ini\" -e omarchy-screensaver"
|
||||
;;
|
||||
*kitty*)
|
||||
hyprctl dispatch exec -- \
|
||||
kitty --class=org.omarchy.screensaver \
|
||||
--override font_size=18 \
|
||||
--override window_padding_width=0 \
|
||||
-e omarchy-screensaver
|
||||
hypr_exec "kitty --class=org.omarchy.screensaver --override font_size=18 --override window_padding_width=0 -e omarchy-screensaver"
|
||||
;;
|
||||
*)
|
||||
notify-send -u low "✋ Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty"
|
||||
@@ -56,4 +52,4 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
esac
|
||||
done
|
||||
|
||||
hyprctl dispatch focusmonitor $focused
|
||||
hypr_focus_monitor "$focused"
|
||||
|
||||
+12
-7
@@ -56,6 +56,11 @@ open_in_editor() {
|
||||
omarchy-launch-editor "$1"
|
||||
}
|
||||
|
||||
hypr_config_file() {
|
||||
local name="$1"
|
||||
printf '%s/.config/hypr/%s.lua' "$HOME" "$name"
|
||||
}
|
||||
|
||||
install() {
|
||||
present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2"
|
||||
}
|
||||
@@ -272,7 +277,7 @@ show_style_menu() {
|
||||
*Font*) show_font_menu ;;
|
||||
*Background*) show_background_menu ;;
|
||||
*Corners*) show_style_corners_menu ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||
*Hyprland*) open_in_editor "$(hypr_config_file looknfeel)" ;;
|
||||
*Waybar*) show_waybar_position_menu ;;
|
||||
*Screensaver*) show_screensaver_menu ;;
|
||||
*About*) show_about_menu ;;
|
||||
@@ -335,8 +340,8 @@ show_font_menu() {
|
||||
|
||||
show_setup_menu() {
|
||||
local options=" Audio\n Wifi\n Bluetooth\n Power Profile\n System Sleep\n Monitors"
|
||||
[[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings"
|
||||
[[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input"
|
||||
[[ -f ~/.config/hypr/bindings.lua ]] && options="$options\n Keybindings"
|
||||
[[ -f ~/.config/hypr/input.lua ]] && options="$options\n Input"
|
||||
options="$options\n Defaults\n DNS\n Security\n Config"
|
||||
|
||||
case $(menu "Setup" "$options") in
|
||||
@@ -345,9 +350,9 @@ show_setup_menu() {
|
||||
*Bluetooth*) omarchy-launch-bluetooth ;;
|
||||
*Power*) show_setup_power_menu ;;
|
||||
*System*) show_setup_system_menu ;;
|
||||
*Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
|
||||
*Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
|
||||
*Input*) open_in_editor ~/.config/hypr/input.conf ;;
|
||||
*Monitors*) open_in_editor "$(hypr_config_file monitors)" ;;
|
||||
*Keybindings*) open_in_editor "$(hypr_config_file bindings)" ;;
|
||||
*Input*) open_in_editor "$(hypr_config_file input)" ;;
|
||||
*Defaults*) show_setup_default_menu ;;
|
||||
*DNS*) present_terminal omarchy-setup-dns ;;
|
||||
*Security*) show_setup_security_menu ;;
|
||||
@@ -482,7 +487,7 @@ show_setup_default_editor_menu() {
|
||||
|
||||
show_setup_config_menu() {
|
||||
case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
||||
*Hyprland*) open_in_editor "$(hypr_config_file hyprland)" ;;
|
||||
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;;
|
||||
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
|
||||
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Overwrite all the user configs in ~/.config/hypr with the Omarchy defaults.
|
||||
# omarchy:summary=Overwrite all the user Hyprland Lua configs in ~/.config/hypr with the Omarchy defaults.
|
||||
|
||||
omarchy-refresh-config hypr/autostart.conf
|
||||
omarchy-refresh-config hypr/bindings.conf
|
||||
omarchy-refresh-config hypr/input.conf
|
||||
omarchy-refresh-config hypr/looknfeel.conf
|
||||
omarchy-refresh-config hypr/hyprland.conf
|
||||
omarchy-refresh-config hypr/monitors.conf
|
||||
omarchy-refresh-config hypr/.luarc.json
|
||||
omarchy-refresh-config hypr/autostart.lua
|
||||
omarchy-refresh-config hypr/bindings.lua
|
||||
omarchy-refresh-config hypr/input.lua
|
||||
omarchy-refresh-config hypr/looknfeel.lua
|
||||
omarchy-refresh-config hypr/hyprland.lua
|
||||
omarchy-refresh-config hypr/monitors.lua
|
||||
bash "$OMARCHY_PATH/install/config/detect-keyboard-layout.sh"
|
||||
|
||||
@@ -8,8 +8,8 @@ if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI w
|
||||
omarchy-webapp-remove-all
|
||||
omarchy-tui-remove-all
|
||||
|
||||
cp ~/.config/hypr/bindings.conf ~/.config/hypr/bindings.conf.bak
|
||||
cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf
|
||||
[[ -f ~/.config/hypr/bindings.lua ]] && cp ~/.config/hypr/bindings.lua ~/.config/hypr/bindings.lua.bak
|
||||
cp "$OMARCHY_PATH/default/hypr/plain-bindings.lua" ~/.config/hypr/bindings.lua
|
||||
hyprctl reload
|
||||
|
||||
# Remove npx stubs
|
||||
|
||||
@@ -7,7 +7,7 @@ screensaver_in_focus() {
|
||||
}
|
||||
|
||||
exit_screensaver() {
|
||||
hyprctl keyword cursor:invisible false &>/dev/null || true
|
||||
hyprctl eval 'hl.config({ cursor = { invisible = false } })' &>/dev/null || hyprctl keyword cursor:invisible false &>/dev/null || true
|
||||
pkill -x tte 2>/dev/null
|
||||
pkill -f org.omarchy.screensaver 2>/dev/null
|
||||
exit 0
|
||||
@@ -18,7 +18,7 @@ trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT
|
||||
|
||||
printf '\033]11;rgb:00/00/00\007' # Set background color to black
|
||||
|
||||
hyprctl keyword cursor:invisible true &>/dev/null
|
||||
hyprctl eval 'hl.config({ cursor = { invisible = true } })' &>/dev/null || hyprctl keyword cursor:invisible true &>/dev/null
|
||||
|
||||
tty=$(tty 2>/dev/null)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Enable, disable, or toggle the touchpad
|
||||
# omarchy:args=[on|off|toggle]
|
||||
|
||||
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf"
|
||||
STATE_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.lua"
|
||||
|
||||
device="$(omarchy-hw-touchpad)"
|
||||
|
||||
@@ -13,20 +13,20 @@ if [[ -z $device ]]; then
|
||||
fi
|
||||
|
||||
enable() {
|
||||
hyprctl keyword "device[$device]:enabled" true >/dev/null
|
||||
rm -f "$STATE_CONF"
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null
|
||||
rm -f "$STATE_FILE"
|
||||
omarchy-swayosd-client --custom-icon input-touchpad-symbolic --custom-message "Touchpad enabled"
|
||||
}
|
||||
|
||||
disable() {
|
||||
hyprctl keyword "device[$device]:enabled" false >/dev/null
|
||||
mkdir -p "$(dirname "$STATE_CONF")"
|
||||
printf 'device {\n name = %s\n enabled = false\n}\n' "$device" > "$STATE_CONF"
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = false })" >/dev/null
|
||||
mkdir -p "$(dirname "$STATE_FILE")"
|
||||
printf 'hl.device({ name = "%s", enabled = false })\n' "$device" >"$STATE_FILE"
|
||||
omarchy-swayosd-client --custom-icon touchpad-disabled-symbolic --custom-message "Touchpad disabled"
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;;
|
||||
toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;;
|
||||
esac
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Enable, disable, or toggle the touch functionality of the screen
|
||||
# omarchy:args=[on|off|toggle]
|
||||
|
||||
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.conf"
|
||||
STATE_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.lua"
|
||||
|
||||
device="$(omarchy-hw-touchscreen)"
|
||||
|
||||
@@ -13,20 +13,20 @@ if [[ -z $device ]]; then
|
||||
fi
|
||||
|
||||
enable() {
|
||||
hyprctl keyword "device[$device]:enabled" true >/dev/null
|
||||
rm -f "$STATE_CONF"
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null
|
||||
rm -f "$STATE_FILE"
|
||||
omarchy-swayosd-client --custom-icon device-support-touch-symbolic --custom-message "Touchscreen enabled"
|
||||
}
|
||||
|
||||
disable() {
|
||||
hyprctl keyword "device[$device]:enabled" false >/dev/null
|
||||
mkdir -p "$(dirname "$STATE_CONF")"
|
||||
printf 'device {\n name = %s\n enabled = false\n}\n' "$device" > "$STATE_CONF"
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = false })" >/dev/null
|
||||
mkdir -p "$(dirname "$STATE_FILE")"
|
||||
printf 'hl.device({ name = "%s", enabled = false })\n' "$device" >"$STATE_FILE"
|
||||
omarchy-swayosd-client --custom-icon touch-disabled-symbolic --custom-message "Touchscreen disabled"
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;;
|
||||
toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;;
|
||||
esac
|
||||
|
||||
@@ -9,7 +9,7 @@ echo -e "\e[32mUpdate Omarchy\e[0m"
|
||||
omarchy-update-time
|
||||
|
||||
# Suppress Hyprland config errors while git updates default config files mid-pull
|
||||
hyprctl keyword debug:suppress_errors true &>/dev/null || true
|
||||
hyprctl eval 'hl.config({ debug = { suppress_errors = true } })' &>/dev/null || hyprctl keyword debug:suppress_errors true &>/dev/null || true
|
||||
|
||||
git -C $OMARCHY_PATH pull --autostash
|
||||
git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
set -e
|
||||
|
||||
# Ensure screensaver/sleep doesn't set in during updates
|
||||
hyprctl dispatch tagwindow +noidle &>/dev/null || true
|
||||
hyprctl dispatch 'hl.dsp.window.tag({ tag = "+noidle" })' &>/dev/null || hyprctl dispatch tagwindow +noidle &>/dev/null || true
|
||||
|
||||
# Perform all update steps
|
||||
omarchy-update-keyring
|
||||
@@ -22,4 +22,4 @@ omarchy-update-analyze-logs
|
||||
omarchy-update-restart
|
||||
|
||||
# Re-enable screensaver/sleep after updates
|
||||
hyprctl dispatch tagwindow -- -noidle &>/dev/null || true
|
||||
hyprctl dispatch 'hl.dsp.window.tag({ tag = "-noidle" })' &>/dev/null || hyprctl dispatch tagwindow -- -noidle &>/dev/null || true
|
||||
|
||||
@@ -1 +1 @@
|
||||
command = 'wl-copy && hyprctl dispatch sendshortcut "SHIFT, Insert,"'
|
||||
command = 'wl-copy && (hyprctl dispatch "hl.dsp.send_shortcut({ mods = \"SHIFT\", key = \"Insert\" })" || hyprctl dispatch sendshortcut "SHIFT, Insert,")'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=Recover the internal monitor toggle when no external display is connected
|
||||
Before=graphical-session-pre.target
|
||||
ConditionPathExists=%h/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf
|
||||
ConditionPathExists=%h/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Copy over the keyboard layout that's been set in Arch during install to Hyprland
|
||||
conf="/etc/vconsole.conf"
|
||||
hyprconf="$HOME/.config/hypr/input.conf"
|
||||
hyprlua="$HOME/.config/hypr/input.lua"
|
||||
|
||||
if grep -q '^XKBLAYOUT=' "$conf"; then
|
||||
if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBLAYOUT=' "$conf"; then
|
||||
layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"')
|
||||
sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = $layout" "$hyprconf"
|
||||
sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = \"$layout\"," "$hyprlua"
|
||||
fi
|
||||
|
||||
if grep -q '^XKBVARIANT=' "$conf"; then
|
||||
if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBVARIANT=' "$conf"; then
|
||||
variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"')
|
||||
sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = $variant" "$hyprconf"
|
||||
sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = \"$variant\"," "$hyprlua"
|
||||
fi
|
||||
|
||||
@@ -30,20 +30,20 @@ EOF
|
||||
# Add NVIDIA environment variables based on GPU architecture
|
||||
if [[ $GPU_ARCH = "turing_plus" ]]; then
|
||||
# Turing+ (RTX 20xx, GTX 16xx, and newer) with GSP firmware support
|
||||
cat >>"$HOME/.config/hypr/envs.conf" <<'EOF'
|
||||
cat >>"$HOME/.config/hypr/envs.lua" <<'EOF'
|
||||
|
||||
# NVIDIA (Turing+ with GSP firmware)
|
||||
env = NVD_BACKEND,direct
|
||||
env = LIBVA_DRIVER_NAME,nvidia
|
||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||
-- NVIDIA (Turing+ with GSP firmware)
|
||||
hl.env("NVD_BACKEND", "direct")
|
||||
hl.env("LIBVA_DRIVER_NAME", "nvidia")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
EOF
|
||||
elif [[ $GPU_ARCH = "maxwell_pascal_volta" ]]; then
|
||||
# Maxwell/Pascal/Volta (GTX 9xx/10xx, GT 10xx, Quadro P/M/GV, MX series, Titan X/Xp/V) lack GSP firmware
|
||||
cat >>"$HOME/.config/hypr/envs.conf" <<'EOF'
|
||||
cat >>"$HOME/.config/hypr/envs.lua" <<'EOF'
|
||||
|
||||
# NVIDIA (Maxwell/Pascal/Volta without GSP firmware)
|
||||
env = NVD_BACKEND,egl
|
||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||
-- NVIDIA (Maxwell/Pascal/Volta without GSP firmware)
|
||||
hl.env("NVD_BACKEND", "egl")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Toggles are used to turn certain features on/off in a persistent way
|
||||
mkdir -p ~/.local/state/omarchy/toggles/hypr
|
||||
cp $OMARCHY_PATH/default/hypr/toggles/flags.conf ~/.local/state/omarchy/toggles/hypr/
|
||||
cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/
|
||||
|
||||
@@ -4,7 +4,8 @@ omarchy-refresh-sddm
|
||||
# Setup SDDM login service
|
||||
sudo mkdir -p /usr/local/share/wayland-sessions
|
||||
sudo cp "$OMARCHY_PATH/default/wayland-sessions/omarchy.desktop" /usr/local/share/wayland-sessions/omarchy.desktop
|
||||
sudo cp "$OMARCHY_PATH/default/sddm/hyprland.conf" /usr/share/sddm/hyprland.conf
|
||||
sudo cp "$OMARCHY_PATH/default/sddm/hyprland.lua" /usr/share/sddm/hyprland.lua
|
||||
sudo rm -f /usr/share/sddm/hyprland.conf
|
||||
|
||||
sudo mkdir -p /etc/sddm.conf.d
|
||||
cat <<EOF | sudo tee /etc/sddm.conf.d/10-wayland.conf >/dev/null
|
||||
@@ -12,7 +13,7 @@ cat <<EOF | sudo tee /etc/sddm.conf.d/10-wayland.conf >/dev/null
|
||||
DisplayServer=wayland
|
||||
|
||||
[Wayland]
|
||||
CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.conf
|
||||
CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.lua
|
||||
EOF
|
||||
|
||||
if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then
|
||||
|
||||
Reference in New Issue
Block a user