diff --git a/bin/omarchy-cmd-audio-switch b/bin/omarchy-cmd-audio-switch index 2377a12..af6d53a 100755 --- a/bin/omarchy-cmd-audio-switch +++ b/bin/omarchy-cmd-audio-switch @@ -1,19 +1,50 @@ #!/bin/bash -# Find all the audio sinks but exit if there are none -sinks=($(wpctl status | sed -n '/Sinks:/,/Sources:/p' | grep -E '^\s*│\s+\*?\s*[0-9]+\.' | sed -E 's/^[^0-9]*([0-9]+)\..*/\1/')) -[ ${#sinks[@]} -eq 0 ] && exit 1 +focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')" -# Find current audio sink -current=$(wpctl status | sed -n '/Sinks:/,/Sources:/p' | grep '^\s*│\s*\*' | sed -E 's/^[^0-9]*([0-9]+)\..*/\1/') +sinks=$(pactl -f json list sinks) +sinks_count=$(echo "$sinks" | jq '. | length') -# Find the next sink (looping around in the list) -for i in "${!sinks[@]}"; do - [ "${sinks[$i]}" = "$current" ] && next=${sinks[$(((i + 1) % ${#sinks[@]}))]} -done -next=${next:-${sinks[0]}} +if [ "$sinks_count" -eq 0 ]; then + swayosd-client \ + --monitor "$focused_monitor" \ + --custom-message "No audio devices found" + exit 1 +fi -# Set the next sink and ensure it's not muted -wpctl set-default "$next" -wpctl set-mute "$next" 0 +current_sink_name=$(pactl get-default-sink) +current_sink_index=$(echo "$sinks" | jq -r --arg name "$current_sink_name" 'map(.name) | index($name)') +if [ "$current_sink_index" != "null" ]; then + next_sink_index=$(((current_sink_index + 1) % sinks_count)) +else + next_sink_index=0 +fi + +next_sink=$(echo "$sinks" | jq -r ".[$next_sink_index]") +next_sink_name=$(echo "$next_sink" | jq -r '.name') +next_sink_description=$(echo "$next_sink" | jq -r '.description') +next_sink_volume=$(echo "$next_sink" | jq -r \ + '.volume | to_entries[0].value.value_percent | sub("%"; "")') +next_sink_is_muted=$(echo "$next_sink" | jq -r '.mute') + +if [ "$next_sink_is_muted" = "true" ] || [ "$next_sink_volume" -eq 0 ]; then + icon_state="muted" +elif [ "$next_sink_volume" -le 33 ]; then + icon_state="low" +elif [ "$next_sink_volume" -le 66 ]; then + icon_state="medium" +else + icon_state="high" +fi + +next_sink_volume_icon="sink-volume-${icon_state}-symbolic" + +if [ "$next_sink_name" != "$current_sink_name" ]; then + pactl set-default-sink "$next_sink_name" +fi + +swayosd-client \ + --monitor "$focused_monitor" \ + --custom-message "$next_sink_description" \ + --custom-icon "$next_sink_volume_icon" diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 4abffc6..f9a604b 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -8,15 +8,21 @@ if [[ ! -d "$OUTPUT_DIR" ]]; then exit 1 fi +if [[ $2 == "audio" ]]; then + AUDIO="--audio" +else + AUDIO="" +fi + screenrecording() { filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" notify-send "Screen recording starting..." -t 1000 sleep 1 if lspci | grep -Eqi 'nvidia|intel.*graphics'; then - wf-recorder -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" + wf-recorder $AUDIO -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" else - wl-screenrec -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@" + wl-screenrec $AUDIO -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@" fi } diff --git a/bin/omarchy-cmd-screenshot b/bin/omarchy-cmd-screenshot index 330dde3..05cce7b 100755 --- a/bin/omarchy-cmd-screenshot +++ b/bin/omarchy-cmd-screenshot @@ -8,7 +8,7 @@ if [[ ! -d "$OUTPUT_DIR" ]]; then exit 1 fi -pkill slurp || hyprshot -m ${1:-region} --raw | +pkill slurp || hyprshot -m ${1:-region} --raw --freeze | satty --filename - \ --output-filename "$OUTPUT_DIR/screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png" \ --early-exit \ diff --git a/bin/omarchy-drive-info b/bin/omarchy-drive-info new file mode 100755 index 0000000..10fb223 --- /dev/null +++ b/bin/omarchy-drive-info @@ -0,0 +1,28 @@ +#!/bin/bash + +# Drive, like /dev/nvme0, to display information about +if (($# == 0)); then + echo "Usage: omarchy-drive-info [/dev/drive]" + exit 1 +else + drive="$1" +fi + +# Find the root drive in case we are looking at partitions +root_drive=$(lsblk -no PKNAME "$drive" 2>/dev/null | tail -n1) +if [[ -n "$root_drive" ]]; then + root_drive="/dev/$root_drive" +else + root_drive="$drive" +fi + +# Get basic disk information +size=$(lsblk -dno SIZE "$drive" 2>/dev/null) +model=$(lsblk -dno MODEL "$root_drive" 2>/dev/null) + +# Format display string +display="$drive" +[[ -n "$size" ]] && display="$display ($size)" +[[ -n "$model" ]] && display="$display - $model" + +echo "$display" diff --git a/bin/omarchy-drive-select b/bin/omarchy-drive-select new file mode 100755 index 0000000..9168eb7 --- /dev/null +++ b/bin/omarchy-drive-select @@ -0,0 +1,18 @@ +#!/bin/bash + +# Select a drive from a list with info that includes space and brand + +if (($# == 0)); then + drives=$(lsblk -dpno NAME | grep -E '/dev/(sd|hd|vd|nvme|mmcblk|xv)') +else + drives="$@" +fi + +drives_with_info="" +while IFS= read -r drive; do + [[ -n "$drive" ]] || continue + drives_with_info+="$(omarchy-drive-info "$drive")"$'\n' +done <<<"$drives" + +selected_drive="$(printf "%s" "$drives_with_info" | gum choose --header "Select drive")" || exit 1 +printf "%s\n" "$selected_drive" | awk '{print $1}' diff --git a/bin/omarchy-drive-set-password b/bin/omarchy-drive-set-password new file mode 100755 index 0000000..88a9c58 --- /dev/null +++ b/bin/omarchy-drive-set-password @@ -0,0 +1,21 @@ +#!/bin/bash + +encrypted_drives=$(blkid -t TYPE=crypto_LUKS -o device) + +if [[ -n $encrypted_drives ]]; then + if [[ $(wc -l <<<"$encrypted_drives") -eq 1 ]]; then + drive_to_change="$encrypted_drives" + else + drive_to_change="$(omarchy-drive-select "$encrypted_drives")" + fi + + if [[ -n $drive_to_change ]]; then + echo "Changing full-disk encryption password for $drive_to_change" + sudo cryptsetup luksChangeKey --pbkdf argon2id --iter-time 2000 "$drive_to_change" + else + echo "No drive selected." + fi +else + echo "No encrypted drives available." + exit 1 +fi diff --git a/bin/omarchy-install-dev-env b/bin/omarchy-install-dev-env index bd189b2..e538cba 100755 --- a/bin/omarchy-install-dev-env +++ b/bin/omarchy-install-dev-env @@ -1,12 +1,12 @@ #!/bin/bash if [[ -z "$1" ]]; then - echo "Usage: omarchy-install-dev-env " >&2 + echo "Usage: omarchy-install-dev-env " >&2 exit 1 fi install_php() { - sudo pacman -S php composer php-sqlite --noconfirm + sudo pacman -S php composer php-sqlite xdebug --noconfirm # Install Path for Composer if [[ ":$PATH:" != *":$HOME/.config/composer/vendor/bin:"* ]]; then @@ -28,6 +28,12 @@ install_php() { "pdo_mysql" ) + # Enable Xdebug + sudo sed -i \ + -e 's/^;zend_extension=xdebug.so/zend_extension=xdebug.so/' \ + -e 's/^;xdebug.mode=debug/xdebug.mode=debug/' \ + /etc/php/conf.d/xdebug.ini + for ext in "${extensions_to_enable[@]}"; do sudo sed -i "s/^;extension=${ext}/extension=${ext}/" "$php_ini_path" done @@ -125,4 +131,9 @@ dotnet) echo -e "Installing .NET...\n" mise use --global dotnet@latest ;; +clojure) + echo -e "Installing Clojure...\n" + omarchy-pkg-add rlwrap + mise use --global clojure@latest + ;; esac diff --git a/bin/omarchy-install-docker-dbs b/bin/omarchy-install-docker-dbs index 20a779f..c0400a3 100755 --- a/bin/omarchy-install-docker-dbs +++ b/bin/omarchy-install-docker-dbs @@ -1,13 +1,18 @@ #!/bin/bash options=("MySQL" "PostgreSQL" "Redis" "MongoDB" "MariaDB") -choices=$(printf "%s\n" "${options[@]}" | gum choose --no-limit --header "Select databases (space to select, return to install, esc to cancel)") || main_menu + +if [[ "$#" -eq 0 ]]; then + choices=$(printf "%s\n" "${options[@]}" | gum choose --no-limit --header "Select databases (space to select, return to install, esc to cancel)") || main_menu +else + choices="$@" +fi if [[ -n "$choices" ]]; then for db in $choices; do case $db in MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;; - PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16 ;; + PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres17 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:17 ;; MariaDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mariadb11 -e MARIADB_ROOT_PASSWORD= -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=true mariadb:11.8 ;; Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;; MongoDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:27017:27017" --name mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin123 mongo:noble ;; diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 2996810..27cad84 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -2,6 +2,21 @@ export PATH="$HOME/.local/share/omarchy/bin:$PATH" +# Set to true when going directly to a submenu, so we can exit directly +BACK_TO_EXIT=false + +back_to() { + local parent_menu="$1" + + if [[ "$DIRECT_ACCESS" == "true" ]]; then + exit 0 + elif [[ -n "$parent_menu" ]]; then + "$parent_menu" + else + show_main_menu + fi +} + menu() { local prompt="$1" local options="$2" @@ -80,7 +95,7 @@ show_style_menu() { show_theme_menu() { theme=$(menu "Theme" "$(omarchy-theme-list)" "" "$(omarchy-theme-current)") if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then - show_main_menu + back_to show_style_menu else omarchy-theme-set "$theme" fi @@ -89,7 +104,7 @@ show_theme_menu() { show_font_menu() { theme=$(menu "Font" "$(omarchy-font-list)" "-w 350" "$(omarchy-font-current)") if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then - show_main_menu + back_to show_style_menu else omarchy-font-set "$theme" fi @@ -114,8 +129,10 @@ show_screenshot_menu() { } show_screenrecord_menu() { - case $(menu "Screenrecord" " Region\n Display") in + case $(menu "Screenrecord" " Region\n Region + Audio\n Display\n Display + Audio") in + *"Region + Audio"*) omarchy-cmd-screenrecord region audio ;; *Region*) omarchy-cmd-screenrecord ;; + *"Display + Audio"*) omarchy-cmd-screenrecord output audio ;; *Display*) omarchy-cmd-screenrecord output ;; *) show_capture_menu ;; esac @@ -163,7 +180,7 @@ show_setup_power_menu() { profile=$(menu "Power Profile" "$(omarchy-powerprofiles-list)" "" "$(powerprofilesctl get)") if [[ "$profile" == "CNCLD" || -z "$profile" ]]; then - show_main_menu + back_to show_setup_menu else powerprofilesctl set "$profile" fi @@ -227,14 +244,14 @@ show_install_ai_menu() { echo ollama ) - case $(menu "Install" "󱚤 Claude Code\n󱚤 Gemini\n󱚤 OpenAI Codex [AUR]\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush\n󱚤 opencode") in + case $(menu "Install" "󱚤 Claude Code\n󱚤 Gemini [AUR]\n󱚤 OpenAI Codex [AUR]\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush\n󱚤 opencode") in *Claude*) install "Claude Code" "claude-code" ;; *OpenAI*) aur_install "OpenAI Codex" "openai-codex-bin" ;; - *Gemini*) install "Gemini" "gemini-cli" ;; + *Gemini*) aur_install "Gemini" "gemini-cli" ;; *Studio*) install "LM Studio" "lmstudio" ;; *Ollama*) install "Ollama" $ollama_pkg ;; *Crush*) install "Crush" "crush-bin" ;; - *opencode*) install "opencode" "opencode-bin" ;; + *opencode*) install "opencode" "opencode" ;; *) show_install_menu ;; esac } @@ -243,7 +260,7 @@ show_install_gaming_menu() { case $(menu "Install" " Steam\n RetroArch [AUR]\n󰍳 Minecraft") in *Steam*) present_terminal omarchy-install-steam ;; *RetroArch*) aur_install_and_launch "RetroArch" "retroarch retroarch-assets libretro libretro-fbneo" "com.libretro.RetroArch.desktop" ;; - *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;; + *Minecraft*) aur_install_and_launch "Minecraft [AUR]" "minecraft-launcher" "minecraft-launcher" ;; *) show_install_menu ;; esac } @@ -268,7 +285,7 @@ show_install_font_menu() { } show_install_development_menu() { - case $(menu "Install" "󰫏 Ruby on Rails\n Docker DB\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml") in + case $(menu "Install" "󰫏 Ruby on Rails\n Docker DB\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml\n Clojure") in *Rails*) present_terminal "omarchy-install-dev-env ruby" ;; *Docker*) present_terminal omarchy-install-docker-dbs ;; *JavaScript*) show_install_javascript_menu ;; @@ -281,6 +298,7 @@ show_install_development_menu() { *Java*) present_terminal "omarchy-install-dev-env java" ;; *NET*) present_terminal "omarchy-install-dev-env dotnet" ;; *OCaml*) present_terminal "omarchy-install-dev-env ocaml" ;; + *Clojure*) present_terminal "omarchy-install-dev-env clojure" ;; *) show_install_menu ;; esac } @@ -324,13 +342,14 @@ show_remove_menu() { } show_update_menu() { - case $(menu "Update" " Omarchy\n Config\n󰸌 Themes\n Process\n󰇅 Hardware\n Timezone") in + case $(menu "Update" " Omarchy\n Config\n󰸌 Themes\n Process\n󰇅 Hardware\n Password\n Timezone") in *Omarchy*) present_terminal omarchy-update ;; *Config*) show_update_config_menu ;; *Themes*) present_terminal omarchy-theme-update ;; *Process*) show_update_process_menu ;; *Hardware*) show_update_hardware_menu ;; *Timezone*) omarchy-cmd-tzupdate ;; + *Password*) show_update_password_menu ;; *) show_main_menu ;; esac } @@ -368,6 +387,14 @@ show_update_hardware_menu() { esac } +show_update_password_menu() { + case $(menu "Update Password" " Drive Encryption\n User") in + *Drive*) present_terminal omarchy-drive-set-password ;; + *User*) present_terminal passwd ;; + *) show_update_menu ;; + esac +} + show_system_menu() { case $(menu "System" " Lock\n󱄄 Screensaver\n󰤄 Suspend\n Relaunch\n󰜉 Restart\n󰐥 Shutdown") in *Lock*) omarchy-lock-screen ;; @@ -376,7 +403,7 @@ show_system_menu() { *Relaunch*) uwsm stop ;; *Restart*) systemctl reboot ;; *Shutdown*) systemctl poweroff ;; - *) show_main_menu ;; + *) back_to show_main_menu ;; esac } @@ -405,6 +432,7 @@ go_to_menu() { } if [[ -n "$1" ]]; then + BACK_TO_EXIT=true go_to_menu "$1" else show_main_menu diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index 99a49c1..1d1b40a 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -83,7 +83,11 @@ parse_bindings() { }' } +monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height') +menu_height=$((monitor_height * 40 / 100)) + dynamic_bindings | \ sort -u | \ parse_bindings | \ - walker --dmenu --theme keybindings -p 'Keybindings' + walker --dmenu --theme keybindings -p 'Keybindings' -w 800 -h "$menu_height" + diff --git a/bin/omarchy-pkg-aur-install b/bin/omarchy-pkg-aur-install index c99ee71..97be84b 100755 --- a/bin/omarchy-pkg-aur-install +++ b/bin/omarchy-pkg-aur-install @@ -1,7 +1,5 @@ #!/bin/bash -set -e - fzf_args=( --multi --preview 'yay -Sii {1}' diff --git a/bin/omarchy-pkg-install b/bin/omarchy-pkg-install index 8a6c1ce..c654e17 100755 --- a/bin/omarchy-pkg-install +++ b/bin/omarchy-pkg-install @@ -1,7 +1,5 @@ #!/bin/bash -set -e - fzf_args=( --multi --preview 'pacman -Sii {1}' @@ -19,6 +17,5 @@ pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}") if [[ -n "$pkg_names" ]]; then # Convert newline-separated selections to space-separated for yay echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm - sudo updatedb omarchy-show-done fi diff --git a/bin/omarchy-pkg-remove b/bin/omarchy-pkg-remove index 5408aa9..63c6147 100755 --- a/bin/omarchy-pkg-remove +++ b/bin/omarchy-pkg-remove @@ -17,6 +17,5 @@ pkg_names=$(yay -Qqe | fzf "${fzf_args[@]}") if [[ -n "$pkg_names" ]]; then # Convert newline-separated selections to space-separated for yay echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -Rns --noconfirm - sudo updatedb omarchy-show-done fi diff --git a/bin/omarchy-setup-dns b/bin/omarchy-setup-dns index 119ab40..472b555 100755 --- a/bin/omarchy-setup-dns +++ b/bin/omarchy-setup-dns @@ -37,8 +37,6 @@ EOF DHCP) sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF' [Resolve] -DNS= -FallbackDNS= DNSOverTLS=no EOF diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf index 64814ca..6990753 100644 --- a/config/hypr/bindings.conf +++ b/config/hypr/bindings.conf @@ -2,7 +2,7 @@ $terminal = uwsm app -- alacritty $browser = omarchy-launch-browser -bindd = SUPER, return, Terminal, exec, $terminal --working-directory=$(omarchy-cmd-terminal-cwd) +bindd = SUPER, return, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)" bindd = SUPER, F, File manager, exec, uwsm app -- nautilus --new-window bindd = SUPER, B, Browser, exec, $browser bindd = SUPER, M, Music, exec, uwsm app -- spotify diff --git a/config/hypr/input.conf b/config/hypr/input.conf index 397ddcf..20d208c 100644 --- a/config/hypr/input.conf +++ b/config/hypr/input.conf @@ -9,6 +9,9 @@ input { repeat_rate = 40 repeat_delay = 600 + # Start with numlock on by default + numlock_by_default = true + # Increase sensitity for mouse/trackpack (default: 0) # sensitivity = 0.35 diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index 93873b7..0ec9af4 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -57,8 +57,8 @@ "on-click": "alacritty -e btop" }, "clock": { - "format": "{:%A %H:%M}", - "format-alt": "{:%d %B W%V %Y}", + "format": "{:L%A %H:%M}", + "format-alt": "{:L%d %B W%V %Y}", "tooltip": false, "on-click-right": "omarchy-cmd-tzupdate" }, diff --git a/default/hypr/apps/browser.conf b/default/hypr/apps/browser.conf index c24f284..1ff1815 100644 --- a/default/hypr/apps/browser.conf +++ b/default/hypr/apps/browser.conf @@ -1,6 +1,6 @@ # Browser types windowrule = tag +chromium-based-browser, class:([cC]hrom(e|ium)|[bB]rave-browser|Microsoft-edge|Vivaldi-stable) -windowrule = tag +firefox-based-browser, class:(Firefox|zen|librewolf) +windowrule = tag +firefox-based-browser, class:([fF]irefox|zen|librewolf) # Force chromium-based browsers into a tile to deal with --app bug windowrule = tile, tag:chromium-based-browser @@ -10,4 +10,4 @@ windowrule = opacity 1 0.97, tag:chromium-based-browser windowrule = opacity 1 0.97, tag:firefox-based-browser # Some video sites should never have opacity applied to them -windowrule = opacity 1.0 1.0, initialTitle:(youtube\.com_/|app\.zoom\.us_/wc/home) +windowrule = opacity 1.0 1.0, initialTitle:((?i)(?:[a-z0-9-]+\.)*youtube\.com_/|app\.zoom\.us_/wc/home) diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index 1dee6fe..7694679 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -7,7 +7,7 @@ bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings # Aesthetics -bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, pkill -SIGUSR1 waybar +bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar bindd = SUPER CTRL, SPACE, Next background in theme, exec, omarchy-theme-bg-next bindd = SUPER SHIFT CTRL, SPACE, Pick new theme, exec, omarchy-menu theme @@ -33,8 +33,10 @@ bindd = SHIFT, PRINT, Screenshot of window, exec, omarchy-cmd-screenshot window bindd = CTRL, PRINT, Screenshot of display, exec, omarchy-cmd-screenshot output # Screen recordings -bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord +bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord region +bindd = ALT SHIFT, PRINT, Screen record a region with audio, exec, omarchy-cmd-screenrecord region audio bindd = CTRL ALT, PRINT, Screen record display, exec, omarchy-cmd-screenrecord output +bindd = CTRL ALT SHIFT, PRINT, Screen record display with audio, exec, omarchy-cmd-screenrecord output audio # Color picker bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a diff --git a/default/hypr/envs.conf b/default/hypr/envs.conf index 83f11ed..92d1544 100644 --- a/default/hypr/envs.conf +++ b/default/hypr/envs.conf @@ -10,6 +10,11 @@ env = SDL_VIDEODRIVER,wayland env = MOZ_ENABLE_WAYLAND,1 env = ELECTRON_OZONE_PLATFORM_HINT,wayland env = OZONE_PLATFORM,wayland +env = XDG_SESSION_TYPE,wayland + +# Allow better support for screen sharing (Google Meet, Discord, etc) +env = XDG_CURRENT_DESKTOP,Hyprland +env = XDG_SESSION_DESKTOP,Hyprland xwayland { force_zero_scaling = true diff --git a/default/mako/core.ini b/default/mako/core.ini new file mode 100644 index 0000000..0301e82 --- /dev/null +++ b/default/mako/core.ini @@ -0,0 +1,16 @@ +anchor=top-right +default-timeout=5000 +width=420 +height=110 + +[app-name=Spotify] +invisible=1 + +[mode=do-not-disturb] +invisible=true + +[mode=do-not-disturb app-name=notify-send] +invisible=false + +[urgency=critical] +default-timeout=0 \ No newline at end of file diff --git a/install.sh b/install.sh index f13de37..3e86f2e 100755 --- a/install.sh +++ b/install.sh @@ -41,12 +41,14 @@ source $OMARCHY_INSTALL/config/mimetypes.sh source $OMARCHY_INSTALL/config/localdb.sh source $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh source $OMARCHY_INSTALL/config/hardware/network.sh +source $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh source $OMARCHY_INSTALL/config/hardware/fix-fkeys.sh source $OMARCHY_INSTALL/config/hardware/bluetooth.sh source $OMARCHY_INSTALL/config/hardware/printer.sh source $OMARCHY_INSTALL/config/hardware/usb-autosuspend.sh source $OMARCHY_INSTALL/config/hardware/ignore-power-button.sh source $OMARCHY_INSTALL/config/hardware/nvidia.sh +source $OMARCHY_INSTALL/config/hardware/intel.sh source $OMARCHY_INSTALL/config/hardware/fix-f13-amd-audio-input.sh # Login diff --git a/install/config/git.sh b/install/config/git.sh index 54bb4bd..4864a29 100755 --- a/install/config/git.sh +++ b/install/config/git.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Ensure git settings live under ~/.config +mkdir -p ~/.config/git +touch ~/.config/git/config + # Set common git aliases git config --global alias.co checkout git config --global alias.br branch diff --git a/install/config/hardware/intel.sh b/install/config/hardware/intel.sh new file mode 100755 index 0000000..5c45e78 --- /dev/null +++ b/install/config/hardware/intel.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# This installs hardware video acceleration for Intel GPUs +# Check if we have an Intel GPU at all +if INTEL_GPU=$(lspci | grep -iE 'vga|3d|display' | grep -i 'intel'); then + # HD Graphics and newer uses intel-media-driver + if [[ "${INTEL_GPU,,}" =~ "hd graphics"|"xe"|"iris" ]]; then + sudo pacman -S --needed --noconfirm intel-media-driver + elif [[ "${INTEL_GPU,,}" =~ "gma" ]]; then + # Older generations from 2008 to ~2014-2017 use libva-intel-driver + sudo pacman -S --needed --noconfirm libva-intel-driver + fi +fi + diff --git a/install/config/hardware/printer.sh b/install/config/hardware/printer.sh index 5a752b2..b737b49 100755 --- a/install/config/hardware/printer.sh +++ b/install/config/hardware/printer.sh @@ -7,6 +7,9 @@ sudo mkdir -p /etc/systemd/resolved.conf.d echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf chrootable_systemctl_enable avahi-daemon.service +# Enable mDNS resolution for .local domains +sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf + # Enable automatically adding remote printers if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf diff --git a/install/config/hardware/set-wireless-regdom.sh b/install/config/hardware/set-wireless-regdom.sh new file mode 100755 index 0000000..d4a9362 --- /dev/null +++ b/install/config/hardware/set-wireless-regdom.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# First check that wireless-regdb is there +if [ -f "/etc/conf.d/wireless-regdom" ]; then + unset WIRELESS_REGDOM + . /etc/conf.d/wireless-regdom +fi + +# If the region is already set, we're done +if [ ! -n "${WIRELESS_REGDOM}" ]; then + # Get the current timezone + if [ -e "/etc/localtime" ]; then + TIMEZONE=$(readlink -f /etc/localtime) + TIMEZONE=${TIMEZONE#/usr/share/zoneinfo/} + + # Some timezones are formatted with the two letter country code at the start + COUNTRY="${TIMEZONE%%/*}" + + # If we don't have a two letter country, get it from the timezone table + if [[ ! "$COUNTRY" =~ ^[A-Z]{2}$ ]] && [ -f "/usr/share/zoneinfo/zone.tab" ]; then + COUNTRY=$(awk -v tz="$TIMEZONE" '$3 == tz {print $1; exit}' /usr/share/zoneinfo/zone.tab) + fi + + # Check if we have a two letter country code + if [[ "$COUNTRY" =~ ^[A-Z]{2}$ ]]; then + # Append it to the wireless-regdom conf file that is used at boot + echo "WIRELESS_REGDOM=\"$COUNTRY\"" | sudo tee -a /etc/conf.d/wireless-regdom > /dev/null + + # Also set it one off now + if command -v iw &> /dev/null; then + sudo iw reg set ${COUNTRY} + fi + fi + fi +fi + diff --git a/install/config/theme.sh b/install/config/theme.sh index 4bc7e32..17cda3c 100755 --- a/install/config/theme.sh +++ b/install/config/theme.sh @@ -26,3 +26,4 @@ ln -snf ~/.config/omarchy/current/theme/btop.theme ~/.config/btop/themes/current mkdir -p ~/.config/mako ln -snf ~/.config/omarchy/current/theme/mako.ini ~/.config/mako/config + diff --git a/install/first-run/firewall.sh b/install/first-run/firewall.sh index efd1159..c802467 100755 --- a/install/first-run/firewall.sh +++ b/install/first-run/firewall.sh @@ -17,6 +17,9 @@ sudo ufw allow in proto udp from 172.16.0.0/12 to 172.17.0.1 port 53 comment 'al # Turn on the firewall sudo ufw --force enable +# Enable UFW systemd service to start on boot +sudo systemctl enable ufw + # Turn on Docker protections sudo ufw-docker install sudo ufw reload diff --git a/install/packages.sh b/install/packages.sh index ca9621a..e1fd977 100644 --- a/install/packages.sh +++ b/install/packages.sh @@ -114,6 +114,7 @@ sudo pacman -S --noconfirm --needed \ waybar \ wf-recorder \ whois \ + wireless-regdb \ wiremix \ wireplumber \ wl-clip-persist \ diff --git a/migrations/1756911131.sh b/migrations/1756911131.sh new file mode 100755 index 0000000..6747ab0 --- /dev/null +++ b/migrations/1756911131.sh @@ -0,0 +1,11 @@ +echo "Enable UFW systemd service for existing installations" + +if omarchy-cmd-present ufw; then + if sudo ufw status | grep -q "Status: active\|22/tcp\|53317"; then + if ! systemctl is-enabled ufw >/dev/null 2>&1; then + sudo systemctl enable ufw --now + echo "UFW systemd service enabled" + fi + fi +fi + diff --git a/migrations/1757279511.sh b/migrations/1757279511.sh new file mode 100644 index 0000000..dc4588c --- /dev/null +++ b/migrations/1757279511.sh @@ -0,0 +1,6 @@ +echo "Add locale to the waybar clock format" + +sed -i \ + -e 's/{:%A %H:%M}/{:L%A %H:%M}/' \ + -e 's/{:%d %B W%V %Y}/{:L%d %B W%V %Y}/' \ + "$HOME/.config/waybar/config.jsonc" \ No newline at end of file diff --git a/migrations/1757361127.sh b/migrations/1757361127.sh new file mode 100644 index 0000000..5c23e00 --- /dev/null +++ b/migrations/1757361127.sh @@ -0,0 +1,8 @@ +echo "Fix DHCP DNS to allow VPN DNS override" + +if [ -f /etc/systemd/resolved.conf ]; then + if grep -q "^DNS=$" /etc/systemd/resolved.conf && grep -q "^FallbackDNS=$" /etc/systemd/resolved.conf; then + sudo sed -i '/^DNS=$/d; /^FallbackDNS=$/d' /etc/systemd/resolved.conf + sudo systemctl restart systemd-resolved + fi +fi \ No newline at end of file diff --git a/migrations/1757361128.sh b/migrations/1757361128.sh new file mode 100644 index 0000000..b6c8413 --- /dev/null +++ b/migrations/1757361128.sh @@ -0,0 +1,7 @@ +echo "Enable mDNS resolution for existing Avahi installations" + +if systemctl is-enabled avahi-daemon.service >/dev/null 2>&1; then + if ! grep -q "mdns_minimal" /etc/nsswitch.conf; then + sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf + fi +fi \ No newline at end of file diff --git a/themes/catppuccin-latte/mako.ini b/themes/catppuccin-latte/mako.ini index ce8b8f3..6461da0 100644 --- a/themes/catppuccin-latte/mako.ini +++ b/themes/catppuccin-latte/mako.ini @@ -1,25 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#4c4f69 border-color=#1e66f5 background-color=#eff1f5 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/catppuccin/mako.ini b/themes/catppuccin/mako.ini index e1caf53..dc5f9c6 100644 --- a/themes/catppuccin/mako.ini +++ b/themes/catppuccin/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#cad3f5 border-color=#c6d0f5 background-color=#24273a -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/everforest/mako.ini b/themes/everforest/mako.ini index a083610..05b50e8 100644 --- a/themes/everforest/mako.ini +++ b/themes/everforest/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#d3c6aa border-color=#d3c6aa background-color=#2d353b -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/gruvbox/mako.ini b/themes/gruvbox/mako.ini index 2d70b15..669c6f5 100644 --- a/themes/gruvbox/mako.ini +++ b/themes/gruvbox/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#d4be98 border-color=#a89984 background-color=#282828 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/kanagawa/mako.ini b/themes/kanagawa/mako.ini index d3ad11c..fe944d8 100644 --- a/themes/kanagawa/mako.ini +++ b/themes/kanagawa/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#dcd7ba border-color=#dcd7ba background-color=#1f1f28 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/matte-black/backgrounds/0-ship-at-sea.jpg b/themes/matte-black/backgrounds/0-ship-at-sea.jpg new file mode 100644 index 0000000..4375ee2 Binary files /dev/null and b/themes/matte-black/backgrounds/0-ship-at-sea.jpg differ diff --git a/themes/matte-black/mako.ini b/themes/matte-black/mako.ini index 1af552e..a0e6653 100644 --- a/themes/matte-black/mako.ini +++ b/themes/matte-black/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#8a8a8d border-color=#8A8A8D background-color=#1e1e1e -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 diff --git a/themes/nord/mako.ini b/themes/nord/mako.ini index 8c3c319..2976506 100644 --- a/themes/nord/mako.ini +++ b/themes/nord/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#d8dee9 border-color=#D8DEE9 background-color=#2e3440 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/osaka-jade/mako.ini b/themes/osaka-jade/mako.ini index c45635d..4489799 100644 --- a/themes/osaka-jade/mako.ini +++ b/themes/osaka-jade/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#C1C497 border-color=#214237 background-color=#11221C -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 12 -anchor=top-right -outer-margin=5 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=5 \ No newline at end of file diff --git a/themes/ristretto/alacritty.toml b/themes/ristretto/alacritty.toml index c716798..45236ef 100644 --- a/themes/ristretto/alacritty.toml +++ b/themes/ristretto/alacritty.toml @@ -22,7 +22,7 @@ white = "#f1e5e7" [colors.cursor] cursor = '#c3b7b8' -text = '#c3b7b8' +text = '#2c2525' [colors.primary] background = '#2c2525' diff --git a/themes/ristretto/mako.ini b/themes/ristretto/mako.ini index 7af1812..a88e281 100644 --- a/themes/ristretto/mako.ini +++ b/themes/ristretto/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#e6d9db border-color=#e6d9db background-color=#2c2525 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/rose-pine/mako.ini b/themes/rose-pine/mako.ini index 65aef34..10f76e5 100644 --- a/themes/rose-pine/mako.ini +++ b/themes/rose-pine/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#575279 border-color=#575279 background-color=#faf4ed -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file diff --git a/themes/tokyo-night/mako.ini b/themes/tokyo-night/mako.ini index bf76a33..c0fae2e 100644 --- a/themes/tokyo-night/mako.ini +++ b/themes/tokyo-night/mako.ini @@ -1,24 +1,10 @@ +include=~/.local/share/omarchy/default/mako/core.ini + text-color=#a9b1d6 border-color=#33ccff background-color=#1a1b26 -width=420 -height=110 padding=10 border-size=2 font=Liberation Sans 11 -anchor=top-right -outer-margin=20 -default-timeout=5000 max-icon-size=32 - -[app-name=Spotify] -invisible=1 - -[mode=do-not-disturb] -invisible=true - -[mode=do-not-disturb app-name=notify-send] -invisible=false - -[urgency=critical] -default-timeout=0 +outer-margin=20 \ No newline at end of file