Merge branch 'dev' into omarchy-shell
This commit is contained in:
@@ -21,7 +21,7 @@ time_remaining=$(omarchy-battery-remaining-time)
|
||||
capacity=$(omarchy-battery-capacity)
|
||||
|
||||
if [[ $state == "charging" ]]; then
|
||||
echo " Battery ${percentage}% · ${time_remaining} to full · ${power_rate}W / ${capacity}Wh"
|
||||
echo "Battery ${percentage}% · ${time_remaining} to full · ${power_rate}W / ${capacity}Wh"
|
||||
else
|
||||
echo " Battery ${percentage}% · ${time_remaining} left · ${power_rate}W / ${capacity}Wh"
|
||||
echo "Battery ${percentage}% · ${time_remaining} left · ${power_rate}W / ${capacity}Wh"
|
||||
fi
|
||||
|
||||
@@ -44,11 +44,6 @@ if grep -Fq "$SWAP_FILE" /etc/fstab; then
|
||||
sudo sed -i '/^# Btrfs swapfile for system hibernation$/d' /etc/fstab
|
||||
fi
|
||||
|
||||
# Remove suspend-then-hibernate configuration
|
||||
echo "Removing suspend-then-hibernate configuration"
|
||||
sudo rm -f /etc/systemd/logind.conf.d/lid.conf
|
||||
sudo rm -f /etc/systemd/sleep.conf.d/hibernate.conf
|
||||
|
||||
# Remove mkinitcpio resume hook
|
||||
echo "Removing resume hook"
|
||||
sudo rm "$MKINITCPIO_CONF"
|
||||
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Install Sunshine and open Moonlight streaming ports for LAN and Tailscale.
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
TCP_PORTS=(47984 47989 48010)
|
||||
UDP_PORTS=(5353 47998 47999 48000 48002 48010)
|
||||
PRIVATE_CIDRS=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16)
|
||||
UFW_COMMENT="omarchy-sunshine"
|
||||
SUNSHINE_ADMIN_APP="Sunshine Admin"
|
||||
SUNSHINE_ADMIN_URL="https://localhost:47990"
|
||||
SUNSHINE_ADMIN_EXEC="omarchy-launch-webapp $SUNSHINE_ADMIN_URL --ignore-certificate-errors"
|
||||
SUNSHINE_ICON_SOURCE="/usr/share/sunshine/web/images/logo-sunshine-45.png"
|
||||
SUNSHINE_ICON_NAME="Sunshine Admin.png"
|
||||
WEBAPP_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
HYPR_AUTOSTART_FILE="$HOME/.config/hypr/autostart.lua"
|
||||
HYPR_AUTOSTART_ENTRY='o.launch_on_start("sunshine")'
|
||||
|
||||
open_ufw_port_for_private_lans() {
|
||||
local proto="$1"
|
||||
local port="$2"
|
||||
local cidr
|
||||
|
||||
for cidr in "${PRIVATE_CIDRS[@]}"; do
|
||||
sudo ufw allow in proto "$proto" from "$cidr" to any port "$port" comment "$UFW_COMMENT"
|
||||
done
|
||||
}
|
||||
|
||||
open_ufw_port_for_tailscale() {
|
||||
local proto="$1"
|
||||
local port="$2"
|
||||
|
||||
if ip link show tailscale0 >/dev/null 2>&1; then
|
||||
sudo ufw allow in on tailscale0 to any port "$port" proto "$proto" comment "$UFW_COMMENT"
|
||||
fi
|
||||
}
|
||||
|
||||
open_ufw_ports() {
|
||||
local port
|
||||
|
||||
if omarchy-cmd-missing ufw; then
|
||||
echo "UFW is not installed; skipping Sunshine firewall rules."
|
||||
return
|
||||
fi
|
||||
|
||||
for port in "${TCP_PORTS[@]}"; do
|
||||
open_ufw_port_for_private_lans tcp "$port"
|
||||
open_ufw_port_for_tailscale tcp "$port"
|
||||
done
|
||||
|
||||
for port in "${UDP_PORTS[@]}"; do
|
||||
open_ufw_port_for_private_lans udp "$port"
|
||||
open_ufw_port_for_tailscale udp "$port"
|
||||
done
|
||||
|
||||
sudo ufw reload
|
||||
}
|
||||
|
||||
install_admin_webapp() {
|
||||
mkdir -p "$WEBAPP_ICON_DIR"
|
||||
cp "$SUNSHINE_ICON_SOURCE" "$WEBAPP_ICON_DIR/$SUNSHINE_ICON_NAME"
|
||||
omarchy-webapp-install "$SUNSHINE_ADMIN_APP" "$SUNSHINE_ADMIN_URL" "$SUNSHINE_ICON_NAME" "$SUNSHINE_ADMIN_EXEC"
|
||||
omarchy-restart-walker
|
||||
}
|
||||
|
||||
enable_hyprland_autostart() {
|
||||
mkdir -p "$(dirname "$HYPR_AUTOSTART_FILE")"
|
||||
touch "$HYPR_AUTOSTART_FILE"
|
||||
|
||||
if ! grep -Fxq "$HYPR_AUTOSTART_ENTRY" "$HYPR_AUTOSTART_FILE"; then
|
||||
printf '\n%s\n' "$HYPR_AUTOSTART_ENTRY" >>"$HYPR_AUTOSTART_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Installing Sunshine..."
|
||||
omarchy-pkg-add sunshine
|
||||
systemctl --user enable --now sunshine
|
||||
|
||||
echo "Opening Sunshine firewall ports..."
|
||||
open_ufw_ports
|
||||
|
||||
echo "Installing Sunshine admin web app..."
|
||||
install_admin_webapp
|
||||
$SUNSHINE_ADMIN_EXEC >/dev/null 2>&1 &
|
||||
|
||||
echo "Enabling Sunshine autostart..."
|
||||
enable_hyprland_autostart
|
||||
|
||||
echo ""
|
||||
echo "Sunshine has been installed and its Moonlight streaming ports are open for private LANs and Tailscale."
|
||||
@@ -30,10 +30,10 @@ if omarchy-pkg-add $package; then
|
||||
# Copy custom desktop entries with X-TerminalArg* keys
|
||||
if [[ $package == "alacritty" ]]; then
|
||||
mkdir -p ~/.local/share/applications
|
||||
cp "$OMARCHY_PATH/applications/$desktop_id" ~/.local/share/applications/
|
||||
cp "$OMARCHY_PATH/default/alacritty/$desktop_id" ~/.local/share/applications/
|
||||
elif [[ $package == "foot" ]]; then
|
||||
mkdir -p ~/.local/share/applications
|
||||
cp "$OMARCHY_PATH/default/foot/$desktop_id" ~/.local/share/applications/
|
||||
cp "$OMARCHY_PATH/applications/$desktop_id" ~/.local/share/applications/
|
||||
fi
|
||||
|
||||
# Copy default config for optional terminals when missing
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
default_browser=$(xdg-settings get default-web-browser)
|
||||
browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$default_browser 2>/dev/null | head -1)
|
||||
|
||||
if $browser_exec --help | grep -q MOZ_LOG; then
|
||||
if $browser_exec --help 2>/dev/null | grep -q MOZ_LOG; then
|
||||
private_flag="--private-window"
|
||||
elif [[ $browser_exec =~ edge ]]; then
|
||||
private_flag="--inprivate"
|
||||
@@ -14,4 +14,6 @@ else
|
||||
private_flag="--incognito"
|
||||
fi
|
||||
|
||||
exec setsid uwsm-app -- "$browser_exec" "${@/--private/$private_flag}"
|
||||
systemd-run --user --quiet --collect --unit="omarchy-browser-$(date +%s%N)" \
|
||||
--property=StandardOutput=null --property=StandardError=null \
|
||||
uwsm-app -- "$browser_exec" "${@/--private/$private_flag}"
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Launch Files
|
||||
|
||||
exec setsid uwsm-app -- nautilus --new-window
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Launch Files in the active terminal's current directory
|
||||
|
||||
exec setsid uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Launch a terminal in the active terminal's current directory
|
||||
# omarchy:args=[command...]
|
||||
|
||||
exec setsid uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" "$@"
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Launch or attach to the Work tmux session in a terminal
|
||||
|
||||
exec omarchy-launch-terminal bash -c "tmux attach || tmux new -s Work"
|
||||
@@ -187,7 +187,7 @@ hl = setmetatable({
|
||||
end,
|
||||
})
|
||||
|
||||
local config = (os.getenv("HOME") or "") .. "/.config/hypr/hyprland.lua"
|
||||
local config = os.getenv("HOME") .. "/.config/hypr/hyprland.lua"
|
||||
local file = io.open(config, "r")
|
||||
|
||||
if file then
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Show the current battery status notification
|
||||
|
||||
omarchy-notification-send -g -u low "$(omarchy-battery-status)"
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Show the current time and date notification
|
||||
|
||||
omarchy-notification-send -g -u low "$(date +"%A %H:%M · %d %B %Y · Week %V")"
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Show the current weather notification
|
||||
|
||||
omarchy-notification-send -g $(omarchy-weather-icon) -u low "$(omarchy-weather-status)"
|
||||
@@ -11,8 +11,8 @@ mkdir -p ~/.local/share/applications
|
||||
cp ~/.local/share/omarchy/applications/*.desktop ~/.local/share/applications/
|
||||
cp ~/.local/share/omarchy/applications/hidden/*.desktop ~/.local/share/applications/
|
||||
|
||||
if omarchy-cmd-present foot; then
|
||||
cp ~/.local/share/omarchy/default/foot/foot.desktop ~/.local/share/applications/
|
||||
if omarchy-cmd-present alacritty; then
|
||||
cp ~/.local/share/omarchy/default/alacritty/alacritty.desktop ~/.local/share/applications/
|
||||
fi
|
||||
|
||||
# Refresh the webapps, TUIs, and npx wrappers
|
||||
|
||||
@@ -9,4 +9,5 @@ omarchy-refresh-config hypr/input.lua
|
||||
omarchy-refresh-config hypr/looknfeel.lua
|
||||
omarchy-refresh-config hypr/hyprland.lua
|
||||
omarchy-refresh-config hypr/monitors.lua
|
||||
bash "$OMARCHY_PATH/install/config/omarchy-toggles.sh"
|
||||
bash "$OMARCHY_PATH/install/config/detect-keyboard-layout.sh"
|
||||
|
||||
@@ -6,6 +6,6 @@ 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 --branch master "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
|
||||
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Remove Sunshine and close Omarchy-managed Moonlight streaming ports.
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
TCP_PORTS=(47984 47989 48010)
|
||||
UDP_PORTS=(5353 47998 47999 48000 48002 48010)
|
||||
PRIVATE_CIDRS=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16)
|
||||
SUNSHINE_ADMIN_APP="Sunshine Admin"
|
||||
HYPR_AUTOSTART_FILE="$HOME/.config/hypr/autostart.lua"
|
||||
HYPR_AUTOSTART_ENTRY='o.launch_on_start("sunshine")'
|
||||
|
||||
delete_ufw_rule() {
|
||||
sudo ufw --force delete "$@" 2>/dev/null || true
|
||||
}
|
||||
|
||||
close_ufw_port_for_private_lans() {
|
||||
local proto="$1"
|
||||
local port="$2"
|
||||
local cidr
|
||||
|
||||
for cidr in "${PRIVATE_CIDRS[@]}"; do
|
||||
delete_ufw_rule allow in proto "$proto" from "$cidr" to any port "$port"
|
||||
done
|
||||
}
|
||||
|
||||
close_ufw_port_for_tailscale() {
|
||||
local proto="$1"
|
||||
local port="$2"
|
||||
|
||||
delete_ufw_rule allow in on tailscale0 to any port "$port" proto "$proto"
|
||||
}
|
||||
|
||||
close_ufw_ports() {
|
||||
local port
|
||||
|
||||
if omarchy-cmd-missing ufw; then
|
||||
return
|
||||
fi
|
||||
|
||||
for port in "${TCP_PORTS[@]}"; do
|
||||
close_ufw_port_for_private_lans tcp "$port"
|
||||
close_ufw_port_for_tailscale tcp "$port"
|
||||
done
|
||||
|
||||
for port in "${UDP_PORTS[@]}"; do
|
||||
close_ufw_port_for_private_lans udp "$port"
|
||||
close_ufw_port_for_tailscale udp "$port"
|
||||
done
|
||||
|
||||
sudo ufw reload
|
||||
}
|
||||
|
||||
disable_hyprland_autostart() {
|
||||
if [[ -f $HYPR_AUTOSTART_FILE ]]; then
|
||||
sed -i "\|^$HYPR_AUTOSTART_ENTRY$|d" "$HYPR_AUTOSTART_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
systemctl --user disable --now sunshine 2>/dev/null || true
|
||||
omarchy-pkg-drop sunshine
|
||||
omarchy-webapp-remove "$SUNSHINE_ADMIN_APP" 2>/dev/null || true
|
||||
disable_hyprland_autostart
|
||||
close_ufw_ports
|
||||
|
||||
echo ""
|
||||
echo "Sunshine has been removed and its Omarchy-managed Moonlight streaming ports have been closed."
|
||||
@@ -12,4 +12,4 @@ progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
|
||||
omarchy-swayosd-client \
|
||||
--custom-icon display-brightness-symbolic \
|
||||
--custom-progress "$progress" \
|
||||
--custom-progress-text "${percent}%"
|
||||
--custom-progress-text "$(printf '%3d%%' "$percent")"
|
||||
|
||||
@@ -9,7 +9,8 @@ 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
|
||||
hyprctl eval 'hl.config({ 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
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
echo
|
||||
|
||||
confirm_reboot() {
|
||||
gum confirm "$1" && { omarchy-system-reboot; exit 0; }
|
||||
}
|
||||
|
||||
running_kernel=$(uname -r)
|
||||
kernel_updated=true
|
||||
|
||||
@@ -19,14 +23,14 @@ for kernel in /usr/lib/modules/*/vmlinuz; do
|
||||
done
|
||||
|
||||
if [[ $kernel_updated == "true" ]]; then
|
||||
gum confirm "Linux kernel has been updated. Reboot?" && omarchy-system-reboot
|
||||
confirm_reboot "Linux kernel has been updated. Reboot?"
|
||||
elif [[ -f $HOME/.local/state/omarchy/reboot-required ]]; then
|
||||
gum confirm "Updates require reboot. Ready?" && omarchy-system-reboot
|
||||
confirm_reboot "Updates require reboot. Ready?"
|
||||
fi
|
||||
|
||||
running_hyprland=$(readlink /proc/$(pgrep -x Hyprland)/exe 2>/dev/null)
|
||||
if [[ $running_hyprland == *"(deleted)"* ]]; then
|
||||
gum confirm "Hyprland has been updated. Reboot?" && omarchy-system-reboot
|
||||
confirm_reboot "Hyprland has been updated. Reboot?"
|
||||
fi
|
||||
|
||||
for file in "$HOME"/.local/state/omarchy/restart-*-required; do
|
||||
|
||||
@@ -11,12 +11,11 @@ if omarchy-cmd-present voxtype; then
|
||||
echo "Uninstall Voxtype to remove dictation."
|
||||
|
||||
# Remove services
|
||||
systemctl --user stop voxtype.service 2>/dev/null || true
|
||||
rm -f ~/.config/systemd/user/voxtype*
|
||||
systemctl --user disable --now voxtype.service 2>/dev/null || true
|
||||
systemctl --user daemon-reload
|
||||
|
||||
# Remove packages and configs
|
||||
omarchy-pkg-drop wtype voxtype-bin
|
||||
omarchy-pkg-drop voxtype-bin
|
||||
rm -rf ~/.config/voxtype
|
||||
rm -rf ~/.local/share/voxtype
|
||||
else
|
||||
|
||||
@@ -14,4 +14,4 @@ place=${place%%,*}
|
||||
place=${place^}
|
||||
temperature=${temperature#+}
|
||||
|
||||
echo "$(omarchy-weather-icon) $place · Temp $temperature · Wind $wind"
|
||||
echo "$place · Temp $temperature · Wind $wind"
|
||||
|
||||
Reference in New Issue
Block a user