mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 12:47:49 +02:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82b1c62d55 | ||
|
|
bbd2ddda2a | ||
|
|
c8ce3187b4 | ||
|
|
0152e18656 | ||
|
|
df300a3b31 | ||
|
|
706806728f |
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"workspace": {
|
||||
"library": [
|
||||
"/usr/share/hypr/stubs"
|
||||
],
|
||||
"checkThirdParty": false
|
||||
},
|
||||
"diagnostics": {
|
||||
"globals": ["hl"]
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,6 @@ Use these instead of raw shell commands:
|
||||
- `omarchy-cmd-missing` / `omarchy-cmd-present` - check for commands
|
||||
- `omarchy-pkg-missing` / `omarchy-pkg-present` - check for packages
|
||||
- `omarchy-pkg-add` - install packages (handles both pacman and AUR)
|
||||
- `omarchy-notification-send` - send desktop notifications; do not call `notify-send` directly
|
||||
- `omarchy-hw-asus-rog` - detect ASUS ROG hardware (and similar `hw-*` commands)
|
||||
|
||||
Exceptions are allowed for bootstrap, preflight, migration, and package-helper scripts where the helper may not be available yet, where the helper itself is being implemented, or where direct package-manager behavior is required.
|
||||
@@ -93,14 +92,6 @@ Exceptions are allowed for bootstrap, preflight, migration, and package-helper s
|
||||
- `default/themed/*.tpl` - templates with `{{ variable }}` placeholders for theme colors
|
||||
- `themes/*/colors.toml` - theme color definitions (accent, background, foreground, color0-15)
|
||||
|
||||
# Visual Changes
|
||||
|
||||
When making visual changes, such as Waybar styles or desktop appearance, always take and analyze a screenshot after applying the change to verify the result. Use `omarchy capture screenshot fullscreen save` for fullscreen screenshots.
|
||||
|
||||
For interactive UI work, use `wtype` to simulate keyboard input when available. Example: start the UI in the background, wait briefly for focus, then run `wtype -k Right -k Return` to exercise keyboard selection and confirm the resulting command output or state change. Prefer this over manual-only verification when a UI returns a selected value or changes a symlink/config.
|
||||
|
||||
When testing layer-shell UI, capture the reference and candidate states as separate screenshots, then compare them visually before further edits. If a launched UI would otherwise remain open, keep track of its PID and stop it after the screenshot; avoid broad process kills unless checking with `ps` first.
|
||||
|
||||
# Refresh Pattern
|
||||
|
||||
To copy a default config to user config with automatic backup:
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 63 KiB |
@@ -29,7 +29,6 @@ declare -A GROUP_DESCRIPTIONS
|
||||
GROUP_DESCRIPTIONS[ac]="AC power detection"
|
||||
GROUP_DESCRIPTIONS[battery]="Battery status helpers"
|
||||
GROUP_DESCRIPTIONS[branch]="Omarchy git branch management"
|
||||
GROUP_DESCRIPTIONS[branding]="About and screensaver branding"
|
||||
GROUP_DESCRIPTIONS[brightness]="Display and keyboard brightness"
|
||||
GROUP_DESCRIPTIONS[capture]="Screenshots and screen recording"
|
||||
GROUP_DESCRIPTIONS[channel]="Omarchy release channel management"
|
||||
@@ -40,14 +39,12 @@ GROUP_DESCRIPTIONS[default]="Default application selection"
|
||||
GROUP_DESCRIPTIONS[dev]="Omarchy development tools"
|
||||
GROUP_DESCRIPTIONS[drive]="Drive selection and encryption"
|
||||
GROUP_DESCRIPTIONS[font]="Font management"
|
||||
GROUP_DESCRIPTIONS[games]="Game launchers and helpers"
|
||||
GROUP_DESCRIPTIONS[hibernation]="Hibernation setup and removal"
|
||||
GROUP_DESCRIPTIONS[hook]="User hook runner"
|
||||
GROUP_DESCRIPTIONS[hw]="Hardware detection and controls"
|
||||
GROUP_DESCRIPTIONS[hyprland]="Hyprland window, monitor, and toggle controls"
|
||||
GROUP_DESCRIPTIONS[install]="Optional software installers"
|
||||
GROUP_DESCRIPTIONS[launch]="Application launchers"
|
||||
GROUP_DESCRIPTIONS[mako]="Mako notification controls"
|
||||
GROUP_DESCRIPTIONS[menu]="Omarchy menu commands"
|
||||
GROUP_DESCRIPTIONS[migrate]="Migration runner"
|
||||
GROUP_DESCRIPTIONS[notification]="Notification helpers"
|
||||
@@ -57,13 +54,11 @@ GROUP_DESCRIPTIONS[plymouth]="Plymouth boot theme management"
|
||||
GROUP_DESCRIPTIONS[powerprofiles]="Power profile management"
|
||||
GROUP_DESCRIPTIONS[refresh]="Reset config to defaults"
|
||||
GROUP_DESCRIPTIONS[reinstall]="Reinstall and reset workflows"
|
||||
GROUP_DESCRIPTIONS[reminder]="Desktop notification reminders"
|
||||
GROUP_DESCRIPTIONS[remove]="Removal workflows"
|
||||
GROUP_DESCRIPTIONS[restart]="Restart Omarchy components"
|
||||
GROUP_DESCRIPTIONS[setup]="Interactive setup wizards"
|
||||
GROUP_DESCRIPTIONS[screensaver]="Screensaver branding and animation"
|
||||
GROUP_DESCRIPTIONS[snapshot]="System snapshots"
|
||||
GROUP_DESCRIPTIONS[style]="Global UI style controls"
|
||||
GROUP_DESCRIPTIONS[sudo]="Sudo configuration helpers"
|
||||
GROUP_DESCRIPTIONS[swayosd]="SwayOSD status display helpers"
|
||||
GROUP_DESCRIPTIONS[system]="Reboot, shutdown, logout, and lock"
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Edit, set, or reset About branding
|
||||
# omarchy:group=branding
|
||||
# omarchy:name=about
|
||||
# omarchy:args=<image|text|reset>
|
||||
# omarchy:examples=omarchy branding about image | omarchy branding about text | omarchy branding about reset
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SOURCE_DIR="${XDG_PICTURES_DIR:-$HOME/Pictures}"
|
||||
|
||||
case "${1:-}" in
|
||||
image)
|
||||
image=$(omarchy-menu-file "Pick png/svg from $SOURCE_DIR" "${SOURCE_DIR}" "svg png")
|
||||
if [[ -n $image ]] && omarchy-transcode-ascii "$image" ~/.config/omarchy/branding/about.txt --width 54 --height 26; then
|
||||
omarchy-launch-about >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
text)
|
||||
omarchy-launch-editor ~/.config/omarchy/branding/about.txt >/dev/null 2>&1 && omarchy-launch-about >/dev/null 2>&1
|
||||
;;
|
||||
reset)
|
||||
cp "$OMARCHY_PATH/icon.txt" ~/.config/omarchy/branding/about.txt && omarchy-launch-about >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy-branding-about <image|text|reset>" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Edit, set, or reset screensaver branding
|
||||
# omarchy:group=branding
|
||||
# omarchy:name=screensaver
|
||||
# omarchy:args=<image|text|reset>
|
||||
# omarchy:examples=omarchy branding screensaver image | omarchy branding screensaver text | omarchy branding screensaver reset
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SOURCE_DIR="${XDG_PICTURES_DIR:-$HOME/Pictures}"
|
||||
|
||||
case "${1:-}" in
|
||||
image)
|
||||
image=$(omarchy-menu-file "Pick png/svg from $SOURCE_DIR" "${SOURCE_DIR}" "svg png")
|
||||
if [[ -n $image ]] && omarchy-transcode-ascii "$image" ~/.config/omarchy/branding/screensaver.txt; then
|
||||
omarchy-launch-screensaver force >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
text)
|
||||
omarchy-launch-editor ~/.config/omarchy/branding/screensaver.txt >/dev/null 2>&1 && omarchy-launch-screensaver force >/dev/null 2>&1
|
||||
;;
|
||||
reset)
|
||||
cp "$OMARCHY_PATH/logo.txt" ~/.config/omarchy/branding/screensaver.txt && omarchy-launch-screensaver force >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy-branding-screensaver <image|text|reset>" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -6,21 +6,6 @@
|
||||
|
||||
step="${1:-+5%}"
|
||||
|
||||
if [[ $step == "off" ]]; then
|
||||
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 'hl.dsp.dpms({ action = "enable" })' >/dev/null 2>&1 || hyprctl dispatch dpms on >/dev/null 2>&1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
runtime_dir="${XDG_RUNTIME_DIR:-/tmp}"
|
||||
|
||||
# Drop overlapping brightness key events so concurrent invocations do not race.
|
||||
# Hardware key repeat present on some devices can otherwise glitch SwayOSD rendering.
|
||||
exec 9>"$runtime_dir/omarchy-brightness-display.lock"
|
||||
flock -n 9 || exit 0
|
||||
|
||||
# Start with the first possible output, then refine to the most likely given an order heuristic.
|
||||
device="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1)"
|
||||
for candidate in amdgpu_bl* intel_backlight acpi_video*; do
|
||||
@@ -30,6 +15,13 @@ for candidate in amdgpu_bl* intel_backlight acpi_video*; do
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $step == "off" ]]; then
|
||||
hyprctl dispatch dpms off >/dev/null 2>&1
|
||||
exit 0
|
||||
elif [[ $step == "on" ]]; then
|
||||
hyprctl dispatch dpms on >/dev/null 2>&1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if omarchy-hyprland-monitor-focused-apple; then
|
||||
omarchy-brightness-display-apple "$step"
|
||||
|
||||
@@ -233,7 +233,6 @@ stop_screenrecording() {
|
||||
else
|
||||
finalize_recording
|
||||
local filename=$(cat "$RECORDING_FILE" 2>/dev/null)
|
||||
echo "$filename"
|
||||
local preview="${filename%.mp4}-preview.png"
|
||||
|
||||
# Generate a preview thumbnail from the first frame
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Take a screenshot
|
||||
# omarchy:group=capture
|
||||
# omarchy:args=[smart|region|windows|fullscreen] [slurp|copy|save] [--editor=<name>]
|
||||
# omarchy:args=[smart|region|windows|fullscreen] [slurp|copy] [--editor=<name>]
|
||||
# omarchy:examples=omarchy screenshot | omarchy capture screenshot region
|
||||
# omarchy:aliases=omarchy screenshot
|
||||
|
||||
@@ -126,22 +126,14 @@ esac
|
||||
FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||
FILEPATH="$OUTPUT_DIR/$FILENAME"
|
||||
|
||||
case "$PROCESSING" in
|
||||
slurp)
|
||||
grim -g "$SELECTION" "$FILEPATH" || exit 1
|
||||
echo "$FILEPATH"
|
||||
wl-copy <"$FILEPATH"
|
||||
if [[ $PROCESSING == "slurp" ]]; then
|
||||
grim -g "$SELECTION" "$FILEPATH" || exit 1
|
||||
wl-copy <"$FILEPATH"
|
||||
|
||||
(
|
||||
ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
|
||||
[[ $ACTION == "default" ]] && open_editor "$FILEPATH"
|
||||
) >/dev/null 2>&1 &
|
||||
;;
|
||||
copy)
|
||||
grim -g "$SELECTION" - | wl-copy
|
||||
;;
|
||||
save)
|
||||
grim -g "$SELECTION" "$FILEPATH" || exit 1
|
||||
echo "$FILEPATH"
|
||||
;;
|
||||
esac
|
||||
(
|
||||
ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
|
||||
[[ $ACTION == "default" ]] && open_editor "$FILEPATH"
|
||||
) &
|
||||
else
|
||||
grim -g "$SELECTION" - | wl-copy
|
||||
fi
|
||||
|
||||
@@ -25,7 +25,7 @@ brave) desktop_id="brave-browser.desktop"; name="Brave"; glyph="" ;;
|
||||
brave-origin) desktop_id="brave-origin-beta.desktop"; name="Brave Origin"; glyph="" ;;
|
||||
edge) desktop_id="microsoft-edge.desktop"; name="Edge"; glyph="" ;;
|
||||
firefox) desktop_id="firefox.desktop"; name="Firefox"; glyph="" ;;
|
||||
zen) desktop_id="zen.desktop"; name="Zen"; glyph="" ;;
|
||||
zen) desktop_id="zen.desktop"; name="Zen"; glyph="" ;;
|
||||
*)
|
||||
echo "Usage: omarchy-default-browser <chromium|chrome|brave|brave-origin|edge|firefox|zen>"
|
||||
exit 1
|
||||
|
||||
@@ -12,7 +12,7 @@ fi
|
||||
case "$1" in
|
||||
code) editor="code"; name="VSCode"; glyph="" ;;
|
||||
cursor) editor="cursor"; name="Cursor"; glyph="" ;;
|
||||
zed | zeditor) editor="zeditor"; name="Zed"; glyph="" ;;
|
||||
zed) editor="zed"; name="Zed"; glyph="" ;;
|
||||
sublime_text) editor="sublime_text"; name="Sublime Text"; glyph="" ;;
|
||||
helix) editor="helix"; name="Helix"; glyph="" ;;
|
||||
vim) editor="vim"; name="Vim"; glyph="" ;;
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Measure theme switcher cache and selector prep times
|
||||
# omarchy:args=[--repeat=<count>] [--keep-cache]
|
||||
# omarchy:examples=omarchy dev benchmark theme switcher | omarchy dev benchmark theme-switcher --repeat=10
|
||||
# omarchy:aliases=omarchy dev benchmark theme-switcher
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
OMARCHY_BIN_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$(cd -- "$OMARCHY_BIN_DIR/.." && pwd)}
|
||||
REPEAT=5
|
||||
KEEP_CACHE=false
|
||||
|
||||
show_help() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
omarchy dev benchmark theme switcher [--repeat=<count>] [--keep-cache]
|
||||
|
||||
Measure the non-interactive parts of the theme switcher:
|
||||
- theme preview index build (omarchy-theme-switcher before UI handoff)
|
||||
- lazy selector row prep used by the interactive theme switcher
|
||||
- full thumbnail cache warmup cost (omarchy-menu-images --cache-only)
|
||||
|
||||
Options:
|
||||
--repeat=<count> Number of warm runs to measure for each case (default: 5)
|
||||
--keep-cache Keep the temporary benchmark cache and print its path
|
||||
EOF
|
||||
}
|
||||
|
||||
now_us() {
|
||||
local now="${EPOCHREALTIME/./}"
|
||||
printf '%s' "$now"
|
||||
}
|
||||
|
||||
format_ms() {
|
||||
local us="$1"
|
||||
printf '%d.%03d' "$(( us / 1000 ))" "$(( us % 1000 ))"
|
||||
}
|
||||
|
||||
measure_once() {
|
||||
local start_us end_us
|
||||
start_us=$(now_us)
|
||||
"$@" >/dev/null
|
||||
end_us=$(now_us)
|
||||
printf '%s' "$(( end_us - start_us ))"
|
||||
}
|
||||
|
||||
run_case() {
|
||||
local label="$1"
|
||||
shift
|
||||
local total_us=0
|
||||
local min_us=0
|
||||
local max_us=0
|
||||
local elapsed_us=0
|
||||
|
||||
for (( i = 1; i <= REPEAT; i++ )); do
|
||||
elapsed_us=$(measure_once "$@")
|
||||
total_us=$(( total_us + elapsed_us ))
|
||||
|
||||
if (( i == 1 || elapsed_us < min_us )); then
|
||||
min_us=$elapsed_us
|
||||
fi
|
||||
|
||||
if (( elapsed_us > max_us )); then
|
||||
max_us=$elapsed_us
|
||||
fi
|
||||
done
|
||||
|
||||
printf '%-34s avg %8s ms min %8s ms max %8s ms\n' \
|
||||
"$label" \
|
||||
"$(format_ms "$(( total_us / REPEAT ))")" \
|
||||
"$(format_ms "$min_us")" \
|
||||
"$(format_ms "$max_us")"
|
||||
}
|
||||
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--repeat=*)
|
||||
REPEAT="${1#*=}"
|
||||
;;
|
||||
--keep-cache)
|
||||
KEEP_CACHE=true
|
||||
;;
|
||||
--help | -h)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1" >&2
|
||||
show_help >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [[ ! $REPEAT =~ ^[0-9]+$ ]] || (( REPEAT < 1 )); then
|
||||
echo "--repeat must be a positive integer" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
benchmark_cache=$(mktemp -d)
|
||||
thumbnail_cache=$(mktemp -d)
|
||||
stub_bin=$(mktemp -d)
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$stub_bin"
|
||||
|
||||
if [[ $KEEP_CACHE == "true" ]]; then
|
||||
printf 'Benchmark cache: %s\n' "$benchmark_cache"
|
||||
printf 'Thumbnail cache: %s\n' "$thumbnail_cache"
|
||||
else
|
||||
rm -rf "$benchmark_cache" "$thumbnail_cache"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
cat >"$stub_bin/omarchy-menu-images" <<'EOF'
|
||||
#!/bin/bash
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "$stub_bin/omarchy-menu-images"
|
||||
|
||||
benchmark_env=(
|
||||
env
|
||||
"OMARCHY_PATH=$OMARCHY_PATH"
|
||||
"XDG_CACHE_HOME=$benchmark_cache"
|
||||
"PATH=$stub_bin:$OMARCHY_BIN_DIR:$PATH"
|
||||
)
|
||||
|
||||
thumbnail_env=(
|
||||
env
|
||||
"OMARCHY_PATH=$OMARCHY_PATH"
|
||||
"XDG_CACHE_HOME=$thumbnail_cache"
|
||||
"PATH=$stub_bin:$OMARCHY_BIN_DIR:$PATH"
|
||||
)
|
||||
|
||||
preview_dir="$benchmark_cache/omarchy/theme-selector/previews"
|
||||
thumbnail_preview_dir="$thumbnail_cache/omarchy/theme-selector/previews"
|
||||
|
||||
build_theme_index() {
|
||||
"${benchmark_env[@]}" "$OMARCHY_BIN_DIR/omarchy-theme-switcher"
|
||||
}
|
||||
|
||||
prepare_selector_lazy() {
|
||||
"${benchmark_env[@]}" "$OMARCHY_BIN_DIR/omarchy-menu-images" --prepare-only --lazy-thumbnails --show-labels --filterable "$preview_dir"
|
||||
}
|
||||
|
||||
prepare_image_cache() {
|
||||
"${thumbnail_env[@]}" "$OMARCHY_BIN_DIR/omarchy-menu-images" --cache-only "$thumbnail_preview_dir"
|
||||
}
|
||||
|
||||
printf 'Theme switcher benchmark (%d warm runs each)\n\n' "$REPEAT"
|
||||
printf '%-34s %s ms\n' "theme index cold" "$(format_ms "$(measure_once build_theme_index)")"
|
||||
run_case "theme index warm" build_theme_index
|
||||
printf '%-34s %s ms\n' "selector prep cold (lazy)" "$(format_ms "$(measure_once prepare_selector_lazy)")"
|
||||
run_case "selector prep warm (lazy)" prepare_selector_lazy
|
||||
"${thumbnail_env[@]}" "$OMARCHY_BIN_DIR/omarchy-theme-switcher" >/dev/null
|
||||
printf '%-34s %s ms\n' "thumbnail cache cold" "$(format_ms "$(measure_once prepare_image_cache)")"
|
||||
run_case "thumbnail cache warm" prepare_image_cache
|
||||
|
||||
printf '\nTheme previews: %d\n' "$(find -L "$preview_dir" -maxdepth 1 -type f 2>/dev/null | wc -l)"
|
||||
@@ -16,8 +16,6 @@ if [[ -f $FIRST_RUN_MODE ]]; then
|
||||
bash "$OMARCHY_PATH/install/first-run/firewall.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gnome-theme.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gdk-scale.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/swayosd.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gtk-primary-paste.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/elephant.sh"
|
||||
omarchy-hook-install post-update "$OMARCHY_PATH/install/first-run/install-voxtype.hook"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=List installed RetroArch core names
|
||||
|
||||
set -e
|
||||
|
||||
core_dir="/usr/lib/libretro"
|
||||
preferred_cores=(
|
||||
"Amstrad CPC|cap32"
|
||||
"Arcade FBNeo|fbneo"
|
||||
"Arcade MAME|mame"
|
||||
"Commodore Amiga|puae"
|
||||
"Commodore C128|vice_x128"
|
||||
"Commodore C64|vice_x64"
|
||||
"Commodore VIC-20|vice_xvic"
|
||||
"Nintendo DS|desmume"
|
||||
"Nintendo Game Boy / Color|gambatte"
|
||||
"Nintendo Game Boy Advance|mgba"
|
||||
"Nintendo GameCube / Wii|dolphin"
|
||||
"Nintendo NES / Famicom|mesen"
|
||||
"Nintendo 64|parallel_n64"
|
||||
"Nintendo SNES / SFC|snes9x"
|
||||
"NEC PC Engine / TurboGrafx-16|mednafen_pce_fast"
|
||||
"NEC PC Engine CD / TurboGrafx-CD|mednafen_pce"
|
||||
"NEC PC Engine SuperGrafx|mednafen_supergrafx"
|
||||
"Sega Dreamcast|flycast"
|
||||
"Sega Mega Drive / Master System / Game Gear|genesis_plus_gx"
|
||||
"Sega Saturn|kronos"
|
||||
"Sony PlayStation|mednafen_psx_hw"
|
||||
"Sony PlayStation Portable|ppsspp"
|
||||
)
|
||||
|
||||
[[ -d $core_dir ]] || exit 0
|
||||
|
||||
for preferred_core in "${preferred_cores[@]}"; do
|
||||
label="${preferred_core%%|*}"
|
||||
core="${preferred_core#*|}"
|
||||
[[ -f $core_dir/${core}_libretro.so ]] && printf '%s (%s)\n' "$label" "$core"
|
||||
done
|
||||
@@ -1,76 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Create a desktop launcher for a RetroArch game
|
||||
# omarchy:args=[core path-to-game]
|
||||
# omarchy:examples=omarchy games retro install snes9x ~/Games/roms/snes/game.sfc | omarchy-games-retro-install /usr/lib/libretro/mgba_libretro.so ~/Games/roms/gba/game.gba
|
||||
|
||||
set -e
|
||||
|
||||
if (( $# == 0 )); then
|
||||
mapfile -t cores < <(omarchy-games-retro-cores)
|
||||
|
||||
if (( ${#cores[@]} == 0 )); then
|
||||
omarchy-notification-send -g "" "No RetroArch cores found" "/usr/lib/libretro"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
core=$(omarchy-menu-select "RetroArch core" "${cores[@]}") || exit 0
|
||||
[[ -n $core ]] || exit 0
|
||||
core="${core##*(}"
|
||||
core="${core%)}"
|
||||
|
||||
game_path=$(omarchy-menu-file "Retro game" "$HOME/Games/roms" "7z bin ccd chd cue dmg elf fds gb gba gbc iso lha m3u md n64 nds nes pbp sfc smc swc zip z64") || exit 0
|
||||
[[ -n $game_path ]] || exit 0
|
||||
elif (( $# == 2 )); then
|
||||
core="$1"
|
||||
game_path="$2"
|
||||
else
|
||||
echo "Usage: omarchy-games-retro-install [core path-to-game]"
|
||||
echo "Example: omarchy-games-retro-install snes9x ~/Games/roms/snes/game.sfc"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f $game_path ]]; then
|
||||
echo "Game not found: $game_path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $core == */* ]]; then
|
||||
core_path="$core"
|
||||
else
|
||||
core_path="/usr/lib/libretro/${core}_libretro.so"
|
||||
fi
|
||||
|
||||
if [[ ! -f $core_path ]]; then
|
||||
echo "Core not found: $core_path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
game_name=$(printf '%s' "${game_path##*/}" | sed 's/\.[^.]*$//; s/[[:space:]]*([^)]*)//g; s/[[:space:]]\+/ /g; s/^ //; s/ $//' | perl -Mopen=locale -pe 's/(^|[[:space:]])([^[:space:]])/$1\U$2/g')
|
||||
desktop_name="$game_name"
|
||||
desktop_id=$(printf '%s' "$desktop_name" | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | sed 's/^-//; s/-$//')
|
||||
desktop_dir="$HOME/.local/share/applications"
|
||||
desktop_file="$desktop_dir/$desktop_id.desktop"
|
||||
icon_dir="$desktop_dir/icons"
|
||||
icon_path="$icon_dir/Retro Gaming.png"
|
||||
|
||||
mkdir -p "$desktop_dir" "$icon_dir"
|
||||
[[ -f $icon_path ]] || cp "$HOME/.local/share/omarchy/applications/icons/Retro Gaming.png" "$icon_path"
|
||||
|
||||
cat >"$desktop_file" <<EOF
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=$desktop_name
|
||||
Comment=Play $game_name with RetroArch
|
||||
Exec=retroarch -L "$core_path" "$game_path"
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$icon_path
|
||||
StartupNotify=true
|
||||
Categories=Game;Emulator;
|
||||
EOF
|
||||
|
||||
chmod +x "$desktop_file"
|
||||
update-desktop-database "$desktop_dir" &>/dev/null || true
|
||||
|
||||
omarchy-notification-send -g "" "$game_name installed" "Start it with Super + Space"
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# omarchy:summary=Run the Synaptics touchpad haptic feedback daemon
|
||||
|
||||
"""Haptic feedback daemon for Synaptics touchpads with Manual Trigger.
|
||||
|
||||
Monitors touchpad button press events and sends haptic pulses via HID
|
||||
feature reports. Required because the kernel's HID haptic subsystem only
|
||||
supports Auto Trigger with waveform enumeration, not the simpler Manual
|
||||
Trigger protocol used by these Synaptics touchpads.
|
||||
"""
|
||||
|
||||
import fcntl, glob, os, struct, sys
|
||||
|
||||
VENDOR = "06CB"
|
||||
REPORT_ID = 0x37
|
||||
INTENSITY = 40 # 0-100
|
||||
|
||||
# input_event: struct timeval (16 bytes on 64-bit) + type(H) + code(H) + value(i)
|
||||
EVENT_FORMAT = "llHHi"
|
||||
EVENT_SIZE = struct.calcsize(EVENT_FORMAT)
|
||||
EV_KEY = 0x01
|
||||
BTN_LEFT = 272
|
||||
BTN_RIGHT = 273
|
||||
BTN_MIDDLE = 274
|
||||
|
||||
# ioctl: HIDIOCSFEATURE(len) = _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
|
||||
def HIDIOCSFEATURE(length):
|
||||
return 0xC0000000 | (length << 16) | (ord("H") << 8) | 0x06
|
||||
|
||||
|
||||
def find_hidraw():
|
||||
for path in sorted(glob.glob("/sys/class/hidraw/hidraw*")):
|
||||
uevent = os.path.join(path, "device", "uevent")
|
||||
try:
|
||||
with open(uevent) as f:
|
||||
content = f.read().upper()
|
||||
if f"0000{VENDOR}" in content:
|
||||
return os.path.join("/dev", os.path.basename(path))
|
||||
except OSError:
|
||||
continue
|
||||
return None
|
||||
|
||||
|
||||
def find_touchpad_event():
|
||||
for path in sorted(glob.glob("/sys/class/input/event*/device/name")):
|
||||
try:
|
||||
with open(path) as f:
|
||||
name = f.read().strip().upper()
|
||||
if VENDOR in name and "TOUCHPAD" in name:
|
||||
event = path.split("/")[-3]
|
||||
return os.path.join("/dev/input", event)
|
||||
except OSError:
|
||||
continue
|
||||
return None
|
||||
|
||||
|
||||
def main():
|
||||
hidraw = find_hidraw()
|
||||
if not hidraw:
|
||||
print("No Synaptics haptic touchpad hidraw device found", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
event = find_touchpad_event()
|
||||
if not event:
|
||||
print("No Synaptics haptic touchpad input device found", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Haptic touchpad: hidraw={hidraw} input={event} intensity={INTENSITY}", flush=True)
|
||||
|
||||
haptic_report = struct.pack("BB", REPORT_ID, INTENSITY)
|
||||
ioctl_req = HIDIOCSFEATURE(len(haptic_report))
|
||||
|
||||
hidraw_fd = os.open(hidraw, os.O_RDWR)
|
||||
event_fd = os.open(event, os.O_RDONLY)
|
||||
|
||||
try:
|
||||
while True:
|
||||
data = os.read(event_fd, EVENT_SIZE)
|
||||
if len(data) < EVENT_SIZE:
|
||||
continue
|
||||
_, _, ev_type, code, value = struct.unpack(EVENT_FORMAT, data)
|
||||
if ev_type == EV_KEY and code in (BTN_LEFT, BTN_RIGHT, BTN_MIDDLE) and value == 1:
|
||||
try:
|
||||
fcntl.ioctl(hidraw_fd, ioctl_req, haptic_report)
|
||||
except OSError:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
os.close(event_fd)
|
||||
os.close(hidraw_fd)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Match Dell XPS systems with the Synaptics haptic touchpad.
|
||||
|
||||
omarchy-hw-match "XPS" && [[ -e /sys/bus/i2c/devices/i2c-VEN_06CB:00 ]]
|
||||
@@ -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.lua"
|
||||
TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf"
|
||||
|
||||
if [[ -f $TOGGLE ]] && ! omarchy-hw-external-monitors; then
|
||||
rm -f "$TOGGLE"
|
||||
|
||||
@@ -4,50 +4,40 @@
|
||||
# omarchy:args=<on|off|toggle|recover>
|
||||
|
||||
TOGGLE="internal-monitor-disable"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf"
|
||||
MIRROR_TOGGLE="internal-monitor-mirror"
|
||||
|
||||
# Get internal monitor name dynamically
|
||||
INTERNAL=$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP")).name' | head -n 1)
|
||||
|
||||
on() {
|
||||
if omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
omarchy-notification-send -g "Laptop display enabled"
|
||||
enable() {
|
||||
if omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle --disabled-notification " Laptop display enabled" "$TOGGLE"
|
||||
fi
|
||||
}
|
||||
|
||||
off() {
|
||||
disable() {
|
||||
if ! omarchy-hw-external-monitors; then
|
||||
omarchy-notification-send -g "Can't disable the only active display"
|
||||
notify-send -u low " Can't disable the only active display"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if omarchy-hyprland-toggle-disabled $TOGGLE && omarchy-hyprland-toggle-disabled $MIRROR_TOGGLE; then
|
||||
printf 'hl.monitor({ output = "%s", disabled = true })\n' "$INTERNAL" >"$TOGGLE_FLAG"
|
||||
omarchy-notification-send -g "Laptop display disabled"
|
||||
if omarchy-hyprland-toggle-disabled "$TOGGLE" && omarchy-hyprland-toggle-disabled "$MIRROR_TOGGLE"; then
|
||||
echo "monitor=$INTERNAL,disable" >"$TOGGLE_FLAG"
|
||||
notify-send -u low " Laptop display disabled"
|
||||
hyprctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
recover() {
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
fi
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
on
|
||||
else
|
||||
off
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle "$TOGGLE"
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
on) on ;;
|
||||
off) off ;;
|
||||
toggle) toggle ;;
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if omarchy-hyprland-toggle-enabled "$TOGGLE"; then enable; else disable; fi ;;
|
||||
recover) recover ;;
|
||||
*)
|
||||
echo "Usage: $(basename "$0") {on|off|toggle|recover}" >&2
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:args=<on|off|toggle|recover>
|
||||
|
||||
TOGGLE="internal-monitor-mirror"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua"
|
||||
TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf"
|
||||
DISABLE_TOGGLE="internal-monitor-disable"
|
||||
|
||||
# Get names dynamically
|
||||
@@ -12,51 +12,44 @@ INTERNAL=$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP")).na
|
||||
# Get the first available external monitor
|
||||
EXTERNAL=$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP") | not).name' | head -n 1)
|
||||
|
||||
on() {
|
||||
if [[ -z $EXTERNAL ]]; then
|
||||
omarchy-notification-send -g "No external monitors found for mirror"
|
||||
enable() {
|
||||
if [[ -z "$EXTERNAL" ]]; then
|
||||
notify-send -u low " No external monitors found for mirror"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $INTERNAL ]]; then
|
||||
omarchy-notification-send -g "No laptop monitor found to mirror"
|
||||
if [[ -z "$INTERNAL" ]]; then
|
||||
notify-send -u low " No laptop monitor found to mirror"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
omarchy-hyprland-toggle $DISABLE_TOGGLE off
|
||||
if omarchy-hyprland-toggle-enabled "$DISABLE_TOGGLE"; then
|
||||
omarchy-hyprland-toggle "$DISABLE_TOGGLE"
|
||||
fi
|
||||
|
||||
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)"
|
||||
if omarchy-hyprland-toggle-disabled "$TOGGLE"; then
|
||||
echo "monitor=$EXTERNAL, preferred, auto, 1, mirror, $INTERNAL" > "$TOGGLE_FLAG"
|
||||
notify-send -u low " Mirroring enabled ($EXTERNAL)"
|
||||
hyprctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
off() {
|
||||
if omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
omarchy-notification-send -g "Extended mode restored"
|
||||
fi
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
off
|
||||
else
|
||||
on
|
||||
disable() {
|
||||
if omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle --disabled-notification " Extended mode restored" "$TOGGLE"
|
||||
fi
|
||||
}
|
||||
|
||||
recover() {
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then
|
||||
omarchy-hyprland-toggle $TOGGLE off
|
||||
if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled "$TOGGLE"; then
|
||||
omarchy-hyprland-toggle "$TOGGLE"
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
on) on ;;
|
||||
off) off ;;
|
||||
toggle) toggle ;;
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if omarchy-hyprland-toggle-enabled "$TOGGLE"; then disable; else enable; fi ;;
|
||||
recover) recover ;;
|
||||
*)
|
||||
echo "Usage: $(basename "$0") {on|off|toggle|recover}" >&2
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Print the monitor scale of the internal monitor or first other monitor
|
||||
|
||||
hyprctl monitors -j | jq -r '([.[] | select(.name | contains("eDP"))][0] // .[0]).scale // empty | tonumber | if . == floor then floor else . end'
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Cycle focused Hyprland monitor scaling through 1x, 1.25x, 1.6x, 2x, 3x, and 4x
|
||||
# omarchy:summary=Cycle focused Hyprland monitor scaling through 1x, 1.25x, 1.6x, 2x, and 3x
|
||||
|
||||
MONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)')
|
||||
ACTIVE_MONITOR=$(echo "$MONITOR_INFO" | jq -r '.name')
|
||||
@@ -9,9 +9,8 @@ WIDTH=$(echo "$MONITOR_INFO" | jq -r '.width')
|
||||
HEIGHT=$(echo "$MONITOR_INFO" | jq -r '.height')
|
||||
REFRESH_RATE=$(echo "$MONITOR_INFO" | jq -r '.refreshRate')
|
||||
|
||||
# Cycle through monitor/GDK scale pairs: 1 → 1.25 → 1.6 → 2 → 3 → 4 → 1 (or reverse with --reverse)
|
||||
SCALES=(1 1.25 1.6 2 3 4)
|
||||
GDK_SCALES=(1 1.25 1.75 2 3 4)
|
||||
# Cycle through scales: 1 → 1.25 → 1.6 → 2 → 3 → 1 (or reverse with --reverse)
|
||||
SCALES=(1 1.25 1.6 2 3)
|
||||
|
||||
# Find the index of the scale closest to the current one (Hyprland may
|
||||
# snap fractional scales to nearby values, so we can't match exactly)
|
||||
@@ -25,30 +24,24 @@ 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[@]} ))
|
||||
fi
|
||||
|
||||
NEW_SCALE=${SCALES[$NEW_IDX]}
|
||||
NEW_GDK_SCALE=${GDK_SCALES[$NEW_IDX]}
|
||||
|
||||
hyprctl eval "hl.monitor({ output = \"$ACTIVE_MONITOR\", mode = \"${WIDTH}x${HEIGHT}@${REFRESH_RATE}\", position = \"auto\", scale = $NEW_SCALE })" >/dev/null
|
||||
hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE"
|
||||
|
||||
# Persist to monitors.lua if the user still has Omarchy's generic catch-all
|
||||
# defaults, so the scale survives reboots.
|
||||
MONITOR_LUA="$HOME/.config/hypr/monitors.lua"
|
||||
if [[ -f $MONITOR_LUA ]] && grep -q '^local omarchy_monitor_scale = ' "$MONITOR_LUA"; then
|
||||
sed -i -E \
|
||||
-e "s|^local omarchy_monitor_scale = .*|local omarchy_monitor_scale = ${NEW_SCALE}|" \
|
||||
-e "s|^local omarchy_gdk_scale = .*|local omarchy_gdk_scale = ${NEW_GDK_SCALE}|" \
|
||||
"$MONITOR_LUA"
|
||||
elif [[ -f $MONITOR_LUA ]] && grep -Eq '^hl\.monitor\(\{ output = "", mode = "preferred", position = "auto", scale = ("auto"|[0-9.]+) \}\)' "$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_GDK_SCALE"'")|' \
|
||||
"$MONITOR_LUA"
|
||||
# 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 "s|^(monitor=,preferred,auto,).*|\\1${NEW_SCALE}|" "$MONITOR_CONF"
|
||||
fi
|
||||
fi
|
||||
|
||||
notify-send -u low " Display scaling set to ${NEW_SCALE}x"
|
||||
|
||||
+17
-62
@@ -1,77 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely.
|
||||
# omarchy:args=[--enabled-notification <text>] [--disabled-notification <text>] <flag-name> [on|off|toggle]
|
||||
# omarchy:args=[--enabled-notification <text>] [--disabled-notification <text>] <flag-name>
|
||||
|
||||
ENABLED_NOTIFICATION=""
|
||||
DISABLED_NOTIFICATION=""
|
||||
|
||||
while (($# > 0)); do
|
||||
while [[ $# -gt 1 ]]; 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
|
||||
;;
|
||||
--enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
--disabled-notification) 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
|
||||
FLAG_NAME="$1"
|
||||
FLAG="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.conf"
|
||||
FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$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: $FLAG_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FLAG_NAME="$1"
|
||||
ACTION="${2:-toggle}"
|
||||
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_FILE")"
|
||||
cp "$FLAG_SOURCE" "$FLAG_FILE"
|
||||
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
||||
else
|
||||
echo "Flag not found: $FLAG_NAME" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
off() {
|
||||
rm -f "$FLAG_FILE"
|
||||
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if [[ -f $FLAG_FILE ]]; then
|
||||
off
|
||||
echo "off"
|
||||
else
|
||||
on
|
||||
echo "on"
|
||||
fi
|
||||
}
|
||||
|
||||
case $ACTION in
|
||||
on) on ;;
|
||||
off) off ;;
|
||||
toggle) toggle ;;
|
||||
*)
|
||||
echo "Usage: omarchy-hyprland-toggle [--enabled-notification <text>] [--disabled-notification <text>] <flag-name> [on|off|toggle]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
hyprctl reload >/dev/null
|
||||
hyprctl reload
|
||||
|
||||
@@ -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.lua" ]]
|
||||
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
|
||||
@@ -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.lua" ]]
|
||||
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
|
||||
hyprctl clients -j | \
|
||||
jq -r ".[].address" | \
|
||||
while read -r addr; do
|
||||
hyprctl dispatch "hl.dsp.window.close(\"address:$addr\")" >/dev/null 2>&1 || hyprctl dispatch closewindow "address:$addr"
|
||||
done
|
||||
xargs -I{} hyprctl dispatch closewindow address:{}
|
||||
|
||||
# Move to first workspace
|
||||
hyprctl dispatch 'hl.dsp.focus({ workspace = "1" })' >/dev/null 2>&1 || hyprctl dispatch workspace 1
|
||||
hyprctl dispatch workspace 1
|
||||
|
||||
@@ -11,30 +11,24 @@ 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
|
||||
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"
|
||||
hyprctl -q --batch \
|
||||
"dispatch pin address:$addr;" \
|
||||
"dispatch togglefloating address:$addr;" \
|
||||
"dispatch tagwindow -pop address:$addr;"
|
||||
elif [[ -n $addr ]]; then
|
||||
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"
|
||||
hyprctl dispatch togglefloating address:$addr
|
||||
hyprctl dispatch resizeactive exact $width $height address:$addr
|
||||
|
||||
if [[ -n $x && -n $y ]]; then
|
||||
hypr_dispatch "hl.dsp.window.move({ window = \"$window\", x = $x, y = $y })" moveactive "$x" "$y" "$window"
|
||||
hyprctl dispatch moveactive $x $y address:$addr
|
||||
else
|
||||
hypr_dispatch "hl.dsp.window.center({ window = \"$window\" })" centerwindow "$window"
|
||||
hyprctl dispatch centerwindow address:$addr
|
||||
fi
|
||||
|
||||
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"
|
||||
hyprctl -q --batch \
|
||||
"dispatch pin address:$addr;" \
|
||||
"dispatch alterzorder top address:$addr;" \
|
||||
"dispatch tagwindow +pop address:$addr;"
|
||||
fi
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Toggle single-window square aspect ratio.
|
||||
|
||||
case $(omarchy-hyprland-toggle single-window-aspect-ratio) in
|
||||
on) omarchy-notification-send -g "Enable single-window square aspect ratio" ;;
|
||||
off) omarchy-notification-send -g "Disable single-window square aspect ratio" ;;
|
||||
esac
|
||||
omarchy-hyprland-toggle \
|
||||
--enabled-notification " Enable single-window square aspect ratio" \
|
||||
--disabled-notification " Disable single-window square aspect ratio" \
|
||||
single-window-aspect-ratio
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
|
||||
# omarchy:summary=Toggles transparency for the currently focused window.
|
||||
|
||||
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
|
||||
hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle
|
||||
|
||||
@@ -10,6 +10,5 @@ case "$CURRENT_LAYOUT" in
|
||||
*) NEW_LAYOUT=dwindle ;;
|
||||
esac
|
||||
|
||||
hyprctl eval "hl.workspace_rule({ workspace = \"$ACTIVE_WORKSPACE\", layout = \"$NEW_LAYOUT\" })" >/dev/null 2>&1 || \
|
||||
hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
|
||||
hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
|
||||
notify-send -u low " Workspace layout set to $NEW_LAYOUT"
|
||||
|
||||
@@ -21,10 +21,7 @@ omarchy-pkg-add \
|
||||
libretro-parallel-n64 libretro-picodrive libretro-play libretro-ppsspp \
|
||||
libretro-sameboy libretro-scummvm libretro-shaders-slang libretro-snes9x \
|
||||
libretro-yabause \
|
||||
libretro-cap32-git libretro-fbneo-git libretro-uae-git \
|
||||
libretro-vice-x128-git libretro-vice-x64-git libretro-vice-x64dtv-git libretro-vice-x64sc-git \
|
||||
libretro-vice-xcbm2-git libretro-vice-xcbm5x0-git libretro-vice-xpet-git \
|
||||
libretro-vice-xplus4-git libretro-vice-xscpu64-git libretro-vice-xvic-git \
|
||||
libretro-cap32-git libretro-fbneo-git libretro-uae-git libretro-vice-git \
|
||||
libretro-database-git \
|
||||
retroarch-joypad-autoconfig-git
|
||||
|
||||
|
||||
@@ -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 "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
|
||||
hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
|
||||
else
|
||||
eval exec setsid $LAUNCH_COMMAND
|
||||
fi
|
||||
|
||||
@@ -20,31 +20,35 @@ 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
|
||||
hypr_focus_monitor "$m"
|
||||
hyprctl dispatch focusmonitor $m
|
||||
|
||||
case $terminal in
|
||||
*Alacritty*)
|
||||
hypr_exec "alacritty --class=org.omarchy.screensaver --config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml -e omarchy-screensaver"
|
||||
hyprctl dispatch exec -- \
|
||||
alacritty --class=org.omarchy.screensaver \
|
||||
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \
|
||||
-e omarchy-screensaver
|
||||
;;
|
||||
*ghostty*)
|
||||
hypr_exec "ghostty --class=org.omarchy.screensaver --config-file=~/.local/share/omarchy/default/ghostty/screensaver --font-size=18 -e omarchy-screensaver"
|
||||
hyprctl dispatch exec -- \
|
||||
ghostty --class=org.omarchy.screensaver \
|
||||
--config-file=~/.local/share/omarchy/default/ghostty/screensaver \
|
||||
--font-size=18 \
|
||||
-e omarchy-screensaver
|
||||
;;
|
||||
*foot*)
|
||||
hypr_exec "foot --app-id=org.omarchy.screensaver --config=\"$OMARCHY_PATH/default/foot/screensaver.ini\" -e omarchy-screensaver"
|
||||
hyprctl dispatch exec -- \
|
||||
foot --app-id=org.omarchy.screensaver \
|
||||
--config="$OMARCHY_PATH/default/foot/screensaver.ini" \
|
||||
-e omarchy-screensaver
|
||||
;;
|
||||
*kitty*)
|
||||
hypr_exec "kitty --class=org.omarchy.screensaver --override font_size=18 --override window_padding_width=0 -e omarchy-screensaver"
|
||||
hyprctl dispatch 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"
|
||||
@@ -52,4 +56,4 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
esac
|
||||
done
|
||||
|
||||
hypr_focus_monitor "$focused"
|
||||
hyprctl dispatch focusmonitor $focused
|
||||
|
||||
+55
-131
@@ -56,11 +56,6 @@ 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"
|
||||
}
|
||||
@@ -98,10 +93,9 @@ show_learn_menu() {
|
||||
}
|
||||
|
||||
show_trigger_menu() {
|
||||
case $(menu "Trigger" " Reminder\n Capture\n Transcode\n Share\n Toggle\n Hardware") in
|
||||
*Reminder*) show_reminder_menu ;;
|
||||
case $(menu "Trigger" " Capture\n Transcode\n Share\n Toggle\n Hardware") in
|
||||
*Capture*) show_capture_menu ;;
|
||||
*Transcode*) omarchy-transcode || back_to show_trigger_menu ;;
|
||||
*Transcode*) show_transcode_menu ;;
|
||||
*Share*) show_share_menu ;;
|
||||
*Toggle*) show_toggle_menu ;;
|
||||
*Hardware*) show_hardware_menu ;;
|
||||
@@ -109,41 +103,6 @@ show_trigger_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_reminder_menu() {
|
||||
case $(menu "Reminder" " Set one\n Show all\n Clear all") in
|
||||
*Set*) show_custom_reminder_input ;;
|
||||
*"Show all"*) omarchy-reminder show ;;
|
||||
*"Clear all"*) omarchy-reminder clear ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_custom_reminder_input() {
|
||||
local minutes
|
||||
minutes=$(omarchy-menu-input "Remind in minutes")
|
||||
|
||||
if [[ $minutes =~ ^[0-9]+$ ]] && ((minutes > 0)); then
|
||||
show_reminder_message_input "$minutes"
|
||||
elif [[ -n $minutes ]]; then
|
||||
omarchy-notification-send -g "Invalid reminder" "Enter the number of minutes" -u critical
|
||||
show_custom_reminder_input
|
||||
else
|
||||
back_to show_reminder_menu
|
||||
fi
|
||||
}
|
||||
|
||||
show_reminder_message_input() {
|
||||
local minutes="$1"
|
||||
local message
|
||||
message=$(omarchy-menu-input "Reminder message")
|
||||
|
||||
if [[ -n $message ]]; then
|
||||
omarchy-reminder "$minutes" "$message"
|
||||
else
|
||||
omarchy-reminder "$minutes"
|
||||
fi
|
||||
}
|
||||
|
||||
show_capture_menu() {
|
||||
case $(menu "Capture" " Screenshot\n Screenrecord\n Text Extraction\n Color") in
|
||||
*Screenshot*) omarchy-capture-screenshot ;;
|
||||
@@ -200,8 +159,7 @@ show_screenrecord_menu() {
|
||||
}
|
||||
|
||||
show_share_menu() {
|
||||
case $(menu "Share" " Clipboard\n File \n Folder\n Receive") in
|
||||
*Receive*) uwsm-app -- localsend ;;
|
||||
case $(menu "Share" " Clipboard\n File \n Folder") in
|
||||
*Clipboard*) omarchy-menu-share clipboard ;;
|
||||
*File*) terminal bash -c "omarchy-menu-share file" ;;
|
||||
*Folder*) terminal bash -c "omarchy-menu-share folder" ;;
|
||||
@@ -209,6 +167,14 @@ show_share_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_transcode_menu() {
|
||||
case $(menu "Transcode" " Picture\n Video") in
|
||||
*Picture*) present_terminal "omarchy-transcode --path '$HOME/Pictures'" ;;
|
||||
*Video*) present_terminal "omarchy-transcode --path '$HOME/Videos'" ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_toggle_menu() {
|
||||
local options=" Screensaver\n Nightlight\n Idle Lock\n Notifications\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Direct Boot\n Passwordless Sudo"
|
||||
|
||||
@@ -239,18 +205,13 @@ show_hardware_menu() {
|
||||
options="$options\n Touchpad"
|
||||
fi
|
||||
|
||||
if omarchy-hw-dell-xps-haptic-touchpad && omarchy-cmd-present dell-xps-touchpad-haptics; then
|
||||
options="$options\n Touchpad Haptics"
|
||||
fi
|
||||
|
||||
if omarchy-hw-touchscreen; then
|
||||
options="$options\n Touchscreen"
|
||||
fi
|
||||
|
||||
case $(menu "Toggle" "$options") in
|
||||
*Laptop*) omarchy-hyprland-monitor-internal toggle ;;
|
||||
*Mirror*) omarchy-hyprland-monitor-internal-mirror toggle ;;
|
||||
*Haptics*) show_hardware_touchpad_haptics_menu ;;
|
||||
*Mirror*) omarchy-hyprland-monitor-internal-mirror toggle;;
|
||||
*Touchpad*) omarchy-toggle-touchpad ;;
|
||||
*Touchscreen*) omarchy-toggle-touchscreen ;;
|
||||
*"Hybrid GPU"*) present_terminal omarchy-toggle-hybrid-gpu ;;
|
||||
@@ -258,77 +219,49 @@ show_hardware_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_hardware_touchpad_haptics_menu() {
|
||||
local current=$(dell-xps-touchpad-haptics get)
|
||||
local selected=$(menu "Touchpad Haptics" "low\nmid\nhigh" "" "$current")
|
||||
|
||||
if [[ -n $selected ]]; then
|
||||
dell-xps-touchpad-haptics set "$selected"
|
||||
else
|
||||
back_to show_hardware_menu
|
||||
fi
|
||||
}
|
||||
|
||||
show_style_menu() {
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Waybar\n Corners\n Hyprland\n Screensaver\n About") in
|
||||
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Hyprland\n Screensaver\n About") in
|
||||
*Theme*) show_theme_menu ;;
|
||||
*Unlock*) omarchy-launch-walker -m menus:omarchyunlocks --width 800 --minheight 400 ;;
|
||||
*Font*) show_font_menu ;;
|
||||
*Background*) show_background_menu ;;
|
||||
*Corners*) show_style_corners_menu ;;
|
||||
*Hyprland*) open_in_editor "$(hypr_config_file looknfeel)" ;;
|
||||
*Waybar*) show_waybar_position_menu ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||
*Screensaver*) show_screensaver_menu ;;
|
||||
*About*) show_about_menu ;;
|
||||
*About*) open_in_editor ~/.config/omarchy/branding/about.txt ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_style_corners_menu() {
|
||||
case $(omarchy-menu-select "Corners" " Sharp" " Round") in
|
||||
*Sharp*) omarchy-style-corners sharp ;;
|
||||
*Round*) omarchy-style-corners round ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_waybar_position_menu() {
|
||||
case $(menu "Waybar Position" " Top\n Bottom\n Left\n Right") in
|
||||
*Top*) omarchy-style-waybar-position top ;;
|
||||
*Bottom*) omarchy-style-waybar-position bottom ;;
|
||||
*Left*) omarchy-style-waybar-position left ;;
|
||||
*Right*) omarchy-style-waybar-position right ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_about_menu() {
|
||||
case $(menu "About" " Edit Text\n Set From Image\n Restore Default") in
|
||||
*Text*) omarchy-branding-about text ;;
|
||||
*Image*) omarchy-branding-about image ;;
|
||||
*Default*) omarchy-branding-about reset ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_screensaver_menu() {
|
||||
case $(menu "Screensaver" " Edit Text\n Set From Image\n Restore Default") in
|
||||
*Text*) omarchy-branding-screensaver text ;;
|
||||
*Image*) omarchy-branding-screensaver image ;;
|
||||
*Default*) omarchy-branding-screensaver reset ;;
|
||||
case $(menu "Screensaver" " Edit Text\n Set From Image\n Preview\n Restore Default") in
|
||||
*Text*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;;
|
||||
*Image*) set_screensaver_from_image ;;
|
||||
*Preview*) omarchy-launch-screensaver force ;;
|
||||
*Default*) terminal bash -lc 'omarchy-screensaver-logo default; echo; read -n 1 -s -r -p "Press any key to close..."' ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_screensaver_from_image() {
|
||||
terminal bash -lc '
|
||||
image=$(fd --type file --ignore-case --extension svg --extension png . "$HOME" 2>/dev/null | fzf --prompt "Logo image> ")
|
||||
if [[ -n $image ]]; then
|
||||
if omarchy-screensaver-logo "$image"; then
|
||||
echo
|
||||
echo "Preview with: omarchy-launch-screensaver force"
|
||||
fi
|
||||
echo
|
||||
read -n 1 -s -r -p "Press any key to close..."
|
||||
fi
|
||||
'
|
||||
}
|
||||
|
||||
show_theme_menu() {
|
||||
theme=$(omarchy-theme-switcher)
|
||||
[[ -n $theme ]] && omarchy-theme-set "$theme"
|
||||
omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400
|
||||
}
|
||||
|
||||
show_background_menu() {
|
||||
background=$(omarchy-theme-bg-switcher)
|
||||
[[ -n $background ]] && omarchy-theme-bg-set "$background"
|
||||
omarchy-launch-walker -m menus:omarchyBackgroundSelector --width 800 --minheight 400
|
||||
}
|
||||
|
||||
show_font_menu() {
|
||||
@@ -342,8 +275,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.lua ]] && options="$options\n Keybindings"
|
||||
[[ -f ~/.config/hypr/input.lua ]] && options="$options\n Input"
|
||||
[[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings"
|
||||
[[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input"
|
||||
options="$options\n Defaults\n DNS\n Security\n Config"
|
||||
|
||||
case $(menu "Setup" "$options") in
|
||||
@@ -352,9 +285,9 @@ show_setup_menu() {
|
||||
*Bluetooth*) omarchy-launch-bluetooth ;;
|
||||
*Power*) show_setup_power_menu ;;
|
||||
*System*) show_setup_system_menu ;;
|
||||
*Monitors*) open_in_editor "$(hypr_config_file monitors)" ;;
|
||||
*Keybindings*) open_in_editor "$(hypr_config_file bindings)" ;;
|
||||
*Input*) open_in_editor "$(hypr_config_file input)" ;;
|
||||
*Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
|
||||
*Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
|
||||
*Input*) open_in_editor ~/.config/hypr/input.conf ;;
|
||||
*Defaults*) show_setup_default_menu ;;
|
||||
*DNS*) present_terminal omarchy-setup-dns ;;
|
||||
*Security*) show_setup_security_menu ;;
|
||||
@@ -375,8 +308,8 @@ show_setup_power_menu() {
|
||||
|
||||
show_setup_security_menu() {
|
||||
case $(menu "Setup" " Fingerprint\n Fido2") in
|
||||
*Fingerprint*) present_terminal omarchy-setup-security-fingerprint ;;
|
||||
*Fido2*) present_terminal omarchy-setup-security-fido2 ;;
|
||||
*Fingerprint*) present_terminal omarchy-setup-fingerprint ;;
|
||||
*Fido2*) present_terminal omarchy-setup-fido2 ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
}
|
||||
@@ -456,7 +389,7 @@ show_setup_default_editor_menu() {
|
||||
omarchy-cmd-present nvim && options="$options Neovim"
|
||||
omarchy-cmd-present code && options="${options:+$options\n} VSCode"
|
||||
omarchy-cmd-present cursor && options="${options:+$options\n} Cursor"
|
||||
omarchy-cmd-present zeditor && options="${options:+$options\n} Zed"
|
||||
omarchy-cmd-present zed && options="${options:+$options\n} Zed"
|
||||
omarchy-cmd-present sublime_text && options="${options:+$options\n} Sublime Text"
|
||||
omarchy-cmd-present helix && options="${options:+$options\n} Helix"
|
||||
omarchy-cmd-present vim && options="${options:+$options\n} Vim"
|
||||
@@ -467,7 +400,7 @@ show_setup_default_editor_menu() {
|
||||
nvim) current=" Neovim" ;;
|
||||
code) current=" VSCode" ;;
|
||||
cursor) current=" Cursor" ;;
|
||||
zed | zeditor) current=" Zed" ;;
|
||||
zed) current=" Zed" ;;
|
||||
sublime_text) current=" Sublime Text" ;;
|
||||
helix) current=" Helix" ;;
|
||||
vim) current=" Vim" ;;
|
||||
@@ -489,7 +422,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 "$(hypr_config_file hyprland)" ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
||||
*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 ;;
|
||||
@@ -607,9 +540,8 @@ show_install_ai_menu() {
|
||||
}
|
||||
|
||||
show_install_gaming_menu() {
|
||||
case $(menu "Install" " Steam\n RetroArch\n Minecraft\n NVIDIA GeForce NOW\n Xbox Cloud Gaming\n Xbox Controller\n Moonlight (GameStream)\n Lutris (Battle.net)\n Heroic (Epic Games)\n RetroArch Game Launcher") in
|
||||
case $(menu "Install" " Steam\n RetroArch\n Minecraft\n NVIDIA GeForce NOW\n Xbox Cloud Gaming\n Xbox Controller ()\n Moonlight (GameStream)\n Lutris (Battle.net)\n Heroic (Epic Games)") in
|
||||
*Steam*) present_terminal omarchy-install-gaming-steam ;;
|
||||
*"RetroArch Game Launcher"*) omarchy-games-retro-install ;;
|
||||
*RetroArch*) present_terminal omarchy-install-gaming-retroarch ;;
|
||||
*Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;;
|
||||
*GeForce*) present_terminal omarchy-install-gaming-geforce-now ;;
|
||||
@@ -690,30 +622,23 @@ show_install_elixir_menu() {
|
||||
}
|
||||
|
||||
show_remove_menu() {
|
||||
case $(menu "Remove" " Package\n Web App\n TUI\n Development\n Theme\n Browser\n Dictation\n Gaming\n Windows\n Preinstalls\n Security") in
|
||||
case $(menu "Remove" " Package\n Browser\n Web App\n TUI\n Development\n Gaming\n Preinstalls\n Dictation\n Theme\n Windows\n Fingerprint\n Fido2") in
|
||||
*Package*) terminal omarchy-pkg-remove ;;
|
||||
*Browser*) show_remove_browser_menu ;;
|
||||
*Web*) present_terminal omarchy-webapp-remove ;;
|
||||
*TUI*) present_terminal omarchy-tui-remove ;;
|
||||
*Development*) show_remove_development_menu ;;
|
||||
*Theme*) present_terminal omarchy-theme-remove ;;
|
||||
*Browser*) show_remove_browser_menu ;;
|
||||
*Dictation*) present_terminal omarchy-voxtype-remove ;;
|
||||
*Gaming*) show_remove_gaming_menu ;;
|
||||
*Windows*) present_terminal "omarchy-windows-vm remove" ;;
|
||||
*Preinstalls*) present_terminal omarchy-remove-preinstalls ;;
|
||||
*Security*) show_remove_security_menu ;;
|
||||
*Dictation*) present_terminal omarchy-voxtype-remove ;;
|
||||
*Theme*) present_terminal omarchy-theme-remove ;;
|
||||
*Windows*) present_terminal "omarchy-windows-vm remove" ;;
|
||||
*Fingerprint*) present_terminal "omarchy-setup-fingerprint --remove" ;;
|
||||
*Fido2*) present_terminal "omarchy-setup-fido2 --remove" ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_remove_security_menu() {
|
||||
case $(menu "Remove" " Fingerprint\n Fido2") in
|
||||
*Fingerprint*) present_terminal omarchy-remove-security-fingerprint ;;
|
||||
*Fido2*) present_terminal omarchy-remove-security-fido2 ;;
|
||||
*) show_remove_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_remove_browser_menu() {
|
||||
case $(menu "Remove" " Chrome\n Edge\n Brave\n Brave Origin\n Firefox\n Zen") in
|
||||
*Chrome*) present_terminal "omarchy-remove-browser chrome" ;;
|
||||
@@ -890,8 +815,7 @@ go_to_menu() {
|
||||
*toggle*) show_toggle_menu ;;
|
||||
*hardware*) show_hardware_menu ;;
|
||||
*share*) show_share_menu ;;
|
||||
*reminder-set*) show_custom_reminder_input ;;
|
||||
*reminder*) show_reminder_menu ;;
|
||||
*transcode*) show_transcode_menu ;;
|
||||
*background*) show_background_menu ;;
|
||||
*capture*) show_capture_menu ;;
|
||||
*style*) show_style_menu ;;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Pick a file with Walker
|
||||
# omarchy:group=menu
|
||||
# omarchy:name=file
|
||||
# omarchy:args=label paths formats [walker args...]
|
||||
# omarchy:examples=omarchy menu file "Select image" "$HOME/Pictures" "jpg png webp"|omarchy-menu-file "Select media" "$HOME/Pictures:$HOME/Videos" "jpg png mp4 mov" --width 800
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if (( $# < 3 )); then
|
||||
echo "Usage: omarchy-menu-file <label> <paths> <formats> [walker args...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
label="$1"
|
||||
paths_arg="$2"
|
||||
formats_arg="$3"
|
||||
shift 3
|
||||
|
||||
IFS=: read -r -a paths <<<"$paths_arg"
|
||||
read -r -a formats <<<"$formats_arg"
|
||||
|
||||
if (( ${#paths[@]} == 0 || ${#formats[@]} == 0 )); then
|
||||
echo "Usage: omarchy-menu-file <label> <paths> <formats> [walker args...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for path in "${paths[@]}"; do
|
||||
[[ -e $path ]] || { echo "Path not found: $path" >&2; exit 1; }
|
||||
done
|
||||
|
||||
find_args=("${paths[@]}" "(" -type d -name ".*" ! -name "." -prune ")" -o -type f ! -name ".*" "(")
|
||||
first_format=true
|
||||
for format in "${formats[@]}"; do
|
||||
if [[ $first_format == "true" ]]; then
|
||||
first_format=false
|
||||
else
|
||||
find_args+=(-o)
|
||||
fi
|
||||
|
||||
format="${format#.}"
|
||||
find_args+=(-iname "*.$format")
|
||||
done
|
||||
find_args+=(")" -printf '%T@\t%p\n')
|
||||
|
||||
find "${find_args[@]}" 2>/dev/null | sort -rn | cut -f2- |
|
||||
omarchy-launch-walker --dmenu --width 800 --minheight 1 --maxheight 500 -p "$label…" "$@" 2>/dev/null
|
||||
@@ -1,285 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Open a generic image selector menu
|
||||
# omarchy:args=[--selected <image>] [--colors-file <path>] [--print-name] [--show-labels] [--filterable] [--lazy-thumbnails] [--cache-only] <image-dir>...
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
|
||||
selected_image=""
|
||||
colors_file=""
|
||||
print_name=false
|
||||
show_labels=false
|
||||
filterable=false
|
||||
lazy_thumbnails=false
|
||||
prepare_only=false
|
||||
cache_only=false
|
||||
image_dirs=()
|
||||
|
||||
usage() {
|
||||
echo "Usage: omarchy-menu-images [--selected <image>] [--colors-file <path>] [--print-name] [--show-labels] [--filterable] [--lazy-thumbnails] [--cache-only] <image-dir>..."
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--selected)
|
||||
if (( $# < 2 )); then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
selected_image="$2"
|
||||
shift 2
|
||||
;;
|
||||
--colors-file)
|
||||
if (( $# < 2 )); then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
colors_file="$2"
|
||||
shift 2
|
||||
;;
|
||||
--print-name)
|
||||
print_name=true
|
||||
shift
|
||||
;;
|
||||
--show-labels)
|
||||
show_labels=true
|
||||
shift
|
||||
;;
|
||||
--filterable)
|
||||
filterable=true
|
||||
shift
|
||||
;;
|
||||
--lazy-thumbnails)
|
||||
lazy_thumbnails=true
|
||||
shift
|
||||
;;
|
||||
--prepare-only)
|
||||
prepare_only=true
|
||||
shift
|
||||
;;
|
||||
--cache-only)
|
||||
cache_only=true
|
||||
shift
|
||||
;;
|
||||
--help|-h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
image_dirs+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if (( ${#image_dirs[@]} == 0 )); then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
selection_file=$(mktemp)
|
||||
done_file=$(mktemp)
|
||||
rm -f "$done_file"
|
||||
trap 'rm -f "$selection_file" "$done_file"' EXIT
|
||||
socket_path="${XDG_RUNTIME_DIR:-/run/user/$UID}/omarchy-image-selector.sock"
|
||||
selector_qml="$OMARCHY_PATH/default/quickshell/background-switcher.qml"
|
||||
|
||||
image_dirs_env=""
|
||||
for dir in "${image_dirs[@]}"; do
|
||||
if [[ -z $image_dirs_env ]]; then
|
||||
image_dirs_env="$dir"
|
||||
else
|
||||
image_dirs_env+=$'\n'"$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
current_image=$(readlink -f "$selected_image" 2>/dev/null)
|
||||
selected_list_image=""
|
||||
|
||||
if [[ -n $current_image ]]; then
|
||||
for dir in "${image_dirs[@]}"; do
|
||||
if [[ -d $dir && -f $selected_image && ${selected_image%/*} == "$dir" ]]; then
|
||||
selected_list_image="$selected_image"
|
||||
break
|
||||
elif [[ -d $dir ]]; then
|
||||
selected_list_image=$(find -L "$dir" -maxdepth 1 -type f -samefile "$current_image" -print -quit 2>/dev/null)
|
||||
[[ -n $selected_list_image ]] && break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/omarchy/image-selector
|
||||
index_file="$cache_dir/index.tsv"
|
||||
rows=""
|
||||
mkdir -p "$cache_dir"
|
||||
|
||||
cache_key=$(printf '%s' "$image_dirs_env" | md5sum | cut -d ' ' -f 1)
|
||||
rows_cache_file="$cache_dir/$cache_key.rows"
|
||||
rows_signature_file="$cache_dir/$cache_key.signature"
|
||||
rows_signature="v2"$'\n'
|
||||
rows_cacheable=true
|
||||
image_files=()
|
||||
|
||||
for dir in "${image_dirs[@]}"; do
|
||||
if [[ -d $dir ]]; then
|
||||
rows_signature+="$dir:$(stat -Lc '%Y' "$dir")"$'\n'
|
||||
|
||||
while IFS= read -r -d '' image; do
|
||||
image_files+=("$image")
|
||||
image_signature=$(stat -Lc '%s:%Y' "$image") || continue
|
||||
rows_signature+="$image:$image_signature"$'\n'
|
||||
done < <(find -L "$dir" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \) -print0 2>/dev/null | sort -z)
|
||||
fi
|
||||
done
|
||||
|
||||
generate_thumbnail() {
|
||||
local image="$1"
|
||||
local thumbnail="$2"
|
||||
local lock="$thumbnail.lock"
|
||||
local tmp="$thumbnail.$$.jpg"
|
||||
|
||||
if mkdir "$lock" 2>/dev/null; then
|
||||
if magick "${image}[0]" -auto-orient -resize '1536x864^' -gravity center -extent '1536x864' -strip -quality 82 "$tmp"; then
|
||||
mv -f "$tmp" "$thumbnail"
|
||||
else
|
||||
rm -f "$tmp" "$thumbnail"
|
||||
fi
|
||||
|
||||
rmdir "$lock" 2>/dev/null || true
|
||||
else
|
||||
for ((i = 0; i < 3000; i++)); do
|
||||
[[ -f $thumbnail ]] && return
|
||||
[[ -d $lock ]] || break
|
||||
sleep 0.01
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
thumbnail_for() {
|
||||
local image="$1"
|
||||
local signature hash thumbnail
|
||||
|
||||
signature=$(stat -Lc '%s:%Y' "$image") || return
|
||||
hash=$(awk -F '\t' -v path="$image" -v sig="$signature" '$1 == path && $2 == sig { print $3; exit }' "$index_file" 2>/dev/null)
|
||||
|
||||
if [[ -z $hash ]]; then
|
||||
hash=$(printf '%s\t%s' "$image" "$signature" | md5sum | cut -d ' ' -f 1)
|
||||
printf '%s\t%s\t%s\n' "$image" "$signature" "$hash" >>"$index_file"
|
||||
fi
|
||||
|
||||
thumbnail="$cache_dir/$hash.jpg"
|
||||
|
||||
if [[ ! -f $thumbnail ]]; then
|
||||
if [[ $lazy_thumbnails == true && $cache_only != true ]]; then
|
||||
rows_cacheable=false
|
||||
|
||||
if [[ $prepare_only != true ]]; then
|
||||
generate_thumbnail "$image" "$thumbnail" >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
printf '%s' "$image"
|
||||
return
|
||||
fi
|
||||
|
||||
generate_thumbnail "$image" "$thumbnail"
|
||||
fi
|
||||
|
||||
[[ -f $thumbnail ]] && printf '%s' "$thumbnail"
|
||||
}
|
||||
|
||||
if [[ -f $rows_cache_file && -f $rows_signature_file ]] && cmp -s "$rows_signature_file" <(printf '%s' "$rows_signature"); then
|
||||
rows=$(<"$rows_cache_file")
|
||||
else
|
||||
for image in "${image_files[@]}"; do
|
||||
thumbnail=$(thumbnail_for "$image")
|
||||
[[ -n $thumbnail ]] || continue
|
||||
if [[ $lazy_thumbnails == true && $cache_only != true && $thumbnail == "$image" ]]; then
|
||||
rows_cacheable=false
|
||||
fi
|
||||
|
||||
if [[ -z $rows ]]; then
|
||||
rows="$image"$'\t'"$thumbnail"
|
||||
else
|
||||
rows+=$'\n'"$image"$'\t'"$thumbnail"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $rows_cacheable == true ]]; then
|
||||
printf '%s' "$rows" >"$rows_cache_file"
|
||||
printf '%s' "$rows_signature" >"$rows_signature_file"
|
||||
else
|
||||
rm -f "$rows_cache_file" "$rows_signature_file"
|
||||
fi
|
||||
fi
|
||||
|
||||
rows_payload=${rows//$'\t'/$'\f'}
|
||||
rows_payload=${rows_payload//$'\n'/$'\v'}
|
||||
colors_file=${colors_file:-$HOME/.config/omarchy/current/theme/background-switcher-colors.json}
|
||||
colors_payload=""
|
||||
|
||||
if [[ -f $colors_file ]]; then
|
||||
colors_payload=$(<"$colors_file")
|
||||
colors_payload=${colors_payload//$'\t'/$'\f'}
|
||||
colors_payload=${colors_payload//$'\n'/$'\v'}
|
||||
fi
|
||||
|
||||
if [[ $cache_only == true || $prepare_only == true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ensure_selector() {
|
||||
if [[ -S $socket_path && $selector_qml -nt $socket_path ]]; then
|
||||
quickshell kill -p "$selector_qml" >/dev/null 2>&1 || true
|
||||
rm -f "$socket_path"
|
||||
fi
|
||||
|
||||
if [[ ! -S $socket_path ]]; then
|
||||
quickshell kill -p "$selector_qml" >/dev/null 2>&1 || true
|
||||
quickshell -d -p "$selector_qml" >/dev/null
|
||||
|
||||
for ((i = 0; i < 100; i++)); do
|
||||
if [[ -S $socket_path ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.01
|
||||
done
|
||||
fi
|
||||
|
||||
[[ -S $socket_path ]]
|
||||
}
|
||||
|
||||
send_request() {
|
||||
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$rows_payload" "$selected_list_image" "$selection_file" "$done_file" "$colors_payload" "$show_labels" "$filterable" |
|
||||
socat -u - "UNIX-CONNECT:$socket_path"
|
||||
}
|
||||
|
||||
if ! ensure_selector; then
|
||||
echo "Image selector failed to start" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! send_request; then
|
||||
rm -f "$socket_path"
|
||||
|
||||
if ! ensure_selector || ! send_request; then
|
||||
echo "Image selector failed to accept request" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
while [[ ! -e $done_file ]]; do
|
||||
sleep 0.01
|
||||
done
|
||||
|
||||
if [[ -s $selection_file ]]; then
|
||||
if [[ $print_name == true ]]; then
|
||||
selection=$(<"$selection_file")
|
||||
selection=${selection##*/}
|
||||
printf '%s\n' "${selection%.*}"
|
||||
else
|
||||
cat "$selection_file"
|
||||
fi
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Prompt for text input with Walker
|
||||
# omarchy:group=menu
|
||||
# omarchy:name=input
|
||||
# omarchy:args=prompt [walker args...]
|
||||
# omarchy:examples=omarchy menu input Reminder|omarchy-menu-input "Reminder in minutes" --width 400
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
prompt="${1:-Input}"
|
||||
if (( $# > 0 )); then
|
||||
shift
|
||||
fi
|
||||
|
||||
omarchy-launch-walker --dmenu --inputonly --width 295 --minheight 1 --maxheight 1 -p "$prompt…" "$@" 2>/dev/null
|
||||
+39
-219
@@ -3,28 +3,6 @@
|
||||
# omarchy:summary=Display Hyprland keybindings defined in your configuration using walker for an interactive search menu.
|
||||
|
||||
declare -A KEYCODE_SYM_MAP
|
||||
# Hyprland reports XKB keycodes for code: bindings. Keep a small fallback for
|
||||
# common keys so the menu remains readable if xkbcli cannot resolve a symbol.
|
||||
declare -A FALLBACK_KEYCODE_SYM_MAP=(
|
||||
[10]="1"
|
||||
[11]="2"
|
||||
[12]="3"
|
||||
[13]="4"
|
||||
[14]="5"
|
||||
[15]="6"
|
||||
[16]="7"
|
||||
[17]="8"
|
||||
[18]="9"
|
||||
[19]="0"
|
||||
[20]="MINUS"
|
||||
[21]="EQUAL"
|
||||
[61]="SLASH"
|
||||
)
|
||||
|
||||
# Hyprland's Lua config provider currently reports code:... binds from hl.bind()
|
||||
# as key="" and keycode=0 in `hyprctl -j binds`. Keep a lightweight
|
||||
# source-derived key cache so the menu can still show those bindings.
|
||||
declare -A LUA_BIND_KEY_MAP
|
||||
|
||||
build_keymap_cache() {
|
||||
local keymap
|
||||
@@ -59,18 +37,7 @@ build_keymap_cache() {
|
||||
}
|
||||
|
||||
lookup_keycode_cached() {
|
||||
local symbol
|
||||
symbol="${KEYCODE_SYM_MAP[$1]}"
|
||||
|
||||
if [[ -z $symbol ]]; then
|
||||
symbol="${FALLBACK_KEYCODE_SYM_MAP[$1]}"
|
||||
fi
|
||||
|
||||
if [[ -z $symbol ]]; then
|
||||
symbol="code:$1"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${symbol^^}"
|
||||
printf '%s\n' "${KEYCODE_SYM_MAP[$1]}"
|
||||
}
|
||||
|
||||
parse_keycodes() {
|
||||
@@ -113,151 +80,44 @@ parse_keycodes() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Supplement `hyprctl -j binds` for Lua-only binds that Hyprland currently
|
||||
# reports without their original key, such as hl.bind("SUPER + code:10", ...).
|
||||
build_lua_bind_key_cache() {
|
||||
local modmask description key
|
||||
|
||||
omarchy-cmd-present lua || return 0
|
||||
|
||||
while IFS=$'\t' read -r modmask description key; do
|
||||
[[ -z $modmask || -z $description || -z $key ]] && continue
|
||||
LUA_BIND_KEY_MAP["$modmask,$description"]="$key"
|
||||
done < <(
|
||||
lua <<'LUA'
|
||||
local modifiers = { SHIFT = 1, CTRL = 4, CONTROL = 4, ALT = 8, SUPER = 64 }
|
||||
|
||||
local function split_keys(keys)
|
||||
local modmask = 0
|
||||
local key = ""
|
||||
|
||||
for part in string.gmatch(keys, "[^+]+") do
|
||||
local value = part:gsub("^%s+", ""):gsub("%s+$", "")
|
||||
local modifier = modifiers[string.upper(value)]
|
||||
|
||||
if modifier then
|
||||
modmask = modmask + modifier
|
||||
else
|
||||
key = value
|
||||
end
|
||||
end
|
||||
|
||||
return modmask, key
|
||||
end
|
||||
|
||||
local function proxy()
|
||||
local p = {}
|
||||
|
||||
return setmetatable(p, {
|
||||
__index = function()
|
||||
return p
|
||||
end,
|
||||
__call = function()
|
||||
return p
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
local p = proxy()
|
||||
|
||||
hl = setmetatable({
|
||||
dsp = p,
|
||||
bind = function(keys, _, opts)
|
||||
opts = opts or {}
|
||||
if opts.description and opts.description ~= "" then
|
||||
local modmask, key = split_keys(keys)
|
||||
print(modmask .. "\t" .. opts.description .. "\t" .. key)
|
||||
end
|
||||
return p
|
||||
end,
|
||||
unbind = function() end,
|
||||
config = function() end,
|
||||
env = function() end,
|
||||
monitor = function() end,
|
||||
window_rule = function() end,
|
||||
gesture = function() end,
|
||||
animation = function() end,
|
||||
curve = function() end,
|
||||
exec_cmd = function() end,
|
||||
}, {
|
||||
__index = function()
|
||||
return function()
|
||||
return p
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local config = (os.getenv("HOME") or "") .. "/.config/hypr/hyprland.lua"
|
||||
local file = io.open(config, "r")
|
||||
|
||||
if file then
|
||||
file:close()
|
||||
local ok, err = pcall(dofile, config)
|
||||
if not ok and os.getenv("DEBUG") == "1" then
|
||||
io.stderr:write("[DEBUG] lua bind scan failed: " .. tostring(err) .. "\n")
|
||||
end
|
||||
end
|
||||
LUA
|
||||
)
|
||||
}
|
||||
|
||||
modmask_to_text() {
|
||||
case "$1" in
|
||||
0) printf '' ;;
|
||||
1) printf 'SHIFT' ;;
|
||||
4) printf 'CTRL' ;;
|
||||
5) printf 'SHIFT CTRL' ;;
|
||||
8) printf 'ALT' ;;
|
||||
9) printf 'SHIFT ALT' ;;
|
||||
12) printf 'CTRL ALT' ;;
|
||||
13) printf 'SHIFT CTRL ALT' ;;
|
||||
64) printf 'SUPER' ;;
|
||||
65) printf 'SUPER SHIFT' ;;
|
||||
68) printf 'SUPER CTRL' ;;
|
||||
69) printf 'SUPER SHIFT CTRL' ;;
|
||||
72) printf 'SUPER ALT' ;;
|
||||
73) printf 'SUPER SHIFT ALT' ;;
|
||||
76) printf 'SUPER CTRL ALT' ;;
|
||||
77) printf 'SUPER SHIFT CTRL ALT' ;;
|
||||
*) printf '%s' "$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Fetch dynamic keybindings from Hyprland.
|
||||
# Fetch dynamic keybindings from Hyprland
|
||||
#
|
||||
# Also do some pre-processing:
|
||||
# - Fill missing Lua code:... keys from the Lua source cache
|
||||
# - Remove standard Omarchy bin path prefix
|
||||
# - Remove uwsm prefix
|
||||
# - Map numeric modifier key mask to a textual rendition
|
||||
# - Output comma-separated values that the parser can understand
|
||||
dynamic_bindings() {
|
||||
local modmask key keycode description dispatcher arg modifiers
|
||||
|
||||
hyprctl -j binds |
|
||||
jq -r '.[] | [.modmask, (.key // ""), (.keycode // 0), (.description // ""), (.dispatcher // ""), (.arg // "") | tostring] | join("\u001f")' |
|
||||
while IFS=$'\x1f' read -r modmask key keycode description dispatcher arg; do
|
||||
if [[ -z $key && $keycode != "0" ]]; then
|
||||
key="code:$keycode"
|
||||
fi
|
||||
|
||||
if [[ -z $key && -n $description ]]; then
|
||||
key="${LUA_BIND_KEY_MAP["$modmask,$description"]}"
|
||||
fi
|
||||
|
||||
[[ -z $description && $dispatcher == "__lua" ]] && continue
|
||||
|
||||
modifiers=$(modmask_to_text "$modmask")
|
||||
arg="${arg//~\/.local\/share\/omarchy\/bin\//}"
|
||||
arg="${arg//uwsm app -- /}"
|
||||
arg="${arg//uwsm-app -- /}"
|
||||
|
||||
printf '%s,%s,%s,%s,%s\n' "$modifiers" "$key" "$description" "$dispatcher" "$arg"
|
||||
done
|
||||
jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' |
|
||||
sed -r \
|
||||
-e 's/null//' \
|
||||
-e 's,~/.local/share/omarchy/bin/,,' \
|
||||
-e 's,uwsm app -- ,,' \
|
||||
-e 's,uwsm-app -- ,,' \
|
||||
-e 's/@0//' \
|
||||
-e 's/,@/,code:/' \
|
||||
-e 's/^0,/,/' \
|
||||
-e 's/^1,/SHIFT,/' \
|
||||
-e 's/^4,/CTRL,/' \
|
||||
-e 's/^5,/SHIFT CTRL,/' \
|
||||
-e 's/^8,/ALT,/' \
|
||||
-e 's/^9,/SHIFT ALT,/' \
|
||||
-e 's/^12,/CTRL ALT,/' \
|
||||
-e 's/^13,/SHIFT CTRL ALT,/' \
|
||||
-e 's/^64,/SUPER,/' \
|
||||
-e 's/^65,/SUPER SHIFT,/' \
|
||||
-e 's/^68,/SUPER CTRL,/' \
|
||||
-e 's/^69,/SUPER SHIFT CTRL,/' \
|
||||
-e 's/^72,/SUPER ALT,/' \
|
||||
-e 's/^73,/SUPER SHIFT ALT,/' \
|
||||
-e 's/^76,/SUPER CTRL ALT,/' \
|
||||
-e 's/^77,/SUPER SHIFT CTRL ALT,/'
|
||||
}
|
||||
|
||||
# Hardcoded bindings, like the copy-url extension and such
|
||||
static_bindings() {
|
||||
echo "SHIFT ALT,L,Copy URL from Web App,sendshortcut,SHIFT ALT,L,"
|
||||
echo "SHIFT ALT,L,Copy URL from Web App,extension,copy-url"
|
||||
}
|
||||
|
||||
# Parse and format keybindings
|
||||
@@ -266,8 +126,8 @@ static_bindings() {
|
||||
# - Set the field separator to a comma ','.
|
||||
# - Joins the key combination (e.g., "SUPER + Q").
|
||||
# - Joins the command that the key executes.
|
||||
# - Prints display text and dispatch metadata as tab-separated fields.
|
||||
parse_binding_records() {
|
||||
# - Prints everything in a nicely aligned format.
|
||||
parse_bindings() {
|
||||
awk -F, '
|
||||
{
|
||||
# Combine the modifier and key (first two fields)
|
||||
@@ -279,13 +139,6 @@ parse_binding_records() {
|
||||
|
||||
# Use description, if set
|
||||
action = $3;
|
||||
dispatcher = $4;
|
||||
|
||||
# Reconstruct the dispatcher arg from the remaining fields
|
||||
arg = "";
|
||||
for (i = 5; i <= NF; i++) {
|
||||
arg = arg $i (i < NF ? "," : "");
|
||||
}
|
||||
|
||||
if (action == "") {
|
||||
# Reconstruct the command from the remaining fields
|
||||
@@ -296,7 +149,6 @@ parse_binding_records() {
|
||||
# Clean up trailing commas, remove leading "exec, ", and trim
|
||||
sub(/,$/, "", action);
|
||||
gsub(/(^|,)[[:space:]]*exec[[:space:]]*,?/, "", action);
|
||||
gsub(/(^|[[:space:]])uwsm(-app| app)[[:space:]]+--[[:space:]]+/, "", action);
|
||||
gsub(/^[ \t]+|[ \t]+$/, "", action);
|
||||
gsub(/[ \t]+/, " ", key_combo); # Collapse multiple spaces to one
|
||||
|
||||
@@ -309,15 +161,15 @@ parse_binding_records() {
|
||||
}
|
||||
|
||||
if (action != "") {
|
||||
printf "%-35s → %s\t%s\t%s\n", key_combo, action, dispatcher, arg;
|
||||
printf "%-35s → %s\n", key_combo, action;
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
||||
prioritize_entries() {
|
||||
awk -F '\t' '
|
||||
awk '
|
||||
{
|
||||
line = $1
|
||||
line = $0
|
||||
prio = 50
|
||||
if (match(line, /Terminal/)) prio = 0
|
||||
if (match(line, /Tmux/)) prio = 1
|
||||
@@ -368,16 +220,15 @@ prioritize_entries() {
|
||||
if (match(line, /Apple Display/)) prio = 98
|
||||
if (match(line, /XF86/)) prio = 99
|
||||
|
||||
# print "priority<TAB>record"
|
||||
printf "%d\t%s\n", prio, $0
|
||||
# print "priority<TAB>line"
|
||||
printf "%d\t%s\n", prio, line
|
||||
}' |
|
||||
sort -k1,1n -k2,2 |
|
||||
cut -f2-
|
||||
}
|
||||
|
||||
output_binding_records() {
|
||||
output_keybindings() {
|
||||
build_keymap_cache
|
||||
build_lua_bind_key_cache
|
||||
|
||||
{
|
||||
dynamic_bindings
|
||||
@@ -385,47 +236,16 @@ output_binding_records() {
|
||||
} |
|
||||
sort -u |
|
||||
parse_keycodes |
|
||||
parse_binding_records |
|
||||
parse_bindings |
|
||||
prioritize_entries
|
||||
}
|
||||
|
||||
output_keybindings() {
|
||||
output_binding_records | cut -f1
|
||||
}
|
||||
|
||||
dispatch_binding() {
|
||||
local dispatcher="$1"
|
||||
local arg="$2"
|
||||
|
||||
case "$dispatcher" in
|
||||
exec)
|
||||
[[ -n $arg ]] && hyprctl dispatch exec "$arg"
|
||||
;;
|
||||
"") return 1 ;;
|
||||
*)
|
||||
if [[ -n $arg ]]; then
|
||||
hyprctl dispatch "$dispatcher" "$arg"
|
||||
else
|
||||
hyprctl dispatch "$dispatcher"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [[ $1 == "--print" || $1 == "-p" ]]; then
|
||||
output_keybindings
|
||||
else
|
||||
records=$(output_binding_records)
|
||||
monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height')
|
||||
menu_height=$((monitor_height * 40 / 100))
|
||||
selection=$(cut -f1 <<<"$records" |
|
||||
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height")
|
||||
|
||||
if [[ -n $selection ]]; then
|
||||
record=$(awk -F '\t' -v selection="$selection" '$1 == selection { print; exit }' <<<"$records")
|
||||
dispatcher=$(cut -f2 <<<"$record")
|
||||
arg=$(cut -f3- <<<"$record")
|
||||
|
||||
dispatch_binding "$dispatcher" "$arg"
|
||||
fi
|
||||
output_keybindings |
|
||||
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height"
|
||||
fi
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Pick one option with Walker
|
||||
# omarchy:group=menu
|
||||
# omarchy:name=select
|
||||
# omarchy:args=prompt option... [-- walker args...]
|
||||
# omarchy:examples=omarchy menu select Format jpg png|omarchy-menu-select Resolution 4k 1080p 720p -- --width 400
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if (( $# < 2 )); then
|
||||
echo "Usage: omarchy-menu-select <prompt> <option>... [-- walker args...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prompt="$1"
|
||||
shift
|
||||
|
||||
options=()
|
||||
walker_args=()
|
||||
|
||||
while (( $# > 0 )); do
|
||||
if [[ $1 == "--" ]]; then
|
||||
shift
|
||||
walker_args=("$@")
|
||||
break
|
||||
fi
|
||||
|
||||
options+=("$1")
|
||||
shift
|
||||
done
|
||||
|
||||
if (( ${#options[@]} == 0 )); then
|
||||
echo "Usage: omarchy-menu-select <prompt> <option>... [-- walker args...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf '%s\n' "${options[@]}" | omarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 300 -p "$prompt…" "${walker_args[@]}" 2>/dev/null
|
||||
@@ -1,76 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Send a desktop notification with Omarchy glyph and body spacing
|
||||
# omarchy:args=<headline> [description] [-g <glyph>] [-u <low|normal|critical>] [notify-send options]
|
||||
# omarchy:examples=omarchy notification send "Reminder" "5 minutes are up" -g -u critical
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
headline=""
|
||||
description=""
|
||||
glyph=""
|
||||
urgency="low"
|
||||
args=()
|
||||
|
||||
parse_omarchy_option() {
|
||||
case $1 in
|
||||
-g | --glyph)
|
||||
if (($# < 2)); then
|
||||
echo "Missing value for $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
glyph="$2"
|
||||
return 0
|
||||
;;
|
||||
-u | --urgency)
|
||||
if (($# < 2)); then
|
||||
echo "Missing value for $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
urgency="$2"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
if parse_omarchy_option "$@"; then
|
||||
shift 2
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if (($# < 1)); then
|
||||
echo "Usage: omarchy-notification-send [-g <glyph>] [-u <low|normal|critical>] <headline> [description] [notify-send options]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
headline=$1
|
||||
shift
|
||||
|
||||
if (($# > 0)) && [[ $1 != -* ]]; then
|
||||
description=$1
|
||||
shift
|
||||
fi
|
||||
|
||||
while (($# > 0)); do
|
||||
if parse_omarchy_option "$@"; then
|
||||
shift 2
|
||||
else
|
||||
args+=("$1")
|
||||
shift
|
||||
fi
|
||||
done
|
||||
|
||||
summary="$glyph $headline"
|
||||
args+=("-u" "$urgency")
|
||||
|
||||
if [[ -n $description ]]; then
|
||||
description=$(printf '%b' "$description" | sed 's/^/ /')
|
||||
notify-send "${args[@]}" "$summary" "$description"
|
||||
else
|
||||
notify-send "${args[@]}" "$summary"
|
||||
fi
|
||||
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Overwrite all the user Hyprland Lua configs in ~/.config/hypr with the Omarchy defaults.
|
||||
# omarchy:summary=Overwrite all the user configs in ~/.config/hypr with the Omarchy defaults.
|
||||
|
||||
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
|
||||
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
|
||||
bash "$OMARCHY_PATH/install/config/detect-keyboard-layout.sh"
|
||||
|
||||
@@ -19,8 +19,5 @@ echo
|
||||
sudo cp -f "$OMARCHY_PATH/default/pacman/pacman-$channel.conf" /etc/pacman.conf
|
||||
sudo cp -f "$OMARCHY_PATH/default/pacman/mirrorlist-$channel" /etc/pacman.d/mirrorlist
|
||||
|
||||
# Allow user customization of /etc/pacman.conf before the upgrade runs
|
||||
omarchy-hook pre-refresh-pacman
|
||||
|
||||
# Reset all package DBs and then update
|
||||
sudo pacman -Syyuu --noconfirm
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Reinstall the stable Omarchy source directory from git
|
||||
# omarchy:summary=Reinstall the Omarchy source directory from git
|
||||
|
||||
set -e
|
||||
|
||||
# Reinstall the Omarchy configuration directory from the git source.
|
||||
|
||||
git clone "https://github.com/basecamp/omarchy.git" ~/.local/share/omarchy-new >/dev/null
|
||||
git clone --depth=1 "https://github.com/basecamp/omarchy.git" ~/.local/share/omarchy-new >/dev/null
|
||||
mv $OMARCHY_PATH ~/.local/share/omarchy-old
|
||||
mv ~/.local/share/omarchy-new $OMARCHY_PATH
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set and show lightweight desktop notification reminders
|
||||
# omarchy:args=<minutes> [message] | show | clear
|
||||
# omarchy:examples=omarchy reminder 5 | omarchy reminder 30 "Check the oven" | omarchy reminder show | omarchy reminder clear
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
format_remaining() {
|
||||
local seconds=$1
|
||||
local minutes=$((seconds / 60))
|
||||
local remainder=$((seconds % 60))
|
||||
|
||||
if ((minutes > 0 && remainder > 0)); then
|
||||
echo "${minutes}m ${remainder}s"
|
||||
elif ((minutes > 0)); then
|
||||
echo "${minutes}m"
|
||||
else
|
||||
echo "${remainder}s"
|
||||
fi
|
||||
}
|
||||
|
||||
parse_systemd_timespan() {
|
||||
local timespan="$1"
|
||||
local total=0
|
||||
local value unit whole
|
||||
|
||||
while read -r value unit; do
|
||||
whole=${value%.*}
|
||||
|
||||
case $unit in
|
||||
d) total=$((total + whole * 86400)) ;;
|
||||
h) total=$((total + whole * 3600)) ;;
|
||||
min) total=$((total + whole * 60)) ;;
|
||||
s) total=$((total + whole)) ;;
|
||||
ms | us) ;;
|
||||
esac
|
||||
done < <(grep -oE '[0-9]+([.][0-9]+)?(d|h|min|s|ms|us)' <<<"$timespan" | sed -E 's/^([0-9.]+)([a-z]+)$/\1 \2/')
|
||||
|
||||
echo "$total"
|
||||
}
|
||||
|
||||
show_reminders() {
|
||||
local timer next remaining body=""
|
||||
local reminder_dir="${XDG_RUNTIME_DIR:-/tmp}/omarchy-reminders"
|
||||
local reminder_message=""
|
||||
local now=$(date +%s)
|
||||
|
||||
while IFS=$'\t' read -r timer next; do
|
||||
[[ -z $timer || -z $next ]] && continue
|
||||
|
||||
next=$((next / 1000000))
|
||||
((next <= now)) && continue
|
||||
|
||||
remaining=$((next - now))
|
||||
reminder=${timer%.timer}
|
||||
reminder=${reminder#omarchy-reminder-}
|
||||
set_at=${reminder##*-}
|
||||
reminder_minutes=${reminder%%m-*}
|
||||
reminder_message=""
|
||||
[[ -f $reminder_dir/${timer%.timer}.message ]] && reminder_message=$(<"$reminder_dir/${timer%.timer}.message")
|
||||
|
||||
if [[ -n $reminder_message ]]; then
|
||||
body+="$reminder_message in $(format_remaining $remaining) ($(date -d "@$next" +%-H:%M))"$'\n'
|
||||
else
|
||||
body+="${reminder_minutes}-min reminder in $(format_remaining $remaining) ($(date -d "@$next" +%-H:%M))"$'\n'
|
||||
fi
|
||||
done < <(systemctl --user list-timers --all --output=json "omarchy-reminder-*.timer" 2>/dev/null | jq -r '.[] | [.unit, .next] | @tsv')
|
||||
|
||||
if [[ -z $body ]]; then
|
||||
omarchy-notification-send -g "Upcoming reminders" "No outstanding reminders"
|
||||
else
|
||||
omarchy-notification-send -g "Upcoming reminders" "${body%$'\n'}"
|
||||
fi
|
||||
}
|
||||
|
||||
clear_reminders() {
|
||||
local units
|
||||
local reminder_dir="${XDG_RUNTIME_DIR:-/tmp}/omarchy-reminders"
|
||||
|
||||
units=$(systemctl --user list-timers --all --no-legend --no-pager "omarchy-reminder-*.timer" 2>/dev/null | awk '{ print $(NF - 1), $NF }')
|
||||
|
||||
if [[ -n $units ]]; then
|
||||
xargs -r systemctl --user stop <<<"$units" || true
|
||||
fi
|
||||
|
||||
rm -f "$reminder_dir"/omarchy-reminder-*.message 2>/dev/null || true
|
||||
omarchy-notification-send -g "All reminders have been cleared"
|
||||
}
|
||||
|
||||
case ${1:-} in
|
||||
show | list)
|
||||
show_reminders
|
||||
exit 0
|
||||
;;
|
||||
clear)
|
||||
clear_reminders
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
minutes=${1:-}
|
||||
shift || true
|
||||
message="$*"
|
||||
custom_message="$message"
|
||||
|
||||
if [[ -z $minutes ]] || [[ ! $minutes =~ ^[0-9]+$ ]] || ((minutes == 0)); then
|
||||
echo "Usage: omarchy-reminder <minutes> [message]"
|
||||
echo " omarchy-reminder show"
|
||||
echo " omarchy-reminder clear"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $message ]]; then
|
||||
message="Your ${minutes} minutes are up"
|
||||
fi
|
||||
|
||||
set_at=$(date +%s)
|
||||
remind_at=$(date -d "+${minutes} minutes" +%H:%M)
|
||||
unit="omarchy-reminder-${minutes}m-$set_at"
|
||||
reminder_dir="${XDG_RUNTIME_DIR:-/tmp}/omarchy-reminders"
|
||||
message_file="$reminder_dir/$unit.message"
|
||||
confirmation="You'll be reminded at $remind_at"
|
||||
confirmation_title="Reminder set for ${minutes} minutes"
|
||||
|
||||
mkdir -p "$reminder_dir"
|
||||
|
||||
if [[ -n $custom_message ]]; then
|
||||
printf "%s" "$custom_message" >"$message_file"
|
||||
confirmation_title="$custom_message in ${minutes} minutes"
|
||||
fi
|
||||
|
||||
systemd-run --user --quiet --collect --on-active="${minutes}m" --unit="$unit" \
|
||||
bash -c 'omarchy-notification-send -g "Reminder" "$1" -u critical; rm -f "$2"' bash "$message" "$message_file"
|
||||
|
||||
omarchy-notification-send -g "$confirmation_title" "$confirmation"
|
||||
@@ -21,10 +21,7 @@ omarchy-pkg-drop \
|
||||
libretro-parallel-n64 libretro-picodrive libretro-play libretro-ppsspp \
|
||||
libretro-sameboy libretro-scummvm libretro-shaders-slang libretro-snes9x \
|
||||
libretro-yabause \
|
||||
libretro-cap32-git libretro-fbneo-git libretro-uae-git \
|
||||
libretro-vice-x128-git libretro-vice-x64-git libretro-vice-x64dtv-git libretro-vice-x64sc-git \
|
||||
libretro-vice-xcbm2-git libretro-vice-xcbm5x0-git libretro-vice-xpet-git \
|
||||
libretro-vice-xplus4-git libretro-vice-xscpu64-git libretro-vice-xvic-git \
|
||||
libretro-cap32-git libretro-fbneo-git libretro-uae-git libretro-vice-git \
|
||||
retroarch-joypad-autoconfig-git
|
||||
|
||||
rm -rf \
|
||||
|
||||
@@ -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
|
||||
|
||||
[[ -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
|
||||
cp ~/.config/hypr/bindings.conf ~/.config/hypr/bindings.conf.bak
|
||||
cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf
|
||||
hyprctl reload
|
||||
|
||||
# Remove npx stubs
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Remove FIDO2 authentication from sudo and polkit
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
remove_pam_config() {
|
||||
# Remove from sudo
|
||||
if grep -q pam_u2f.so /etc/pam.d/sudo; then
|
||||
echo "Removing FIDO2 authentication from sudo..."
|
||||
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Remove from polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
echo "Removing FIDO2 authentication from polkit..."
|
||||
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\e[32mRemoving FIDO2 device from authentication.\n\e[0m"
|
||||
|
||||
remove_pam_config
|
||||
|
||||
if [[ -d /etc/fido2 ]]; then
|
||||
echo "Removing FIDO2 configuration..."
|
||||
sudo rm -rf /etc/fido2
|
||||
fi
|
||||
|
||||
echo "Removing FIDO2 packages..."
|
||||
omarchy-pkg-drop libfido2 pam-u2f
|
||||
|
||||
echo -e "\e[32mFIDO2 authentication has been completely removed.\e[0m"
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Remove fingerprint authentication from sudo, polkit, and lock screen
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
remove_pam_config() {
|
||||
# Remove from sudo
|
||||
if grep -q pam_fprintd.so /etc/pam.d/sudo; then
|
||||
echo "Removing fingerprint authentication from sudo..."
|
||||
sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Remove from polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
echo "Removing fingerprint authentication from polkit..."
|
||||
sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/polkit-1
|
||||
fi
|
||||
}
|
||||
|
||||
remove_hyprlock_fingerprint_icon() {
|
||||
echo "Removing fingerprint icon from hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
|
||||
}
|
||||
|
||||
echo -e "\e[32mRemoving fingerprint scanner from authentication.\n\e[0m"
|
||||
|
||||
remove_pam_config
|
||||
remove_hyprlock_fingerprint_icon
|
||||
|
||||
echo "Removing fingerprint packages..."
|
||||
omarchy-pkg-drop fprintd libfprint-git
|
||||
|
||||
echo -e "\e[32mFingerprint authentication has been completely removed.\e[0m"
|
||||
@@ -2,9 +2,5 @@
|
||||
|
||||
# omarchy:summary=Restart the PipeWire audio service to fix audio issues or apply new configuration.
|
||||
|
||||
echo -e "Restarting PipeWire audio services...\n"
|
||||
systemctl --user restart wireplumber.service pipewire.service
|
||||
|
||||
if systemctl --user --quiet is-active pipewire-pulse.service; then
|
||||
systemctl --user restart pipewire-pulse.service
|
||||
fi
|
||||
echo -e "Restarting pipewire audio service...\n"
|
||||
systemctl --user restart pipewire.service
|
||||
|
||||
@@ -2,8 +2,4 @@
|
||||
|
||||
# omarchy:summary=Restart the SwayOSD server
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user stop swayosd-server.service || true
|
||||
pkill -x swayosd-server || true
|
||||
systemctl --user reset-failed swayosd-server.service || true
|
||||
systemctl --user enable --now swayosd-server.service
|
||||
omarchy-restart-app swayosd-server
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
# omarchy:summary=Restart Waybar
|
||||
# omarchy:examples=omarchy restart waybar
|
||||
|
||||
pkill -9 -x waybar
|
||||
setsid uwsm-app -- waybar >/dev/null 2>&1 &
|
||||
omarchy-restart-app waybar
|
||||
|
||||
@@ -7,7 +7,7 @@ screensaver_in_focus() {
|
||||
}
|
||||
|
||||
exit_screensaver() {
|
||||
hyprctl eval 'hl.config({ cursor = { invisible = false } })' &>/dev/null || hyprctl keyword cursor:invisible false &>/dev/null || true
|
||||
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 eval 'hl.config({ cursor = { invisible = true } })' &>/dev/null || hyprctl keyword cursor:invisible true &>/dev/null
|
||||
hyprctl keyword cursor:invisible true &>/dev/null
|
||||
|
||||
tty=$(tty 2>/dev/null)
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Transcode an image into ASCII/Unicode art text
|
||||
# omarchy:group=transcode
|
||||
# omarchy:name=ascii
|
||||
# omarchy:args=<input-image.svg|png> <output-path> [--width <columns>] [--height <rows>] [--mode <braille|block>] [--threshold <percent>] [--invert]
|
||||
# omarchy:examples=omarchy transcode ascii ~/logo.svg /tmp/logo.txt | omarchy transcode ascii ~/logo.png ~/.config/omarchy/branding/screensaver.txt --width 80
|
||||
# omarchy:summary=Set the screensaver logo text from an SVG/PNG or the default
|
||||
# omarchy:args=<default|path-to-logo.svg|png> [--width <columns>] [--height <rows>] [--mode <braille|block>] [--threshold <percent>] [--invert] [--stdout]
|
||||
# omarchy:examples=omarchy screensaver logo ~/logo.svg | omarchy screensaver logo default | omarchy screensaver logo ~/logo.png --width 80 --mode block --stdout
|
||||
|
||||
set -o pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: omarchy-transcode-ascii <input-image.svg|png> <output-path> [options]
|
||||
Usage: omarchy-screensaver-logo <default|path-to-logo.svg|png> [options]
|
||||
|
||||
Transcodes an image into ASCII/Unicode art text.
|
||||
Sets the screensaver logo text from an image.
|
||||
Pass "default" instead of an image path to restore the Omarchy default.
|
||||
By default, writes to ~/.config/omarchy/branding/screensaver.txt.
|
||||
|
||||
Options:
|
||||
-w, --width <columns> Maximum output width in terminal columns (default: 80)
|
||||
@@ -21,6 +21,7 @@ Options:
|
||||
-t, --threshold <percent> Pixel threshold from 0-100 (default: 50)
|
||||
--invert Treat light pixels as the logo instead of dark pixels
|
||||
--no-trim Preserve surrounding whitespace/background
|
||||
--stdout Print converted text instead of writing the screensaver file
|
||||
--help Show this help
|
||||
EOF
|
||||
}
|
||||
@@ -31,8 +32,9 @@ mode=braille
|
||||
threshold=50
|
||||
invert=false
|
||||
trim=true
|
||||
output_path="$HOME/.config/omarchy/branding/screensaver.txt"
|
||||
image_path=""
|
||||
output_path=""
|
||||
reset_default=false
|
||||
|
||||
while (($# > 0)); do
|
||||
case "$1" in
|
||||
@@ -96,6 +98,9 @@ while (($# > 0)); do
|
||||
--no-trim)
|
||||
trim=false
|
||||
;;
|
||||
--stdout)
|
||||
output_path="-"
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
@@ -106,10 +111,10 @@ while (($# > 0)); do
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
if [[ -z $image_path ]]; then
|
||||
if [[ $1 == "default" && -z $image_path ]]; then
|
||||
reset_default=true
|
||||
elif [[ -z $image_path ]]; then
|
||||
image_path="$1"
|
||||
elif [[ -z $output_path ]]; then
|
||||
output_path="$1"
|
||||
else
|
||||
echo "Unexpected argument: $1" >&2
|
||||
usage >&2
|
||||
@@ -122,10 +127,10 @@ done
|
||||
|
||||
if (($# > 0)); then
|
||||
while (($# > 0)); do
|
||||
if [[ -z $image_path ]]; then
|
||||
if [[ $1 == "default" && -z $image_path ]]; then
|
||||
reset_default=true
|
||||
elif [[ -z $image_path ]]; then
|
||||
image_path="$1"
|
||||
elif [[ -z $output_path ]]; then
|
||||
output_path="$1"
|
||||
else
|
||||
echo "Unexpected argument: $1" >&2
|
||||
usage >&2
|
||||
@@ -135,7 +140,29 @@ if (($# > 0)); then
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -z $image_path || -z $output_path ]]; then
|
||||
if [[ $reset_default == "true" ]]; then
|
||||
if [[ -n $image_path ]]; then
|
||||
echo "default does not accept an image path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
default_path="${OMARCHY_PATH:-$HOME/.local/share/omarchy}/logo.txt"
|
||||
if [[ ! -f $default_path ]]; then
|
||||
echo "Default screensaver logo text not found: $default_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $output_path == "-" ]]; then
|
||||
cat "$default_path"
|
||||
else
|
||||
mkdir -p "$(dirname "$output_path")"
|
||||
cp "$default_path" "$output_path"
|
||||
echo "Restored default screensaver logo text to $output_path"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z $image_path ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -348,6 +375,10 @@ if [[ ! -s $tmp_output ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$output_path")"
|
||||
cp "$tmp_output" "$output_path"
|
||||
echo "Wrote ASCII art to $output_path"
|
||||
if [[ $output_path == "-" ]]; then
|
||||
cat "$tmp_output"
|
||||
else
|
||||
mkdir -p "$(dirname "$output_path")"
|
||||
cp "$tmp_output" "$output_path"
|
||||
echo "Wrote screensaver logo text to $output_path"
|
||||
fi
|
||||
Executable
+131
@@ -0,0 +1,131 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set up or remove FIDO2 authentication for sudo and polkit
|
||||
# omarchy:args=[--remove]
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}$1${NC}"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}$1${NC}"
|
||||
}
|
||||
|
||||
print_info() {
|
||||
echo -e "${YELLOW}$1${NC}"
|
||||
}
|
||||
|
||||
check_fido2_hardware() {
|
||||
tokens=$(fido2-token -L 2>/dev/null)
|
||||
if [[ -z $tokens ]]; then
|
||||
print_error "\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well)."
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_pam_config() {
|
||||
# Configure sudo
|
||||
if ! grep -q pam_u2f.so /etc/pam.d/sudo; then
|
||||
print_info "Configuring sudo for FIDO2 authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Configure polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
print_info "Configuring polkit for FIDO2 authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1
|
||||
elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
|
||||
print_info "Creating polkit configuration with FIDO2 authentication..."
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
auth required pam_unix.so
|
||||
|
||||
account required pam_unix.so
|
||||
password required pam_unix.so
|
||||
session required pam_unix.so
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
remove_pam_config() {
|
||||
# Remove from sudo
|
||||
if grep -q pam_u2f.so /etc/pam.d/sudo; then
|
||||
print_info "Removing FIDO2 authentication from sudo..."
|
||||
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Remove from polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
print_info "Removing FIDO2 authentication from polkit..."
|
||||
sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "--remove" == $1 ]]; then
|
||||
print_success "Removing FIDO2 device from authentication.\n"
|
||||
|
||||
# Remove PAM configuration
|
||||
remove_pam_config
|
||||
|
||||
# Remove FIDO2 configuration
|
||||
if [[ -d /etc/fido2 ]]; then
|
||||
print_info "Removing FIDO2 configuration..."
|
||||
sudo rm -rf /etc/fido2
|
||||
fi
|
||||
|
||||
# Uninstall packages
|
||||
print_info "Removing FIDO2 packages..."
|
||||
sudo pacman -Rns --noconfirm libfido2 pam-u2f
|
||||
|
||||
print_success "FIDO2 authentication has been completely removed."
|
||||
else
|
||||
print_success "Setting up FIDO2 device for authentication.\n"
|
||||
|
||||
# Install required packages
|
||||
print_info "Installing required packages..."
|
||||
omarchy-pkg-add libfido2 pam-u2f
|
||||
|
||||
if ! check_fido2_hardware; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the pamu2fcfg file
|
||||
if [[ ! -f /etc/fido2/fido2 ]]; then
|
||||
sudo mkdir -p /etc/fido2
|
||||
print_success "\nLet's setup your device by confirming on the device now."
|
||||
print_info "Touch your FIDO2 key when it lights up...\n"
|
||||
|
||||
if pamu2fcfg >/tmp/fido2; then
|
||||
sudo mv /tmp/fido2 /etc/fido2/fido2
|
||||
print_success "FIDO2 device registered successfully!"
|
||||
else
|
||||
print_error "\nFIDO2 registration failed. Please try again."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
print_info "FIDO2 device already registered."
|
||||
fi
|
||||
|
||||
# Configure PAM
|
||||
setup_pam_config
|
||||
|
||||
# Test with sudo
|
||||
print_info "\nTesting FIDO2 authentication with sudo..."
|
||||
print_info "Touch your FIDO2 key when prompted.\n"
|
||||
|
||||
if sudo echo "FIDO2 authentication test successful"; then
|
||||
print_success "\nPerfect! FIDO2 authentication is now configured."
|
||||
print_info "You can use your FIDO2 key for sudo and polkit authentication."
|
||||
else
|
||||
print_error "\nVerification failed. You may want to check your configuration."
|
||||
fi
|
||||
fi
|
||||
Executable
+161
@@ -0,0 +1,161 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set up or remove fingerprint authentication for sudo, polkit, and lock screen
|
||||
# omarchy:args=[--remove]
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}$1${NC}"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}$1${NC}"
|
||||
}
|
||||
|
||||
print_info() {
|
||||
echo -e "${YELLOW}$1${NC}"
|
||||
}
|
||||
|
||||
check_fingerprint_hardware() {
|
||||
# Get fingerprint devices for the user
|
||||
devices=$(fprintd-list "$USER" 2>/dev/null)
|
||||
|
||||
# Exit if no devices found
|
||||
if [[ -z $devices ]]; then
|
||||
print_error "\nNo fingerprint sensor detected."
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_pam_config() {
|
||||
# Configure sudo
|
||||
if ! grep -q pam_fprintd.so /etc/pam.d/sudo; then
|
||||
print_info "Configuring sudo for fingerprint authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Configure polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
print_info "Configuring polkit for fingerprint authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/polkit-1
|
||||
elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
|
||||
print_info "Creating polkit configuration with fingerprint authentication..."
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_fprintd.so
|
||||
auth required pam_unix.so
|
||||
|
||||
account required pam_unix.so
|
||||
password required pam_unix.so
|
||||
session required pam_unix.so
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
add_hyprlock_fingerprint_icon() {
|
||||
print_info "Adding fingerprint icon to hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = <span> Enter Password <\/span>/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf
|
||||
}
|
||||
|
||||
remove_hyprlock_fingerprint_icon() {
|
||||
print_info "Removing fingerprint icon from hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
|
||||
}
|
||||
|
||||
remove_pam_config() {
|
||||
# Remove from sudo
|
||||
if grep -q pam_fprintd.so /etc/pam.d/sudo; then
|
||||
print_info "Removing fingerprint authentication from sudo..."
|
||||
sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Remove from polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
print_info "Removing fingerprint authentication from polkit..."
|
||||
sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/polkit-1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "--remove" == $1 ]]; then
|
||||
print_success "Removing fingerprint scanner from authentication.\n"
|
||||
|
||||
# Remove PAM configuration
|
||||
remove_pam_config
|
||||
|
||||
# Remove fingerprint icon from hyprlock placeholder text
|
||||
remove_hyprlock_fingerprint_icon
|
||||
|
||||
# Uninstall packages
|
||||
print_info "Removing fingerprint packages..."
|
||||
sudo pacman -Rns --noconfirm fprintd
|
||||
|
||||
print_success "Fingerprint authentication has been completely removed."
|
||||
else
|
||||
print_success "Setting up fingerprint scanner for authentication.\n"
|
||||
|
||||
# Install required packages
|
||||
print_info "Installing required packages..."
|
||||
|
||||
# ASUS ExpertBook B9406CAA ships a FocalTech FT9349 ESS reader (USB
|
||||
# 2808:a97a). Mainline libfprint at 1.94.x lacks the focaltech_moc
|
||||
# driver (and its 0xa97a id_table entry); OPR ships libfprint-git
|
||||
# which carries both. Once upstream catches up, this branch is a
|
||||
# no-op and `libfprint-git` provides=libfprint anyway. Detect via
|
||||
# /sys to avoid depending on usbutils being installed first.
|
||||
for v in /sys/bus/usb/devices/*/idVendor; do
|
||||
[[ "$(cat "$v" 2>/dev/null)" == "2808" ]] || continue
|
||||
[[ "$(cat "${v%idVendor}idProduct" 2>/dev/null)" == "a97a" ]] || continue
|
||||
print_info "FocalTech FT9349 detected (B9406CAA) — using libfprint-git from OPR..."
|
||||
# libfprint-git provides+conflicts libfprint; pacman -S --noconfirm
|
||||
# defaults the conflict prompt to N and aborts. Pre-remove libfprint
|
||||
# with -Rdd so the install goes silent. -Rdd (not omarchy-pkg-drop's
|
||||
# -Rns) is required because fprintd requires libfprint; the dep is
|
||||
# re-satisfied immediately by libfprint-git's provides=libfprint.
|
||||
if omarchy-pkg-present libfprint; then
|
||||
sudo pacman -Rdd --noconfirm libfprint
|
||||
fi
|
||||
omarchy-pkg-add libfprint-git
|
||||
break
|
||||
done
|
||||
|
||||
omarchy-pkg-add fprintd usbutils
|
||||
|
||||
if ! check_fingerprint_hardware; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configure PAM
|
||||
setup_pam_config
|
||||
|
||||
# Add fingerprint icon to hyprlock placeholder text
|
||||
add_hyprlock_fingerprint_icon
|
||||
|
||||
# Enroll first fingerprint
|
||||
print_success "\nLet's setup your right index finger as the first fingerprint."
|
||||
print_info "Keep moving the finger around on sensor until the process completes.\n"
|
||||
|
||||
if sudo fprintd-enroll "$USER"; then
|
||||
print_success "\nFingerprint enrolled successfully!"
|
||||
|
||||
# Verify
|
||||
print_info "\nNow let's verify that it's working correctly.\n"
|
||||
if fprintd-verify; then
|
||||
print_success "\nPerfect! Fingerprint authentication is now configured."
|
||||
print_info "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)."
|
||||
else
|
||||
print_error "\nVerification failed. You may want to try enrolling again."
|
||||
fi
|
||||
else
|
||||
print_error "\nEnrollment failed. Please try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set up FIDO2 authentication for sudo and polkit
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
check_fido2_hardware() {
|
||||
tokens=$(fido2-token -L 2>/dev/null)
|
||||
if [[ -z $tokens ]]; then
|
||||
echo -e "\e[31m\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well).\e[0m"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_pam_config() {
|
||||
# Configure sudo
|
||||
if ! grep -q pam_u2f.so /etc/pam.d/sudo; then
|
||||
echo "Configuring sudo for FIDO2 authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Configure polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
echo "Configuring polkit for FIDO2 authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1
|
||||
elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
|
||||
echo "Creating polkit configuration with FIDO2 authentication..."
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
auth required pam_unix.so
|
||||
|
||||
account required pam_unix.so
|
||||
password required pam_unix.so
|
||||
session required pam_unix.so
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\e[32mSetting up FIDO2 device for authentication.\n\e[0m"
|
||||
|
||||
# Install required packages
|
||||
echo "Installing required packages..."
|
||||
omarchy-pkg-add libfido2 pam-u2f
|
||||
|
||||
if ! check_fido2_hardware; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the pamu2fcfg file
|
||||
if [[ ! -f /etc/fido2/fido2 ]]; then
|
||||
sudo mkdir -p /etc/fido2
|
||||
echo -e "\e[32m\nLet's setup your device by confirming on the device now.\e[0m"
|
||||
echo -e "Touch your FIDO2 key when it lights up...\n"
|
||||
|
||||
if pamu2fcfg >/tmp/fido2; then
|
||||
sudo mv /tmp/fido2 /etc/fido2/fido2
|
||||
echo -e "\e[32mFIDO2 device registered successfully!\e[0m"
|
||||
else
|
||||
echo -e "\e[31m\nFIDO2 registration failed. Please try again.\e[0m"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "FIDO2 device already registered."
|
||||
fi
|
||||
|
||||
# Configure PAM
|
||||
setup_pam_config
|
||||
|
||||
# Test with sudo
|
||||
echo -e "\nTesting FIDO2 authentication with sudo..."
|
||||
echo -e "Touch your FIDO2 key when prompted.\n"
|
||||
|
||||
if sudo echo "FIDO2 authentication test successful"; then
|
||||
echo -e "\e[32m\nPerfect! FIDO2 authentication is now configured.\e[0m"
|
||||
echo "You can use your FIDO2 key for sudo and polkit authentication."
|
||||
else
|
||||
echo -e "\e[31m\nVerification failed. You may want to check your configuration.\e[0m"
|
||||
fi
|
||||
@@ -1,95 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set up fingerprint authentication for sudo, polkit, and lock screen
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
check_fingerprint_hardware() {
|
||||
# Get fingerprint devices for the user
|
||||
devices=$(fprintd-list "$USER" 2>/dev/null)
|
||||
|
||||
# Exit if no devices found
|
||||
if [[ -z $devices ]]; then
|
||||
echo -e "\e[31m\nNo fingerprint sensor detected.\e[0m"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_pam_config() {
|
||||
# Configure sudo
|
||||
if ! grep -q pam_fprintd.so /etc/pam.d/sudo; then
|
||||
echo "Configuring sudo for fingerprint authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/sudo
|
||||
fi
|
||||
|
||||
# Configure polkit
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
echo "Configuring polkit for fingerprint authentication..."
|
||||
sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/polkit-1
|
||||
elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
|
||||
echo "Creating polkit configuration with fingerprint authentication..."
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_fprintd.so
|
||||
auth required pam_unix.so
|
||||
|
||||
account required pam_unix.so
|
||||
password required pam_unix.so
|
||||
session required pam_unix.so
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
add_hyprlock_fingerprint_icon() {
|
||||
echo "Adding fingerprint icon to hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = <span> Enter Password <\/span>/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf
|
||||
}
|
||||
|
||||
echo -e "\e[32mSetting up fingerprint scanner for authentication.\n\e[0m"
|
||||
|
||||
# Install required packages
|
||||
echo "Installing required packages..."
|
||||
|
||||
# libfprint-git provides+conflicts libfprint; pacman -S --noconfirm
|
||||
# defaults the conflict prompt to N and aborts. Pre-remove libfprint
|
||||
# with -Rdd so the install goes silent. -Rdd (not omarchy-pkg-drop's
|
||||
# -Rns) is required because fprintd requires libfprint; the dep is
|
||||
# re-satisfied immediately by libfprint-git's provides=libfprint.
|
||||
if omarchy-pkg-present libfprint; then
|
||||
sudo pacman -Rdd --noconfirm libfprint
|
||||
fi
|
||||
|
||||
omarchy-pkg-add libfprint-git fprintd usbutils
|
||||
|
||||
if ! check_fingerprint_hardware; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configure PAM
|
||||
setup_pam_config
|
||||
|
||||
# Add fingerprint icon to hyprlock placeholder text
|
||||
add_hyprlock_fingerprint_icon
|
||||
|
||||
# Enroll first fingerprint
|
||||
echo -e "\e[32m\nLet's setup your right index finger as the first fingerprint.\e[0m"
|
||||
echo -e "Keep moving the finger around on sensor until the process completes.\n"
|
||||
|
||||
if sudo fprintd-enroll "$USER"; then
|
||||
echo -e "\e[32m\nFingerprint enrolled successfully!\e[0m"
|
||||
|
||||
# Verify
|
||||
echo -e "\nNow let's verify that it's working correctly.\n"
|
||||
if fprintd-verify; then
|
||||
echo -e "\e[32m\nPerfect! Fingerprint authentication is now configured.\e[0m"
|
||||
echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)."
|
||||
else
|
||||
echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m"
|
||||
fi
|
||||
else
|
||||
echo -e "\e[31m\nEnrollment failed. Please try again.\e[0m"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set Hyprland, Hyprlock, Mako, and Walker corners to sharp or round
|
||||
# omarchy:args=<sharp|round>
|
||||
# omarchy:examples=omarchy style corners round | omarchy style corners sharp
|
||||
|
||||
if [[ $1 != "sharp" && $1 != "round" ]]; then
|
||||
echo "Usage: omarchy-style-corners <sharp|round>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
omarchy-style-corners-hyprland "$1"
|
||||
omarchy-style-corners-hyprlock "$1"
|
||||
omarchy-style-corners-mako "$1"
|
||||
omarchy-style-corners-walker "$1"
|
||||
|
||||
case $1 in
|
||||
sharp) omarchy-notification-send "Sharp corners enabled" -g ;;
|
||||
round) omarchy-notification-send "Round corners enabled" -g ;;
|
||||
esac
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set or toggle shape of Hyprland window corners
|
||||
# omarchy:args=[toggle|sharp|round]
|
||||
# omarchy:examples=omarchy style corners hyprland toggle | omarchy style corners hyprland round | omarchy style corners hyprland sharp
|
||||
|
||||
case "${1:-toggle}" in
|
||||
round) set -- on ;;
|
||||
sharp) set -- off ;;
|
||||
toggle) ;;
|
||||
*)
|
||||
echo "Usage: omarchy-style-corners-hyprland [toggle|sharp|round]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
omarchy-hyprland-toggle rounded-corners "$1"
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set or toggle rounded Hyprlock input field corners
|
||||
# omarchy:args=[toggle|sharp|round]
|
||||
# omarchy:examples=omarchy style corners hyprlock toggle | omarchy style corners hyprlock round | omarchy style corners hyprlock sharp
|
||||
|
||||
TOGGLES_CONFIG="$HOME/.local/state/omarchy/toggles/hyprlock.conf"
|
||||
|
||||
set_rounding() {
|
||||
local radius="$1"
|
||||
|
||||
mkdir -p "$(dirname "$TOGGLES_CONFIG")"
|
||||
|
||||
cat >"$TOGGLES_CONFIG" <<EOF
|
||||
input-field {
|
||||
rounding = $radius
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
round) set_rounding 6 ;;
|
||||
sharp) set_rounding 0 ;;
|
||||
toggle)
|
||||
if [[ -f $TOGGLES_CONFIG ]] && grep -q '^ rounding = 6$' "$TOGGLES_CONFIG"; then
|
||||
set_rounding 0
|
||||
else
|
||||
set_rounding 6
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy-style-corners-hyprlock [toggle|sharp|round]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set or toggle rounded Walker corners
|
||||
# omarchy:args=[toggle|sharp|round]
|
||||
# omarchy:examples=omarchy style corners walker toggle | omarchy style corners walker round | omarchy style corners walker sharp
|
||||
|
||||
TOGGLES_CSS="$HOME/.local/state/omarchy/toggles/walker.css"
|
||||
|
||||
set_radius() {
|
||||
local radius="$1"
|
||||
|
||||
mkdir -p "$(dirname "$TOGGLES_CSS")"
|
||||
touch "$TOGGLES_CSS"
|
||||
|
||||
if grep -q '^ border-radius:' "$TOGGLES_CSS"; then
|
||||
sed -i "s/^ border-radius:.*/ border-radius: ${radius}px;/" "$TOGGLES_CSS"
|
||||
elif grep -q '^border-radius:' "$TOGGLES_CSS"; then
|
||||
sed -i "s/^border-radius:.*/border-radius: ${radius}px;/" "$TOGGLES_CSS"
|
||||
else
|
||||
echo ".box-wrapper { border-radius: ${radius}px; }" >>"$TOGGLES_CSS"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
round) set_radius 6 ;;
|
||||
sharp) set_radius 0 ;;
|
||||
toggle)
|
||||
if [[ -f $TOGGLES_CSS ]] && grep -q 'border-radius: 6px;' "$TOGGLES_CSS"; then
|
||||
set_radius 0
|
||||
else
|
||||
set_radius 6
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy-style-corners-walker [toggle|sharp|round]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
omarchy-restart-walker
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set Waybar position
|
||||
# omarchy:args=<top|bottom|left|right>
|
||||
# omarchy:examples=omarchy-style-waybar-position top | omarchy style waybar-position bottom
|
||||
|
||||
set -e
|
||||
|
||||
WAYBAR_CONFIG="$HOME/.config/waybar/config.jsonc"
|
||||
|
||||
position=$1
|
||||
|
||||
if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then
|
||||
echo "Usage: omarchy-style-waybar-position top|bottom|left|right" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Reset config and styles before making adjustments
|
||||
omarchy-refresh-config waybar/config.jsonc
|
||||
omarchy-refresh-config waybar/style.css
|
||||
|
||||
if [[ $position == "left" || $position == "right" ]]; then
|
||||
height=0
|
||||
width=28
|
||||
horizontal=false
|
||||
else
|
||||
height=26
|
||||
width=0
|
||||
horizontal=true
|
||||
fi
|
||||
|
||||
# Change position
|
||||
sed -i -E "s/(\"position\"[[:space:]]*:[[:space:]]*\")[a-z]+(\")/\\1${position}\\2/" "$WAYBAR_CONFIG"
|
||||
|
||||
# Change height/width
|
||||
sed -i -E "s/(\"height\"[[:space:]]*:[[:space:]]*)[0-9]+/\\1${height}/; s/(\"width\"[[:space:]]*:[[:space:]]*)[0-9]+/\\1${width}/" "$WAYBAR_CONFIG"
|
||||
|
||||
# Change the clock format
|
||||
if [[ $horizontal == true ]]; then
|
||||
sed -i -E '/"clock"[[:space:]]*:[[:space:]]*\{/,/\}/ s/"format"[[:space:]]*:[[:space:]]*"[^"]*"/"format": "{:L%A %H:%M}"/' "$WAYBAR_CONFIG"
|
||||
else
|
||||
sed -i -E '/"clock"[[:space:]]*:[[:space:]]*\{/,/\}/ s/"format"[[:space:]]*:[[:space:]]*"[^"]*"/"format": "{:%H\\n —\\n%M}"/' "$WAYBAR_CONFIG"
|
||||
fi
|
||||
|
||||
omarchy-restart-waybar
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Cache background switcher thumbnails for the current theme
|
||||
|
||||
theme_name=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
|
||||
|
||||
omarchy-menu-images \
|
||||
--cache-only \
|
||||
"$HOME/.config/omarchy/current/theme/backgrounds" \
|
||||
"$HOME/.config/omarchy/backgrounds/$theme_name"
|
||||
@@ -12,7 +12,9 @@ mapfile -d '' -t BACKGROUNDS < <(find -L "$USER_BACKGROUNDS_PATH" "$THEME_BACKGR
|
||||
TOTAL=${#BACKGROUNDS[@]}
|
||||
|
||||
if (( TOTAL == 0 )); then
|
||||
omarchy-notification-send "No background was found for theme" -t 2000
|
||||
notify-send "No background was found for theme" -t 2000
|
||||
pkill -x swaybg
|
||||
setsid uwsm-app -- swaybg --color '#000000' >/dev/null 2>&1 &
|
||||
else
|
||||
# Get current background from symlink
|
||||
if [[ -L $CURRENT_BACKGROUND_LINK ]]; then
|
||||
@@ -40,5 +42,10 @@ else
|
||||
NEW_BACKGROUND="${BACKGROUNDS[$NEXT_INDEX]}"
|
||||
fi
|
||||
|
||||
omarchy-theme-bg-set "$NEW_BACKGROUND"
|
||||
# Set new background symlink
|
||||
ln -nsf "$NEW_BACKGROUND" "$CURRENT_BACKGROUND_LINK"
|
||||
|
||||
# Relaunch swaybg
|
||||
pkill -x swaybg
|
||||
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Set the current background image
|
||||
# omarchy:args=<path-to-image>
|
||||
# omarchy:examples=omarchy theme bg set ~/Pictures/background.png
|
||||
# omarchy:examples=omarchy theme bg set ~/Pictures/wallpaper.png
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Usage: omarchy-theme-bg-set <path-to-image>" >&2
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Open the Omarchy background switcher
|
||||
# omarchy:group=theme
|
||||
# omarchy:name=bg-switcher
|
||||
# omarchy:aliases=omarchy background
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
theme_name=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
|
||||
current_background=$(readlink -f "$HOME/.config/omarchy/current/background" 2>/dev/null)
|
||||
|
||||
omarchy-menu-images \
|
||||
--selected "$current_background" \
|
||||
"$HOME/.config/omarchy/current/theme/backgrounds" \
|
||||
"$HOME/.config/omarchy/backgrounds/$theme_name"
|
||||
@@ -71,6 +71,3 @@ omarchy-theme-set-keyboard
|
||||
|
||||
# Call hook on theme set
|
||||
omarchy-hook theme-set "$THEME_NAME" >/dev/null
|
||||
|
||||
# Warm the background selector cache after the theme is applied, off the critical path.
|
||||
omarchy-theme-bg-cache >/dev/null 2>&1 &
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Open the Omarchy theme switcher
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
USER_THEMES_PATH="$HOME/.config/omarchy/themes"
|
||||
OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes"
|
||||
CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}/omarchy/theme-selector"
|
||||
preview_dir="$CACHE_PATH/previews"
|
||||
signature_file="$CACHE_PATH/signature"
|
||||
|
||||
mkdir -p "$preview_dir"
|
||||
|
||||
find_preview() {
|
||||
local theme_path="$1"
|
||||
local preview preview_name
|
||||
|
||||
for preview_name in preview.png preview.jpg preview.jpeg preview.webp preview.gif preview.bmp; do
|
||||
preview=$(find -L "$theme_path" -maxdepth 1 -type f -iname "$preview_name" -print -quit 2>/dev/null)
|
||||
|
||||
if [[ -n $preview ]]; then
|
||||
printf '%s\n' "$preview"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -d $theme_path/backgrounds ]]; then
|
||||
find -L "$theme_path/backgrounds" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \) -print 2>/dev/null | sort | head -n 1
|
||||
fi
|
||||
}
|
||||
|
||||
add_theme_preview() {
|
||||
local theme_name="$1"
|
||||
local preview="$2"
|
||||
local extension="${preview##*.}"
|
||||
extension="${extension,,}"
|
||||
|
||||
[[ -n $preview ]] || return
|
||||
[[ -e $preview_dir/$theme_name.$extension ]] && return
|
||||
|
||||
ln -s "$preview" "$preview_dir/$theme_name.$extension"
|
||||
}
|
||||
|
||||
theme_signature=""
|
||||
for theme_dir in "$USER_THEMES_PATH" "$OMARCHY_THEMES_PATH"; do
|
||||
if [[ -d $theme_dir ]]; then
|
||||
theme_signature+="$theme_dir:$(stat -Lc '%Y' "$theme_dir")"$'\n'
|
||||
|
||||
while IFS= read -r -d '' theme_path; do
|
||||
preview=$(find_preview "$theme_path")
|
||||
theme_signature+="$theme_path:$(stat -Lc '%Y' "$theme_path")"$'\n'
|
||||
|
||||
if [[ -n $preview ]]; then
|
||||
theme_signature+="$preview:$(stat -Lc '%s:%Y' "$preview")"$'\n'
|
||||
fi
|
||||
done < <(find -L "$theme_dir" -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -print0 2>/dev/null | sort -z)
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ! -f $signature_file ]] || ! cmp -s "$signature_file" <(printf '%s' "$theme_signature"); then
|
||||
rm -rf "$preview_dir"
|
||||
mkdir -p "$preview_dir"
|
||||
|
||||
while IFS= read -r theme_path; do
|
||||
theme_name=${theme_path##*/}
|
||||
preview=$(find_preview "$theme_path")
|
||||
|
||||
if [[ -z $preview ]]; then
|
||||
preview=$(find_preview "$OMARCHY_THEMES_PATH/$theme_name")
|
||||
fi
|
||||
|
||||
add_theme_preview "$theme_name" "$preview"
|
||||
done < <(find -L "$USER_THEMES_PATH" -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -print 2>/dev/null | sort)
|
||||
|
||||
while IFS= read -r theme_path; do
|
||||
theme_name=${theme_path##*/}
|
||||
preview=$(find_preview "$theme_path")
|
||||
add_theme_preview "$theme_name" "$preview"
|
||||
done < <(find -L "$OMARCHY_THEMES_PATH" -mindepth 1 -maxdepth 1 -type d -print 2>/dev/null | sort)
|
||||
|
||||
printf '%s' "$theme_signature" >"$signature_file"
|
||||
fi
|
||||
|
||||
current_theme=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
|
||||
selected_preview=""
|
||||
for extension in png jpg jpeg webp gif bmp; do
|
||||
if [[ -e $preview_dir/$current_theme.$extension ]]; then
|
||||
selected_preview="$preview_dir/$current_theme.$extension"
|
||||
break
|
||||
fi
|
||||
done
|
||||
exec omarchy-menu-images \
|
||||
--print-name \
|
||||
--show-labels \
|
||||
--filterable \
|
||||
--lazy-thumbnails \
|
||||
--selected "$selected_preview" \
|
||||
"$preview_dir"
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Enable, disable, or toggle the touchpad
|
||||
# omarchy:args=[on|off|toggle]
|
||||
|
||||
STATE_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.lua"
|
||||
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf"
|
||||
|
||||
device="$(omarchy-hw-touchpad)"
|
||||
|
||||
@@ -13,20 +13,20 @@ if [[ -z $device ]]; then
|
||||
fi
|
||||
|
||||
enable() {
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null
|
||||
rm -f "$STATE_FILE"
|
||||
hyprctl keyword "device[$device]:enabled" true >/dev/null
|
||||
rm -f "$STATE_CONF"
|
||||
omarchy-swayosd-client --custom-icon input-touchpad-symbolic --custom-message "Touchpad enabled"
|
||||
}
|
||||
|
||||
disable() {
|
||||
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"
|
||||
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"
|
||||
omarchy-swayosd-client --custom-icon touchpad-disabled-symbolic --custom-message "Touchpad disabled"
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;;
|
||||
toggle) if [[ -f $STATE_CONF ]]; 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_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.lua"
|
||||
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.conf"
|
||||
|
||||
device="$(omarchy-hw-touchscreen)"
|
||||
|
||||
@@ -13,20 +13,20 @@ if [[ -z $device ]]; then
|
||||
fi
|
||||
|
||||
enable() {
|
||||
hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null
|
||||
rm -f "$STATE_FILE"
|
||||
hyprctl keyword "device[$device]:enabled" true >/dev/null
|
||||
rm -f "$STATE_CONF"
|
||||
omarchy-swayosd-client --custom-icon device-support-touch-symbolic --custom-message "Touchscreen enabled"
|
||||
}
|
||||
|
||||
disable() {
|
||||
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"
|
||||
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"
|
||||
omarchy-swayosd-client --custom-icon touch-disabled-symbolic --custom-message "Touchscreen disabled"
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
on) enable ;;
|
||||
off) disable ;;
|
||||
toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;;
|
||||
toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;;
|
||||
esac
|
||||
|
||||
+40
-16
@@ -4,7 +4,7 @@
|
||||
# omarchy:name=
|
||||
# omarchy:summary=Transcode pictures and videos for sharing
|
||||
# omarchy:args=[--path path] [input] [format] [resolution]
|
||||
# omarchy:examples=omarchy transcode|omarchy transcode --path ~/Downloads|omarchy transcode ~/Videos/demo.mov mp4 1080p|omarchy transcode ~/Pictures/background.heic jpg medium
|
||||
# omarchy:examples=omarchy transcode|omarchy transcode --path ~/Downloads|omarchy transcode ~/Videos/demo.mov mp4 1080p|omarchy transcode ~/Pictures/wallpaper.heic jpg medium
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -13,7 +13,7 @@ usage() {
|
||||
Usage:
|
||||
omarchy transcode [--path path] [input] [format] [resolution]
|
||||
|
||||
With no input, pick a picture or video with Walker from ~/Pictures and ~/Videos,
|
||||
With no input, fuzzy-pick a picture or video from ~/Pictures and ~/Videos,
|
||||
or only from --path when provided. Then pick the output format and resolution.
|
||||
|
||||
Options:
|
||||
@@ -29,6 +29,30 @@ Resolutions:
|
||||
EOF
|
||||
}
|
||||
|
||||
pick_file() {
|
||||
local search_path="$1"
|
||||
local paths=()
|
||||
|
||||
if [[ -n $search_path ]]; then
|
||||
[[ -e $search_path ]] || { echo "Path not found: $search_path" >&2; return 1; }
|
||||
paths=("$search_path")
|
||||
else
|
||||
paths=("$HOME/Pictures" "$HOME/Videos")
|
||||
fi
|
||||
|
||||
find "${paths[@]}" -type f \
|
||||
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' -o -iname '*.gif' -o -iname '*.heic' -o -iname '*.avif' \
|
||||
-o -iname '*.mp4' -o -iname '*.mov' -o -iname '*.m4v' -o -iname '*.mkv' -o -iname '*.webm' -o -iname '*.avi' \) \
|
||||
-printf '%T@\t%p\n' 2>/dev/null | sort -rn | cut -f2- | fzf --layout=reverse-list --prompt="Transcode file> "
|
||||
}
|
||||
|
||||
pick_option() {
|
||||
local prompt="$1"
|
||||
shift
|
||||
|
||||
gum choose --header "$prompt" "$@"
|
||||
}
|
||||
|
||||
media_type() {
|
||||
local mime
|
||||
mime=$(file -b --mime-type "$1")
|
||||
@@ -163,10 +187,9 @@ main() {
|
||||
input="${positional[0]:-}"
|
||||
format="${positional[1]:-}"
|
||||
resolution="${positional[2]:-}"
|
||||
search_path="${search_path:-$HOME/Pictures:$HOME/Videos}"
|
||||
|
||||
if [[ -z $input ]]; then
|
||||
input=$(omarchy-menu-file "Transcode picture or video" "$search_path" "jpg jpeg png webp gif heic avif mp4 mov m4v mkv webm avi")
|
||||
input=$(pick_file "$search_path")
|
||||
fi
|
||||
|
||||
[[ -n $input ]] || return 1
|
||||
@@ -176,32 +199,33 @@ main() {
|
||||
|
||||
if [[ -z $format ]]; then
|
||||
if [[ $type == "picture" ]]; then
|
||||
format=$(omarchy-menu-select "Select format" jpg png)
|
||||
format=$(pick_option "Select format..." jpg png)
|
||||
else
|
||||
format=$(omarchy-menu-select "Select format" mp4 gif)
|
||||
format=$(pick_option "Select format..." mp4 gif)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $resolution ]]; then
|
||||
if [[ $type == "picture" ]]; then
|
||||
resolution=$(omarchy-menu-select "Select resolution" high medium low)
|
||||
resolution=$(pick_option "Select resolution..." high medium low)
|
||||
else
|
||||
resolution=$(omarchy-menu-select "Select resolution" 4k 1080p 720p)
|
||||
resolution=$(pick_option "Select resolution..." 4k 1080p 720p)
|
||||
fi
|
||||
fi
|
||||
|
||||
output=$(output_path "$input" "$format" "$resolution")
|
||||
|
||||
if [[ $type == "video" ]]; then
|
||||
omarchy-notification-send -g "Transcoding video…" "$(basename -- "$input") to $format ($resolution)"
|
||||
transcode_video "$input" "$format" "$resolution" "$output"
|
||||
copy_to_clipboard "$output"
|
||||
omarchy-notification-send -g "Transcoded to $resolution $format" "Saved and copied to clipboard."
|
||||
else
|
||||
if [[ $type == "picture" ]]; then
|
||||
transcode_picture "$input" "$format" "$resolution" "$output"
|
||||
copy_to_clipboard "$output"
|
||||
omarchy-notification-send -g "Transcoded to $resolution $format" "Saved and copied to clipboard."
|
||||
else
|
||||
transcode_video "$input" "$format" "$resolution" "$output"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
copy_to_clipboard "$output"
|
||||
echo "Your $type has been transcoded into $format as $resolution. It's on your clipboard."
|
||||
echo ""
|
||||
echo "It's also in $output"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -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 eval 'hl.config({ debug = { suppress_errors = true } })' &>/dev/null || hyprctl keyword debug:suppress_errors true &>/dev/null || true
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Ensure the Omarchy and Arch keyring packages are installed and populated
|
||||
# omarchy:summary=Ensure the Omarchy keyring package is installed and populated
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 &>/dev/null; then
|
||||
@@ -16,7 +16,5 @@ if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630
|
||||
fi
|
||||
|
||||
# Ensure we have the latest archlinux-keyring, maintainer keys might have changed
|
||||
# Always reinstall, as the keyring can be updated without a package version bump.
|
||||
echo -e "\e[32m\nUpdate Arch signing keys\e[0m"
|
||||
sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null 2> >(grep -vE '^warning: archlinux-keyring-[^ ]+ is up to date -- reinstalling$' >&2)
|
||||
echo "Keys are correct"
|
||||
sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
set -e
|
||||
|
||||
# Ensure screensaver/sleep doesn't set in during updates
|
||||
hyprctl dispatch 'hl.dsp.window.tag({ tag = "+noidle" })' &>/dev/null || hyprctl dispatch tagwindow +noidle &>/dev/null || true
|
||||
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 'hl.dsp.window.tag({ tag = "-noidle" })' &>/dev/null || hyprctl dispatch tagwindow -- -noidle &>/dev/null || true
|
||||
hyprctl dispatch tagwindow -- -noidle &>/dev/null || true
|
||||
|
||||
@@ -24,11 +24,11 @@ case $weather_code in
|
||||
116) [[ $night == "true" ]] && icon="" || icon="" ;;
|
||||
119|122) icon="" ;;
|
||||
143|248|260) icon="" ;;
|
||||
176|263|353) [[ $night == "true" ]] && icon="" || icon="" ;;
|
||||
176|263|266|293|296|353) [[ $night == "true" ]] && icon="" || icon="" ;;
|
||||
179|227|230|323|326|368) [[ $night == "true" ]] && icon="" || icon="" ;;
|
||||
182|185|281|284|311|314|317|320|350|362|365|374|377) icon="" ;;
|
||||
200|386|389|392|395) icon="" ;;
|
||||
266|293|296|299|302|305|308|356|359) icon="" ;;
|
||||
299|302|305|308|356|359) icon="" ;;
|
||||
329|332|335|338|371) icon="" ;;
|
||||
*) icon="" ;;
|
||||
esac
|
||||
|
||||
@@ -12,6 +12,15 @@ fi
|
||||
IFS='|' read -r place temperature wind <<< "$weather"
|
||||
place=${place%%,*}
|
||||
place=${place^}
|
||||
temperature=${temperature#+}
|
||||
format_temperature() {
|
||||
local celsius=${1#+}
|
||||
celsius=${celsius//°/}
|
||||
celsius=${celsius%C}
|
||||
|
||||
echo "$(omarchy-weather-icon) $place · Temp $temperature · Wind $wind"
|
||||
echo "${celsius}°c / $((celsius * 9 / 5 + 32))°f"
|
||||
}
|
||||
|
||||
temperature=$(format_temperature "$temperature")
|
||||
wind=${wind//km\// km/}
|
||||
|
||||
echo "$(omarchy-weather-icon) $place · Temperature $temperature · Wind $wind"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--ozone-platform=wayland
|
||||
--ozone-platform-hint=wayland
|
||||
--enable-features=TouchpadOverscrollHistoryNavigation
|
||||
--enable-features=TouchpadOverscrollHistoryNavigation,VaapiVideoDecodeLinuxGL,VaapiVideoEncoder
|
||||
--load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url
|
||||
|
||||
@@ -1 +1 @@
|
||||
command = 'wl-copy && (hyprctl dispatch "hl.dsp.send_shortcut({ mods = \"SHIFT\", key = \"Insert\" })" || hyprctl dispatch sendshortcut "SHIFT, Insert,")'
|
||||
command = 'wl-copy && hyprctl dispatch sendshortcut "SHIFT, Insert,"'
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<test name="family" qual="any">
|
||||
<string>monospace</string>
|
||||
</test>
|
||||
<edit name="family" mode="append" binding="same">
|
||||
<edit name="family" mode="assign" binding="strong">
|
||||
<string>JetBrainsMono Nerd Font</string>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"workspace": {
|
||||
"library": [
|
||||
"/usr/share/hypr/stubs"
|
||||
],
|
||||
"checkThirdParty": false
|
||||
},
|
||||
"diagnostics": {
|
||||
"globals": ["hl"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
# Extra autostart processes
|
||||
# exec-once = uwsm-app -- my-service
|
||||
@@ -1,4 +0,0 @@
|
||||
-- Extra autostart processes.
|
||||
-- hl.on("hyprland.start", function()
|
||||
-- hl.exec_cmd("uwsm-app -- my-service")
|
||||
-- end)
|
||||
@@ -0,0 +1,40 @@
|
||||
# Application bindings
|
||||
bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)"
|
||||
bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" bash -c "tmux attach || tmux new -s Work"
|
||||
bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser
|
||||
bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window
|
||||
bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"
|
||||
bindd = SUPER SHIFT, B, Browser, exec, omarchy-launch-browser
|
||||
bindd = SUPER SHIFT ALT, B, Browser (private), exec, omarchy-launch-browser --private
|
||||
bindd = SUPER SHIFT, M, Music, exec, omarchy-launch-or-focus spotify
|
||||
bindd = SUPER SHIFT ALT, M, Music TUI, exec, omarchy-launch-or-focus-tui cliamp
|
||||
bindd = SUPER SHIFT, N, Editor, exec, omarchy-launch-editor
|
||||
bindd = SUPER SHIFT, D, Docker, exec, omarchy-launch-tui lazydocker
|
||||
bindd = SUPER SHIFT, G, Signal, exec, omarchy-launch-or-focus ^signal$ "uwsm-app -- signal-desktop"
|
||||
bindd = SUPER SHIFT, O, Obsidian, exec, omarchy-launch-or-focus ^obsidian$ "uwsm-app -- obsidian"
|
||||
bindd = SUPER SHIFT, W, Typora, exec, uwsm-app -- typora --enable-wayland-ime
|
||||
bindd = SUPER SHIFT, SLASH, Passwords, exec, uwsm-app -- 1password
|
||||
|
||||
# If your web app url contains #, type it as ## to prevent hyprland treating it as a comment
|
||||
bindd = SUPER SHIFT, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com"
|
||||
bindd = SUPER SHIFT ALT, A, Grok, exec, omarchy-launch-webapp "https://grok.com"
|
||||
bindd = SUPER SHIFT, C, Calendar, exec, omarchy-launch-webapp "https://app.hey.com/calendar/weeks/"
|
||||
bindd = SUPER SHIFT, E, Email, exec, omarchy-launch-webapp "https://app.hey.com"
|
||||
bindd = SUPER SHIFT, Y, YouTube, exec, omarchy-launch-webapp "https://youtube.com/"
|
||||
bindd = SUPER SHIFT ALT, G, WhatsApp, exec, omarchy-launch-or-focus-webapp WhatsApp "https://web.whatsapp.com/"
|
||||
bindd = SUPER SHIFT CTRL, G, Google Messages, exec, omarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations"
|
||||
bindd = SUPER SHIFT, P, Google Photos, exec, omarchy-launch-or-focus-webapp "Google Photos" "https://photos.google.com/"
|
||||
bindd = SUPER SHIFT, X, X, exec, omarchy-launch-webapp "https://x.com/"
|
||||
bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/compose/post"
|
||||
|
||||
# Add extra bindings
|
||||
# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server
|
||||
|
||||
# Overwrite existing bindings, like putting Omarchy Menu on Super + Space
|
||||
# unbind = SUPER, SPACE
|
||||
# bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu
|
||||
|
||||
# Logitech MX Keys
|
||||
# bind = SUPER SHIFT, S, exec, omarchy-capture-screenshot # Print Screen Button
|
||||
# bind = SUPER, H, exec, voxtype record toggle # Dictation Button
|
||||
# bind = SUPER, PERIOD, exec, omarchy-launch-walker -m symbols # Emoji Button
|
||||
@@ -1,40 +0,0 @@
|
||||
-- Application bindings.
|
||||
hl.bind("SUPER + RETURN", hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)"]]), { description = "Terminal" })
|
||||
hl.bind("SUPER + ALT + RETURN", hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" bash -c "tmux attach || tmux new -s Work"]]), { description = "Tmux" })
|
||||
hl.bind("SUPER + SHIFT + RETURN", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" })
|
||||
hl.bind("SUPER + SHIFT + F", hl.dsp.exec_cmd("uwsm-app -- nautilus --new-window"), { description = "File manager" })
|
||||
hl.bind("SUPER + ALT + SHIFT + F", hl.dsp.exec_cmd([[uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"]]), { description = "File manager (cwd)" })
|
||||
hl.bind("SUPER + SHIFT + B", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" })
|
||||
hl.bind("SUPER + SHIFT + ALT + B", hl.dsp.exec_cmd("omarchy-launch-browser --private"), { description = "Browser (private)" })
|
||||
hl.bind("SUPER + SHIFT + M", hl.dsp.exec_cmd("omarchy-launch-or-focus spotify"), { description = "Music" })
|
||||
hl.bind("SUPER + SHIFT + ALT + M", hl.dsp.exec_cmd("omarchy-launch-or-focus-tui cliamp"), { description = "Music TUI" })
|
||||
hl.bind("SUPER + SHIFT + N", hl.dsp.exec_cmd("omarchy-launch-editor"), { description = "Editor" })
|
||||
hl.bind("SUPER + SHIFT + D", hl.dsp.exec_cmd("omarchy-launch-tui lazydocker"), { description = "Docker" })
|
||||
hl.bind("SUPER + SHIFT + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus ^signal$ "uwsm-app -- signal-desktop"]]), { description = "Signal" })
|
||||
hl.bind("SUPER + SHIFT + O", hl.dsp.exec_cmd([[omarchy-launch-or-focus ^obsidian$ "uwsm-app -- obsidian"]]), { description = "Obsidian" })
|
||||
hl.bind("SUPER + SHIFT + W", hl.dsp.exec_cmd("uwsm-app -- typora --enable-wayland-ime"), { description = "Typora" })
|
||||
hl.bind("SUPER + SHIFT + SLASH", hl.dsp.exec_cmd("uwsm-app -- 1password"), { description = "Passwords" })
|
||||
|
||||
-- Web app bindings.
|
||||
hl.bind("SUPER + SHIFT + A", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://chatgpt.com"]]), { description = "ChatGPT" })
|
||||
hl.bind("SUPER + SHIFT + ALT + A", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://grok.com"]]), { description = "Grok" })
|
||||
hl.bind("SUPER + SHIFT + C", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://app.hey.com/calendar/weeks/"]]), { description = "Calendar" })
|
||||
hl.bind("SUPER + SHIFT + E", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://app.hey.com"]]), { description = "Email" })
|
||||
hl.bind("SUPER + SHIFT + Y", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://youtube.com/"]]), { description = "YouTube" })
|
||||
hl.bind("SUPER + SHIFT + ALT + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp WhatsApp "https://web.whatsapp.com/"]]), { description = "WhatsApp" })
|
||||
hl.bind("SUPER + SHIFT + CTRL + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations"]]), { description = "Google Messages" })
|
||||
hl.bind("SUPER + SHIFT + P", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp "Google Photos" "https://photos.google.com/"]]), { description = "Google Photos" })
|
||||
hl.bind("SUPER + SHIFT + X", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://x.com/"]]), { description = "X" })
|
||||
hl.bind("SUPER + SHIFT + ALT + X", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://x.com/compose/post"]]), { description = "X Post" })
|
||||
|
||||
-- Add extra bindings below.
|
||||
-- hl.bind("SUPER + SHIFT + R", hl.dsp.exec_cmd("alacritty -e ssh your-server"), { description = "SSH" })
|
||||
|
||||
-- Overwrite existing bindings with hl.unbind() first if needed.
|
||||
-- hl.unbind("SUPER + SPACE")
|
||||
-- hl.bind("SUPER + SPACE", hl.dsp.exec_cmd("omarchy-menu"), { description = "Omarchy menu" })
|
||||
|
||||
-- Logitech MX Keys examples:
|
||||
-- hl.bind("SUPER + SHIFT + S", hl.dsp.exec_cmd("omarchy-capture-screenshot"))
|
||||
-- hl.bind("SUPER + H", hl.dsp.exec_cmd("voxtype record toggle"))
|
||||
-- hl.bind("SUPER + PERIOD", hl.dsp.exec_cmd("omarchy-launch-walker -m symbols"))
|
||||
@@ -11,7 +11,7 @@ listener {
|
||||
on-timeout = pidof hyprlock || omarchy-launch-screensaver
|
||||
}
|
||||
|
||||
# Lock system after 5 minutes (screensaver resets idle timer, so have to just do half + 2s margin)
|
||||
# Lock system after 5 minutes
|
||||
listener {
|
||||
timeout = 152
|
||||
on-timeout = omarchy-system-lock
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Learn how to configure Hyprland: https://wiki.hypr.land/Configuring/
|
||||
|
||||
# Use defaults Omarchy defaults (but don't edit these directly!)
|
||||
source = ~/.local/share/omarchy/default/hypr/autostart.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/bindings/media.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/bindings/clipboard.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/bindings/tiling-v2.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/bindings/utilities.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/envs.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/looknfeel.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/input.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/windows.conf
|
||||
source = ~/.config/omarchy/current/theme/hyprland.conf
|
||||
|
||||
# Change your own setup in these files (and overwrite any settings from defaults!)
|
||||
source = ~/.config/hypr/monitors.conf
|
||||
source = ~/.config/hypr/input.conf
|
||||
source = ~/.config/hypr/bindings.conf
|
||||
source = ~/.config/hypr/looknfeel.conf
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
|
||||
# Toggle config flags dynamically
|
||||
source = ~/.local/state/omarchy/toggles/hypr/*.conf
|
||||
|
||||
# Add any other personal Hyprland configuration below
|
||||
# windowrule = workspace 5, match:class qemu
|
||||
@@ -1,42 +0,0 @@
|
||||
-- Learn how to configure Hyprland: https://wiki.hypr.land/Configuring/Start/
|
||||
|
||||
local home = os.getenv("HOME") or ""
|
||||
|
||||
-- Hyprland recommends require() for split Lua configs. These two roots let us
|
||||
-- load user modules from ~/.config and Omarchy defaults from $OMARCHY_PATH.
|
||||
package.path = home .. "/.config/?.lua;" .. (os.getenv("OMARCHY_PATH") or (home .. "/.local/share/omarchy")) .. "/?.lua;" .. package.path
|
||||
|
||||
local paths = require("default.hypr.paths")
|
||||
|
||||
-- Use Omarchy defaults, but don't edit these directly.
|
||||
require("default.hypr.autostart")
|
||||
require("default.hypr.bindings.media")
|
||||
require("default.hypr.bindings.clipboard")
|
||||
require("default.hypr.bindings.tiling-v2")
|
||||
require("default.hypr.bindings.utilities")
|
||||
require("default.hypr.envs")
|
||||
require("default.hypr.looknfeel")
|
||||
require("default.hypr.input")
|
||||
require("default.hypr.windows")
|
||||
|
||||
-- Current theme overrides.
|
||||
do
|
||||
local theme = io.open(paths.config_home .. "/omarchy/current/theme/hyprland.lua", "r")
|
||||
if theme then
|
||||
theme:close()
|
||||
require("omarchy.current.theme.hyprland")
|
||||
end
|
||||
end
|
||||
|
||||
-- Change your own setup in these files and override defaults.
|
||||
require("hypr.monitors")
|
||||
require("hypr.input")
|
||||
require("hypr.bindings")
|
||||
require("hypr.looknfeel")
|
||||
require("hypr.autostart")
|
||||
|
||||
-- Toggle config flags dynamically.
|
||||
require("default.hypr.toggles")
|
||||
|
||||
-- Add any other personal Hyprland configuration below.
|
||||
-- hl.window_rule({ match = { class = "qemu" }, workspace = "5" })
|
||||
@@ -41,5 +41,3 @@ input-field {
|
||||
auth {
|
||||
fingerprint:enabled = false
|
||||
}
|
||||
|
||||
source = ~/.local/state/omarchy/toggles/hyprlock.conf
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# Control your input devices
|
||||
# See https://wiki.hypr.land/Configuring/Basics/Variables/#input
|
||||
input {
|
||||
# Use multiple keyboard layouts and switch between them with Left Alt + Right Alt
|
||||
# kb_layout = us,dk,eu
|
||||
|
||||
# Use a specific keyboard variant if needed (e.g. intl for international keyboards)
|
||||
# kb_variant = intl
|
||||
|
||||
kb_options = compose:caps # ,grp:alts_toggle
|
||||
|
||||
# Change speed of keyboard repeat
|
||||
repeat_rate = 40
|
||||
repeat_delay = 250
|
||||
|
||||
# Start with numlock on by default
|
||||
numlock_by_default = true
|
||||
|
||||
# Increase sensitivity for mouse/trackpad (default: 0)
|
||||
# sensitivity = 0.35
|
||||
|
||||
# Turn off mouse acceleration (default: adaptive)
|
||||
# accel_profile = flat
|
||||
|
||||
touchpad {
|
||||
# Use natural (inverse) scrolling
|
||||
# natural_scroll = true
|
||||
|
||||
# Use two-finger clicks for right-click instead of lower-right corner
|
||||
clickfinger_behavior = true
|
||||
|
||||
# Control the speed of your scrolling
|
||||
scroll_factor = 0.4
|
||||
|
||||
# Enable the touchpad while typing
|
||||
# disable_while_typing = false
|
||||
|
||||
# Left-click-and-drag with three fingers
|
||||
# drag_3fg = 1
|
||||
}
|
||||
}
|
||||
|
||||
# Scroll nicely in the terminal
|
||||
windowrule = match:class (Alacritty|kitty|foot), scroll_touchpad 1.5
|
||||
windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2
|
||||
|
||||
# Enable touchpad gestures for changing workspaces
|
||||
# See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/
|
||||
# gesture = 3, horizontal, workspace
|
||||
|
||||
# Enable touchpad gestures for moving focus (helpful on scrolling layout)
|
||||
# gesture = 3, left, dispatcher, movefocus, l
|
||||
# gesture = 3, right, dispatcher, movefocus, r
|
||||
@@ -1,55 +0,0 @@
|
||||
-- Control your input devices.
|
||||
-- See https://wiki.hypr.land/Configuring/Basics/Variables/#input
|
||||
hl.config({
|
||||
input = {
|
||||
-- Use multiple keyboard layouts and switch between them with Left Alt + Right Alt.
|
||||
-- kb_layout = "us,dk,eu",
|
||||
|
||||
-- Use a specific keyboard variant if needed (e.g. intl for international keyboards).
|
||||
-- kb_variant = "intl",
|
||||
|
||||
kb_options = "compose:caps", -- ,grp:alts_toggle
|
||||
|
||||
-- Change speed of keyboard repeat.
|
||||
repeat_rate = 40,
|
||||
repeat_delay = 250,
|
||||
|
||||
-- Start with numlock on by default.
|
||||
numlock_by_default = true,
|
||||
|
||||
-- Increase sensitivity for mouse/trackpad (default: 0).
|
||||
-- sensitivity = 0.35,
|
||||
|
||||
-- Turn off mouse acceleration (default: adaptive).
|
||||
-- accel_profile = "flat",
|
||||
|
||||
touchpad = {
|
||||
-- Use natural (inverse) scrolling.
|
||||
-- natural_scroll = true,
|
||||
|
||||
-- Use two-finger clicks for right-click instead of lower-right corner.
|
||||
clickfinger_behavior = true,
|
||||
|
||||
-- Control the speed of your scrolling.
|
||||
scroll_factor = 0.4,
|
||||
|
||||
-- Enable the touchpad while typing.
|
||||
-- disable_while_typing = false,
|
||||
|
||||
-- Left-click-and-drag with three fingers.
|
||||
-- drag_3fg = 1,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Scroll nicely in the terminal.
|
||||
hl.window_rule({ match = { class = "(Alacritty|kitty|foot)" }, scroll_touchpad = 1.5 })
|
||||
hl.window_rule({ match = { class = "com.mitchellh.ghostty" }, scroll_touchpad = 0.2 })
|
||||
|
||||
-- Enable touchpad gestures for changing workspaces.
|
||||
-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/
|
||||
-- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
|
||||
|
||||
-- Enable touchpad gestures for moving focus (helpful on scrolling layout).
|
||||
-- hl.gesture({ fingers = 3, direction = "left", action = function() hl.dispatch(hl.dsp.focus({ direction = "l" })) end })
|
||||
-- hl.gesture({ fingers = 3, direction = "right", action = function() hl.dispatch(hl.dsp.focus({ direction = "r" })) end })
|
||||
@@ -0,0 +1,40 @@
|
||||
# Change the default Omarchy look'n'feel
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Basics/Variables/#general
|
||||
general {
|
||||
# No gaps between windows or borders
|
||||
# gaps_in = 0
|
||||
# gaps_out = 0
|
||||
# border_size = 0
|
||||
|
||||
# Change to niri-like side-scrolling layout
|
||||
# layout = scrolling
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Basics/Variables/#decoration
|
||||
decoration {
|
||||
# Use round window corners
|
||||
# rounding = 8
|
||||
|
||||
# Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed)
|
||||
# dim_inactive = true
|
||||
# dim_strength = 0.15
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Basics/Variables/#animations
|
||||
animations {
|
||||
# Disable all animations
|
||||
# enabled = no
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Basics/Variables/#layout
|
||||
layout {
|
||||
# Avoid overly wide single-window layouts on wide screens
|
||||
# single_window_aspect_ratio = 1 1
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/
|
||||
scrolling {
|
||||
# See only one column per screen instead of two
|
||||
# column_width = 0.97
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
-- Change the default Omarchy look'n'feel.
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Basics/Variables/#general
|
||||
-- hl.config({
|
||||
-- general = {
|
||||
-- -- No gaps between windows or borders.
|
||||
-- gaps_in = 0,
|
||||
-- gaps_out = 0,
|
||||
-- border_size = 0,
|
||||
--
|
||||
-- -- Change to niri-like side-scrolling layout.
|
||||
-- layout = "scrolling",
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Basics/Variables/#decoration
|
||||
-- hl.config({
|
||||
-- decoration = {
|
||||
-- -- Use round window corners.
|
||||
-- rounding = 8,
|
||||
--
|
||||
-- -- Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed).
|
||||
-- dim_inactive = true,
|
||||
-- dim_strength = 0.15,
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Basics/Variables/#animations
|
||||
-- hl.config({
|
||||
-- animations = {
|
||||
-- -- Disable all animations.
|
||||
-- enabled = false,
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Basics/Variables/#layout
|
||||
-- hl.config({
|
||||
-- layout = {
|
||||
-- -- Avoid overly wide single-window layouts on wide screens.
|
||||
-- single_window_aspect_ratio = { 1, 1 },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/
|
||||
-- hl.config({
|
||||
-- scrolling = {
|
||||
-- -- See only one column per screen instead of two.
|
||||
-- column_width = 0.97,
|
||||
-- },
|
||||
-- })
|
||||
@@ -0,0 +1,26 @@
|
||||
# See https://wiki.hypr.land/Configuring/Basics/Monitors/
|
||||
# List current monitors and resolutions possible: hyprctl monitors
|
||||
# Format: monitor = [port], resolution, position, scale
|
||||
|
||||
# Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K.
|
||||
env = GDK_SCALE,2
|
||||
monitor=,preferred,auto,auto
|
||||
|
||||
# Good compromise for 27" or 32" 4K monitors (but fractional!)
|
||||
# env = GDK_SCALE,1.75
|
||||
# monitor=,preferred,auto,1.6
|
||||
|
||||
# Straight 1x setup for low-resolution displays like 1080p or 1440p
|
||||
# Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440
|
||||
# env = GDK_SCALE,1
|
||||
# monitor=,preferred,auto,1
|
||||
|
||||
# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°)
|
||||
# monitor = DP-2, preferred, auto, 1, transform, 1
|
||||
|
||||
# Example for Framework 13 w/ 6K XDR Apple display
|
||||
# monitor = DP-5, 6016x3384@60, auto, 2
|
||||
# monitor = eDP-1, 2880x1920@120, auto, 2
|
||||
|
||||
# Disable the second ghost monitor on an Apple 6K XDR over Thunderbolt
|
||||
# monitor=DP-2,disable
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user