mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 20:28:19 +02:00
Compare commits
318
Commits
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true if AC power is connected.
|
||||
|
||||
for ac in /sys/class/power_supply/AC* /sys/class/power_supply/ADP*; do
|
||||
[[ -r $ac/online && $(cat "$ac/online") == "1" ]] && exit 0
|
||||
done
|
||||
|
||||
exit 1
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns the battery full capacity in Wh (rounded to whole number).
|
||||
# Used by omarchy-battery-status for displaying battery capacity.
|
||||
|
||||
battery_info=$(upower -i $(upower -e | grep BAT))
|
||||
|
||||
echo "$battery_info" | awk '/energy-full:/ {
|
||||
printf "%d", $2
|
||||
exit
|
||||
}'
|
||||
@@ -9,6 +9,7 @@ BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{pr
|
||||
|
||||
send_notification() {
|
||||
notify-send -u critical " Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000
|
||||
omarchy-hook battery-low "$1"
|
||||
}
|
||||
|
||||
if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns the battery time remaining (to empty or full) in a compact format.
|
||||
|
||||
battery_info=$(upower -i $(upower -e | grep BAT))
|
||||
|
||||
echo "$battery_info" | awk '/time to (empty|full)/ {
|
||||
value = $4
|
||||
unit = $5
|
||||
if (unit ~ /^minute/) {
|
||||
printf "%dm", int(value)
|
||||
} else {
|
||||
hours = int(value)
|
||||
minutes = int((value - hours) * 60)
|
||||
if (minutes > 0) {
|
||||
printf "%dh %dm", hours, minutes
|
||||
} else {
|
||||
printf "%dh", hours
|
||||
}
|
||||
}
|
||||
exit
|
||||
}'
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns a formatted battery status string with percentage and power draw/charge.
|
||||
# Used by the battery notification hotkey (Ctrl + Shift + Super + B).
|
||||
|
||||
battery_info=$(upower -i $(upower -e | grep BAT))
|
||||
|
||||
percentage=$(echo "$battery_info" | awk '/percentage/ {
|
||||
print int($2)
|
||||
exit
|
||||
}')
|
||||
|
||||
power_rate=$(echo "$battery_info" | awk '/energy-rate/ {
|
||||
rounded = sprintf("%.1f", $2)
|
||||
sub(/\.0$/, "", rounded)
|
||||
print rounded
|
||||
exit
|
||||
}')
|
||||
|
||||
state=$(echo "$battery_info" | awk '/state/ { print $2; exit }')
|
||||
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"
|
||||
else
|
||||
echo " Battery ${percentage}% · ${time_remaining} left · ${power_rate}W / ${capacity}Wh"
|
||||
fi
|
||||
@@ -23,14 +23,19 @@ fi
|
||||
max_brightness="$(brightnessctl -d "$device" max)"
|
||||
current_brightness="$(brightnessctl -d "$device" get)"
|
||||
|
||||
# Calculate step as one unit (keyboards typically have discrete levels like 0-3).
|
||||
# Calculate step as 10% of max brightness. Keyboards with many levels (e.g. 512)
|
||||
# need larger steps; keyboards with few levels (e.g. 3) fall back to step=1.
|
||||
step=$(( max_brightness / 10 ))
|
||||
(( step < 1 )) && step=1
|
||||
|
||||
if [[ $direction == "cycle" ]]; then
|
||||
new_brightness=$(( (current_brightness + 1) % (max_brightness + 1) ))
|
||||
new_brightness=$(( current_brightness + step ))
|
||||
(( new_brightness > max_brightness )) && new_brightness=0
|
||||
elif [[ $direction == "up" ]]; then
|
||||
new_brightness=$((current_brightness + 1))
|
||||
new_brightness=$(( current_brightness + step ))
|
||||
(( new_brightness > max_brightness )) && new_brightness=$max_brightness
|
||||
else
|
||||
new_brightness=$((current_brightness - 1))
|
||||
new_brightness=$(( current_brightness - step ))
|
||||
(( new_brightness < 0 )) && new_brightness=0
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Switch between audio outputs while preserving the mute status. By default mapped to Super + Mute.
|
||||
|
||||
focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"
|
||||
focused_monitor=$(omarchy-hyprland-monitor-focused)
|
||||
|
||||
sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]')
|
||||
sinks_count=$(echo "$sinks" | jq '. | length')
|
||||
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle microphone mute. Dell XPS systems get special handling for the hardware LED.
|
||||
|
||||
if omarchy-hw-match "XPS"; then
|
||||
omarchy-cmd-mic-mute-xps
|
||||
else
|
||||
swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" --input-volume mute-toggle
|
||||
fi
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle microphone mute on Dell XPS systems. Uses wpctl for reliable toggling
|
||||
# and syncs the ALSA capture switch so the hardware mic mute LED follows state.
|
||||
|
||||
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null
|
||||
|
||||
if pactl get-source-mute @DEFAULT_SOURCE@ | rg -q 'yes'; then
|
||||
alsa_value='off,off'
|
||||
osd_message='Microphone muted'
|
||||
osd_icon='microphone-sensitivity-muted-symbolic'
|
||||
else
|
||||
alsa_value='on,on'
|
||||
osd_message='Microphone on'
|
||||
osd_icon='audio-input-microphone-symbolic'
|
||||
fi
|
||||
|
||||
if [[ -e /sys/class/leds/platform::micmute/brightness ]]; then
|
||||
default_source=$(pactl get-default-source)
|
||||
alsa_card=$(pactl -f json list sources | jq -r --arg source "$default_source" '
|
||||
.[] | select(.name == $source) |
|
||||
.properties["alsa.card"] // .properties["api.alsa.card"] // .properties["api.alsa.pcm.card"] // empty
|
||||
' | head -1)
|
||||
|
||||
if [[ -n $alsa_card ]]; then
|
||||
cards=("$alsa_card")
|
||||
else
|
||||
mapfile -t cards < <(compgen -G '/proc/asound/card*' | rg -o 'card[0-9]+' | sed 's/card//' | sort -u)
|
||||
fi
|
||||
|
||||
for card in "${cards[@]}"; do
|
||||
while IFS= read -r control; do
|
||||
if [[ $control != *"Jack Microphone"* ]]; then
|
||||
amixer -c "$card" cset "$control" "$alsa_value" >/dev/null 2>&1 || true
|
||||
break 2
|
||||
fi
|
||||
done < <(amixer -c "$card" controls 2>/dev/null | rg -o "name='[^']*Microphone Capture Switch'")
|
||||
done
|
||||
fi
|
||||
|
||||
swayosd-client \
|
||||
--monitor "$(omarchy-hyprland-monitor-focused)" \
|
||||
--custom-message "$osd_message" \
|
||||
--custom-icon "$osd_icon"
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
# Start and stop a screenrecording, which will be saved to ~/Videos by default.
|
||||
# Alternative location can be set via OMARCHY_SCREENRECORD_DIR or XDG_VIDEOS_DIR ENVs.
|
||||
# Resolution is capped to 4K for monitors above 4K, native otherwise.
|
||||
# Override via --resolution= (e.g. --resolution=1920x1080, --resolution=0x0 for native).
|
||||
|
||||
[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
|
||||
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}"
|
||||
@@ -15,28 +17,27 @@ DESKTOP_AUDIO="false"
|
||||
MICROPHONE_AUDIO="false"
|
||||
WEBCAM="false"
|
||||
WEBCAM_DEVICE=""
|
||||
RESOLUTION=""
|
||||
STOP_RECORDING="false"
|
||||
RECORDING_FILE="/tmp/omarchy-screenrecord-filename"
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--with-desktop-audio) DESKTOP_AUDIO="true" ;;
|
||||
--with-microphone-audio) MICROPHONE_AUDIO="true" ;;
|
||||
--with-webcam) WEBCAM="true" ;;
|
||||
--webcam-device=*) WEBCAM_DEVICE="${arg#*=}" ;;
|
||||
--stop-recording) STOP_RECORDING="true"
|
||||
--with-desktop-audio) DESKTOP_AUDIO="true" ;;
|
||||
--with-microphone-audio) MICROPHONE_AUDIO="true" ;;
|
||||
--with-webcam) WEBCAM="true" ;;
|
||||
--webcam-device=*) WEBCAM_DEVICE="${arg#*=}" ;;
|
||||
--resolution=*) RESOLUTION="${arg#*=}" ;;
|
||||
--stop-recording) STOP_RECORDING="true" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
cleanup_webcam() {
|
||||
pkill -f "WebcamOverlay" 2>/dev/null
|
||||
}
|
||||
|
||||
start_webcam_overlay() {
|
||||
cleanup_webcam
|
||||
|
||||
# Auto-detect first available webcam if none specified
|
||||
if [[ -z $WEBCAM_DEVICE ]]; then
|
||||
WEBCAM_DEVICE=$(v4l2-ctl --list-devices 2>/dev/null | grep -m1 "^\s*/dev/video" | tr -d '\t')
|
||||
WEBCAM_DEVICE=$(v4l2-ctl --list-devices 2>/dev/null | grep -m1 "^[[:space:]]*/dev/video" | tr -d '\t')
|
||||
if [[ -z $WEBCAM_DEVICE ]]; then
|
||||
notify-send "No webcam devices found" -u critical -t 3000
|
||||
return 1
|
||||
@@ -62,7 +63,7 @@ start_webcam_overlay() {
|
||||
done
|
||||
|
||||
ffplay -f v4l2 $video_size_arg -framerate 30 "$WEBCAM_DEVICE" \
|
||||
-vf "scale=${target_width}:-1" \
|
||||
-vf "crop=iw/2:ih,scale=${target_width}:-1" \
|
||||
-window_title "WebcamOverlay" \
|
||||
-noborder \
|
||||
-fflags nobuffer -flags low_delay \
|
||||
@@ -71,10 +72,24 @@ start_webcam_overlay() {
|
||||
sleep 1
|
||||
}
|
||||
|
||||
cleanup_webcam() {
|
||||
pkill -f "WebcamOverlay" 2>/dev/null
|
||||
}
|
||||
|
||||
default_resolution() {
|
||||
local width height
|
||||
read -r width height < <(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.width) \(.height)"')
|
||||
if ((width > 3840 || height > 2160)); then
|
||||
echo "3840x2160"
|
||||
else
|
||||
echo "0x0"
|
||||
fi
|
||||
}
|
||||
|
||||
start_screenrecording() {
|
||||
local filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||
local audio_devices=""
|
||||
local audio_args=""
|
||||
local audio_args=()
|
||||
|
||||
[[ $DESKTOP_AUDIO == "true" ]] && audio_devices+="default_output"
|
||||
|
||||
@@ -84,15 +99,71 @@ start_screenrecording() {
|
||||
audio_devices+="default_input"
|
||||
fi
|
||||
|
||||
[[ -n $audio_devices ]] && audio_args+="-a $audio_devices"
|
||||
[[ -n $audio_devices ]] && audio_args+=(-a "$audio_devices" -ac aac)
|
||||
|
||||
local resolution="${RESOLUTION:-$(default_resolution)}"
|
||||
|
||||
gpu-screen-recorder -w portal -k auto -s "$resolution" -f 60 -fm cfr -fallback-cpu-encoding yes -o "$filename" "${audio_args[@]}" &
|
||||
local pid=$!
|
||||
|
||||
# Wait for recording to actually start (file appears after portal selection)
|
||||
while kill -0 $pid 2>/dev/null && [[ ! -f $filename ]]; do
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
if kill -0 $pid 2>/dev/null; then
|
||||
echo "$filename" >"$RECORDING_FILE"
|
||||
toggle_screenrecording_indicator
|
||||
fi
|
||||
}
|
||||
|
||||
stop_screenrecording() {
|
||||
pkill -SIGINT -f "^gpu-screen-recorder" # SIGINT required to save video properly
|
||||
|
||||
# Wait a maximum of 5 seconds to finish before hard killing
|
||||
local count=0
|
||||
while pgrep -f "^gpu-screen-recorder" >/dev/null && ((count < 50)); do
|
||||
sleep 0.1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
gpu-screen-recorder -w portal -k h264 -f 60 -fallback-cpu-encoding yes -o "$filename" $audio_args -ac aac &
|
||||
toggle_screenrecording_indicator
|
||||
cleanup_webcam
|
||||
|
||||
if pgrep -f "^gpu-screen-recorder" >/dev/null; then
|
||||
pkill -9 -f "^gpu-screen-recorder"
|
||||
notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000
|
||||
else
|
||||
trim_first_frame
|
||||
local filename=$(cat "$RECORDING_FILE" 2>/dev/null)
|
||||
local preview="${filename%.mp4}-preview.png"
|
||||
|
||||
# Generate a preview thumbnail from the first frame
|
||||
ffmpeg -y -i "$filename" -ss 00:00:00.1 -vframes 1 -q:v 2 "$preview" -loglevel quiet 2>/dev/null
|
||||
|
||||
(
|
||||
ACTION=$(notify-send "Screen recording saved" "Open with Super + Alt + , (or click this)" -t 10000 -i "${preview:-$filename}" -A "default=open")
|
||||
[[ $ACTION == "default" ]] && mpv "$filename"
|
||||
rm -f "$preview"
|
||||
) &
|
||||
fi
|
||||
|
||||
rm -f "$RECORDING_FILE"
|
||||
}
|
||||
|
||||
toggle_screenrecording_indicator() {
|
||||
pkill -RTMIN+8 waybar
|
||||
}
|
||||
|
||||
screenrecording_active() {
|
||||
pgrep -f "^gpu-screen-recorder" >/dev/null
|
||||
}
|
||||
|
||||
trim_first_frame() {
|
||||
local latest=$(ls -t "$OUTPUT_DIR"/screenrecording-*.mp4 2>/dev/null | head -1)
|
||||
if [[ -n $latest ]]; then
|
||||
local latest
|
||||
latest=$(cat "$RECORDING_FILE" 2>/dev/null)
|
||||
|
||||
if [[ -n $latest && -f $latest ]]; then
|
||||
local trimmed="${latest%.mp4}-trimmed.mp4"
|
||||
if ffmpeg -y -ss 0.1 -i "$latest" -c copy "$trimmed" -loglevel quiet 2>/dev/null; then
|
||||
mv "$trimmed" "$latest"
|
||||
@@ -102,46 +173,12 @@ trim_first_frame() {
|
||||
fi
|
||||
}
|
||||
|
||||
stop_screenrecording() {
|
||||
pkill -SIGINT -f "^gpu-screen-recorder" # SIGINT required to save video properly
|
||||
|
||||
# Wait a maximum of 5 seconds to finish before hard killing
|
||||
local count=0
|
||||
while pgrep -f "^gpu-screen-recorder" >/dev/null && (( count < 50 )); do
|
||||
sleep 0.1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
if pgrep -f "^gpu-screen-recorder" >/dev/null; then
|
||||
pkill -9 -f "^gpu-screen-recorder"
|
||||
cleanup_webcam
|
||||
notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000
|
||||
else
|
||||
cleanup_webcam
|
||||
trim_first_frame
|
||||
notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000
|
||||
fi
|
||||
toggle_screenrecording_indicator
|
||||
}
|
||||
|
||||
toggle_screenrecording_indicator() {
|
||||
pkill -RTMIN+8 waybar
|
||||
}
|
||||
|
||||
screenrecording_active() {
|
||||
pgrep -f "^gpu-screen-recorder" >/dev/null || pgrep -f "WebcamOverlay" >/dev/null
|
||||
}
|
||||
|
||||
if screenrecording_active; then
|
||||
if pgrep -f "WebcamOverlay" >/dev/null && ! pgrep -f "^gpu-screen-recorder" >/dev/null; then
|
||||
cleanup_webcam
|
||||
else
|
||||
stop_screenrecording
|
||||
fi
|
||||
elif [[ $STOP_RECORDING == "false" ]]; then
|
||||
stop_screenrecording
|
||||
elif [[ $STOP_RECORDING == "true" ]]; then
|
||||
exit 1
|
||||
else
|
||||
[[ $WEBCAM == "true" ]] && start_webcam_overlay
|
||||
|
||||
start_screenrecording || cleanup_webcam
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
+26
-23
@@ -8,8 +8,8 @@
|
||||
OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}"
|
||||
|
||||
if [[ ! -d $OUTPUT_DIR ]]; then
|
||||
notify-send "Screenshot directory does not exist: $OUTPUT_DIR" -u critical -t 3000
|
||||
exit 1
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
notify-send "Created screenshot directory: $OUTPUT_DIR" -u normal -t 2000
|
||||
fi
|
||||
|
||||
pkill slurp && exit 0
|
||||
@@ -65,27 +65,30 @@ get_rectangles() {
|
||||
|
||||
# Select based on mode
|
||||
case "$MODE" in
|
||||
region)
|
||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
windows)
|
||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
fullscreen)
|
||||
SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo")
|
||||
;;
|
||||
smart|*)
|
||||
RECTS=$(get_rectangles)
|
||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
region)
|
||||
hyprpicker -r -z >/dev/null 2>&1 &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
windows)
|
||||
hyprpicker -r -z >/dev/null 2>&1 &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
fullscreen)
|
||||
SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo")
|
||||
;;
|
||||
smart | *)
|
||||
RECTS=$(get_rectangles)
|
||||
hyprpicker -r -z >/dev/null 2>&1 &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
|
||||
# If the selection area is L * W < 20, we'll assume you were trying to select whichever
|
||||
# window or output it was inside of to prevent accidental 2px snapshots
|
||||
|
||||
@@ -33,7 +33,7 @@ if [[ -n $font_name ]]; then
|
||||
omarchy-restart-swayosd
|
||||
|
||||
if pgrep -x ghostty; then
|
||||
notify-send " You must restart Ghostty to see font change"
|
||||
notify-send -u low " You must restart Ghostty to see font change"
|
||||
fi
|
||||
|
||||
omarchy-hook font-set "$font_name"
|
||||
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""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()
|
||||
@@ -14,9 +14,22 @@ if ! command -v limine-mkinitcpio &>/dev/null; then
|
||||
fi
|
||||
|
||||
MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf"
|
||||
SWAP_FILE="/swap/swapfile"
|
||||
RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf"
|
||||
|
||||
# Check if hibernation is already configured
|
||||
if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
|
||||
# Fix empty resume_offset if btrfs map-swapfile failed during initial setup
|
||||
if [[ -f $RESUME_DROP_IN ]] && grep -q 'resume_offset="$' "$RESUME_DROP_IN" && [[ -f $SWAP_FILE ]]; then
|
||||
RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE" 2>/dev/null)
|
||||
if [[ -n $RESUME_OFFSET ]]; then
|
||||
echo "Fixing empty resume_offset ($RESUME_OFFSET)"
|
||||
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" "$RESUME_DROP_IN"
|
||||
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine
|
||||
sudo limine-mkinitcpio
|
||||
sudo limine-update
|
||||
fi
|
||||
fi
|
||||
echo "Hibernation is already set up"
|
||||
exit 0
|
||||
fi
|
||||
@@ -29,7 +42,6 @@ if [[ $1 != "--force" ]]; then
|
||||
fi
|
||||
|
||||
SWAP_SUBVOLUME="/swap"
|
||||
SWAP_FILE="$SWAP_SUBVOLUME/swapfile"
|
||||
|
||||
# Create btrfs subvolume for swap
|
||||
if ! sudo btrfs subvolume show "$SWAP_SUBVOLUME" &>/dev/null; then
|
||||
@@ -68,14 +80,18 @@ sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/
|
||||
|
||||
# Add resume= kernel parameters so the initramfs resume hook knows where to find the
|
||||
# hibernation image. Without these, resume happens late (after GPU drivers load) and fails.
|
||||
RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf"
|
||||
if [[ ! -f $RESUME_DROP_IN ]]; then
|
||||
echo "Adding resume kernel parameters"
|
||||
sudo swapon -p 0 "$SWAP_FILE" 2>/dev/null
|
||||
RESUME_DEVICE=$(findmnt -no SOURCE -T "$SWAP_FILE" | sed 's/\[.*\]//')
|
||||
RESUME_OFFSET=$(btrfs inspect-internal map-swapfile -r "$SWAP_FILE")
|
||||
sudo mkdir -p /etc/limine-entry-tool.d
|
||||
echo "KERNEL_CMDLINE[default]+=\"resume=$RESUME_DEVICE resume_offset=$RESUME_OFFSET\"" | sudo tee "$RESUME_DROP_IN" >/dev/null
|
||||
RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE")
|
||||
if [[ -n $RESUME_OFFSET ]]; then
|
||||
sudo mkdir -p /etc/limine-entry-tool.d
|
||||
echo "KERNEL_CMDLINE[default]+=\" resume=$RESUME_DEVICE resume_offset=$RESUME_OFFSET\"" | sudo tee "$RESUME_DROP_IN" >/dev/null
|
||||
sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null
|
||||
else
|
||||
echo "Warning: Could not determine resume offset for $SWAP_FILE" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate)
|
||||
@@ -84,7 +100,8 @@ if grep -q "\[s2idle\]" /sys/power/mem_sleep 2>/dev/null; then
|
||||
if [[ ! -f $LIMINE_DROP_IN ]]; then
|
||||
echo "Enabling ACPI RTC alarm for s2idle suspend"
|
||||
sudo mkdir -p /etc/limine-entry-tool.d
|
||||
echo 'KERNEL_CMDLINE[default]+="rtc_cmos.use_acpi_alarm=1"' | sudo tee "$LIMINE_DROP_IN" >/dev/null
|
||||
echo 'KERNEL_CMDLINE[default]+=" rtc_cmos.use_acpi_alarm=1"' | sudo tee "$LIMINE_DROP_IN" >/dev/null
|
||||
sudo tee -a /etc/default/limine < "$LIMINE_DROP_IN" >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Match Dell XPS systems with LG OLED panel on Intel Panther Lake (Xe3) GPU.
|
||||
|
||||
omarchy-hw-match "XPS" \
|
||||
&& omarchy-hw-intel-ptl \
|
||||
&& test "$(od -An -tx1 -j8 -N2 /sys/class/drm/card*-eDP-*/edid 2>/dev/null | tr -d ' \n')" = "30e4"
|
||||
@@ -3,4 +3,4 @@
|
||||
# Detect whether the computer is a Framework Laptop 16.
|
||||
|
||||
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] &&
|
||||
grep -q "Laptop 16" /sys/class/dmi/id/product_name 2>/dev/null
|
||||
omarchy-hw-match "Laptop 16"
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Detect whether the computer has an Intel CPU.
|
||||
|
||||
[[ $(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ') == "GenuineIntel" ]]
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Detect whether the computer has an Intel Panther Lake GPU.
|
||||
|
||||
lspci | grep -iE 'vga|3d|display' | grep -qi 'panther lake'
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Match against the computer's DMI product name (case-insensitive).
|
||||
# Usage: omarchy-hw-match "XPS"
|
||||
|
||||
grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null
|
||||
@@ -3,4 +3,4 @@
|
||||
# Detect whether the computer is a Microsoft Surface device.
|
||||
|
||||
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] &&
|
||||
grep -q "Surface" /sys/class/dmi/id/product_name 2>/dev/null
|
||||
omarchy-hw-match "Surface"
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Detect whether Vulkan is available.
|
||||
|
||||
[[ -d /usr/share/vulkan/icd.d ]] &&
|
||||
find /usr/share/vulkan/icd.d -maxdepth 1 -name "*.json" -print -quit | grep -q .
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggles transparency for the currently focused window.
|
||||
|
||||
hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Print the name of the currently focused Hyprland monitor.
|
||||
|
||||
hyprctl monitors -j | jq -r '.[] | select(.focused == true).name'
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable the internal laptop display. No-op if already disabled or if it
|
||||
# would leave no active display.
|
||||
|
||||
if omarchy-hyprland-monitors-many; then
|
||||
if omarchy-hyprland-toggle-disabled internal-monitor-disable; then
|
||||
omarchy-hyprland-toggle --enabled-notification " Laptop display disabled" internal-monitor-disable
|
||||
fi
|
||||
else
|
||||
notify-send -u low " Can't disable the only active display"
|
||||
exit 1
|
||||
fi
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Enable the internal laptop display. No-op if already enabled.
|
||||
|
||||
if omarchy-hyprland-toggle-enabled internal-monitor-disable; then
|
||||
omarchy-hyprland-toggle --disabled-notification " Laptop display enabled" internal-monitor-disable
|
||||
fi
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Re-enable the internal display if it was toggled off and no external monitors
|
||||
# are currently active (e.g. external got disconnected live, during sleep, or
|
||||
# wasn't present on boot).
|
||||
|
||||
if omarchy-hyprland-monitors-none && omarchy-hyprland-toggle-enabled internal-monitor-disable; then
|
||||
omarchy-hyprland-monitor-internal-enable
|
||||
fi
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle the internal laptop display on/off.
|
||||
|
||||
if omarchy-hyprland-toggle-enabled internal-monitor-disable; then
|
||||
omarchy-hyprland-monitor-internal-enable
|
||||
else
|
||||
omarchy-hyprland-monitor-internal-disable
|
||||
fi
|
||||
+5
-4
@@ -4,6 +4,9 @@
|
||||
MONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)')
|
||||
ACTIVE_MONITOR=$(echo "$MONITOR_INFO" | jq -r '.name')
|
||||
CURRENT_SCALE=$(echo "$MONITOR_INFO" | jq -r '.scale')
|
||||
WIDTH=$(echo "$MONITOR_INFO" | jq -r '.width')
|
||||
HEIGHT=$(echo "$MONITOR_INFO" | jq -r '.height')
|
||||
REFRESH_RATE=$(echo "$MONITOR_INFO" | jq -r '.refreshRate')
|
||||
|
||||
# Cycle through scales: 1 → 1.6 → 2 → 3 → 1
|
||||
CURRENT_INT=$(awk -v s="$CURRENT_SCALE" 'BEGIN { printf "%.0f", s * 10 }')
|
||||
@@ -15,7 +18,5 @@ case "$CURRENT_INT" in
|
||||
*) NEW_SCALE=1 ;;
|
||||
esac
|
||||
|
||||
hyprctl keyword misc:disable_scale_notification true
|
||||
hyprctl keyword monitor "$ACTIVE_MONITOR,preferred,auto,$NEW_SCALE"
|
||||
hyprctl keyword misc:disable_scale_notification false
|
||||
notify-send " Display scaling set to ${NEW_SCALE}x"
|
||||
hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE"
|
||||
notify-send -u low " Display scaling set to ${NEW_SCALE}x"
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Listen on Hyprland's event socket and recover the internal display whenever
|
||||
# a monitor is removed.
|
||||
|
||||
SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||
|
||||
socat -U - "UNIX-CONNECT:$SOCKET" | while read -r event; do
|
||||
case "$event" in
|
||||
monitorremoved\>\>*|monitorremovedv2\>\>*)
|
||||
omarchy-hyprland-monitor-internal-recover
|
||||
;;
|
||||
esac
|
||||
done
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true when there are multiple monitors connected (so we can disable the internal one)
|
||||
|
||||
(( $(hyprctl monitors -j 2>/dev/null | jq length) > 1 ))
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Returns true when no monitors are connected
|
||||
|
||||
(( $(hyprctl monitors -j 2>/dev/null | jq length) == 0 ))
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely.
|
||||
|
||||
ENABLED_NOTIFICATION=""
|
||||
DISABLED_NOTIFICATION=""
|
||||
|
||||
while [[ $# -gt 1 ]]; do
|
||||
case $1 in
|
||||
--enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
--disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
FLAG_NAME="$1"
|
||||
FLAG="$HOME/.local/state/omarchy/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
|
||||
|
||||
hyprctl reload
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a Hyprland toggle is currently disabled (missing).
|
||||
|
||||
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a Hyprland toggle is currently enabled.
|
||||
|
||||
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggles the window gaps globally between no gaps and the default.
|
||||
|
||||
omarchy-hyprland-toggle window-no-gaps
|
||||
@@ -1,13 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check current single_window_aspect_ratio setting
|
||||
CURRENT_VALUE=$(hyprctl getoption "dwindle:single_window_aspect_ratio" 2>/dev/null | head -1)
|
||||
# Toggle single-window square aspect ratio.
|
||||
|
||||
# Parse vec2 output: "vec2: [1, 1]" or "vec2: [0, 0]"
|
||||
if [[ $CURRENT_VALUE == *"[1, 1]"* ]]; then
|
||||
hyprctl keyword dwindle:single_window_aspect_ratio "0 0"
|
||||
notify-send " Disable single-window square aspect ratio"
|
||||
else
|
||||
hyprctl keyword dwindle:single_window_aspect_ratio "1 1"
|
||||
notify-send " Enable single-window square aspect"
|
||||
fi
|
||||
omarchy-hyprland-toggle \
|
||||
--enabled-notification " Enable single-window square aspect ratio" \
|
||||
--disabled-notification " Disable single-window square aspect ratio" \
|
||||
single-window-aspect-ratio
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle the layout on the current active workspace between dwindle and scrolling
|
||||
|
||||
ACTIVE_WORKSPACE=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
CURRENT_LAYOUT=$(hyprctl activeworkspace -j | jq -r '.tiledLayout')
|
||||
|
||||
case "$CURRENT_LAYOUT" in
|
||||
dwindle) NEW_LAYOUT=scrolling ;;
|
||||
*) NEW_LAYOUT=dwindle ;;
|
||||
esac
|
||||
|
||||
hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
|
||||
notify-send -u low " Workspace layout set to $NEW_LAYOUT"
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggles the window gaps globally between no gaps and the default 10/5/2.
|
||||
|
||||
gaps=$(hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}')
|
||||
|
||||
if [[ $gaps == "0" ]]; then
|
||||
hyprctl keyword general:gaps_out 10
|
||||
hyprctl keyword general:gaps_in 5
|
||||
hyprctl keyword general:border_size 2
|
||||
else
|
||||
hyprctl keyword general:gaps_out 0
|
||||
hyprctl keyword general:gaps_in 0
|
||||
hyprctl keyword general:border_size 0
|
||||
fi
|
||||
@@ -50,9 +50,9 @@ case "$1" in
|
||||
ruby)
|
||||
echo -e "Installing Ruby on Rails...\n"
|
||||
omarchy-pkg-add libyaml
|
||||
mise use --global ruby@latest
|
||||
mise settings add idiomatic_version_file_enable_tools ruby
|
||||
mise settings add ruby.compile false
|
||||
mise settings add idiomatic_version_file_enable_tools ruby
|
||||
mise use --global ruby@latest
|
||||
echo "gem: --no-document" >~/.gemrc
|
||||
mise x ruby -- gem install rails --no-document
|
||||
echo -e "\nYou can now run: rails new myproject"
|
||||
|
||||
@@ -14,4 +14,4 @@ sudo usermod -aG nordvpn "$USER"
|
||||
echo -e "\nNordVPN installed! After reboot, run 'nordvpn login' to authenticate."
|
||||
|
||||
echo
|
||||
gum confirm "Reboot now to make NordVPN usable?" && sudo reboot now
|
||||
gum confirm "Reboot now to make NordVPN usable?" && omarchy-system-reboot
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install the ONCE service, enable its background service, and launch the TUI.
|
||||
|
||||
echo "Installing ONCE..."
|
||||
omarchy-pkg-add once-bin
|
||||
|
||||
echo "Enabling ONCE background service..."
|
||||
sudo systemctl enable --now once-background.service
|
||||
|
||||
echo -e "\nLaunching ONCE..."
|
||||
once
|
||||
@@ -10,7 +10,7 @@ fi
|
||||
|
||||
WINDOW_PATTERN="$1"
|
||||
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)
|
||||
WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + $p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1)
|
||||
|
||||
if [[ -n $WINDOW_ADDRESS ]]; then
|
||||
hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
|
||||
|
||||
@@ -11,14 +11,14 @@ fi
|
||||
pgrep -f org.omarchy.screensaver && exit 0
|
||||
|
||||
# Allow screensaver to be turned off but also force started
|
||||
if [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then
|
||||
if omarchy-toggle-enabled screensaver-off && [[ $1 != "force" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Silently quit Walker on overlay
|
||||
walker -q
|
||||
|
||||
focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
|
||||
focused=$(omarchy-hyprland-monitor-focused)
|
||||
terminal=$(xdg-terminal-exec --print-id)
|
||||
|
||||
for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
@@ -46,7 +46,7 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
|
||||
-e omarchy-cmd-screensaver
|
||||
;;
|
||||
*)
|
||||
notify-send "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty"
|
||||
notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -9,7 +9,7 @@ fi
|
||||
|
||||
# Ensure walker service is running
|
||||
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
|
||||
setsid uwsm-app -- walker --gapplication-service &
|
||||
setsid uwsm-app -- env GSK_RENDERER=cairo walker --gapplication-service &
|
||||
fi
|
||||
|
||||
exec walker --width 644 --maxheight 300 --minheight 300 "$@"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
browser=$(xdg-settings get default-web-browser)
|
||||
|
||||
case $browser in
|
||||
google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
|
||||
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
|
||||
*) browser="chromium.desktop" ;;
|
||||
esac
|
||||
|
||||
|
||||
+30
-16
@@ -19,6 +19,13 @@ back_to() {
|
||||
fi
|
||||
}
|
||||
|
||||
toggle_existing_menu() {
|
||||
if pgrep -f "walker.*--dmenu" >/dev/null; then
|
||||
walker --close >/dev/null 2>&1
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
menu() {
|
||||
local prompt="$1"
|
||||
local options="$2"
|
||||
@@ -47,7 +54,7 @@ present_terminal() {
|
||||
}
|
||||
|
||||
open_in_editor() {
|
||||
notify-send "Editing config file" "$1"
|
||||
notify-send -u low "Editing config file" "$1"
|
||||
omarchy-launch-editor "$1"
|
||||
}
|
||||
|
||||
@@ -102,7 +109,7 @@ show_capture_menu() {
|
||||
*Screenshot*) omarchy-cmd-screenshot ;;
|
||||
*Screenrecord*) show_screenrecord_menu ;;
|
||||
*Color*) pkill hyprpicker || hyprpicker -a ;;
|
||||
*) show_trigger_menu ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -161,12 +168,18 @@ show_share_menu() {
|
||||
}
|
||||
|
||||
show_toggle_menu() {
|
||||
case $(menu "Toggle" " Screensaver\n Nightlight\n Idle Lock\n Top Bar") in
|
||||
case $(menu "Toggle" " Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Laptop Display") in
|
||||
|
||||
*Screensaver*) omarchy-toggle-screensaver ;;
|
||||
*Nightlight*) omarchy-toggle-nightlight ;;
|
||||
*Idle*) omarchy-toggle-idle ;;
|
||||
*Bar*) omarchy-toggle-waybar ;;
|
||||
*) show_trigger_menu ;;
|
||||
*Layout*) omarchy-hyprland-workspace-layout-toggle ;;
|
||||
*Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;;
|
||||
*Gaps*) omarchy-hyprland-window-gaps-toggle ;;
|
||||
*Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
|
||||
*Laptop*) omarchy-hyprland-monitor-internal-toggle ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -264,7 +277,7 @@ show_setup_config_menu() {
|
||||
show_setup_system_menu() {
|
||||
local options=""
|
||||
|
||||
if [[ -f ~/.local/state/omarchy/toggles/suspend-off ]]; then
|
||||
if omarchy-toggle-enabled suspend-off; then
|
||||
options="$options Enable Suspend"
|
||||
else
|
||||
options="$options Disable Suspend"
|
||||
@@ -303,10 +316,11 @@ show_install_menu() {
|
||||
}
|
||||
|
||||
show_install_service_menu() {
|
||||
case $(menu "Install" " Dropbox\n Tailscale\n NordVPN\n Bitwarden\n Chromium Account") in
|
||||
case $(menu "Install" " Dropbox\n Tailscale\n NordVPN [AUR]\n ONCE\n Bitwarden\n Chromium Account") in
|
||||
*Dropbox*) present_terminal omarchy-install-dropbox ;;
|
||||
*Tailscale*) present_terminal omarchy-install-tailscale ;;
|
||||
*NordVPN*) present_terminal omarchy-install-nordvpn ;;
|
||||
*ONCE*) present_terminal omarchy-install-once ;;
|
||||
*Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;;
|
||||
*Chromium*) present_terminal omarchy-install-chromium-google-account ;;
|
||||
*) show_install_menu ;;
|
||||
@@ -341,14 +355,9 @@ show_install_ai_menu() {
|
||||
echo ollama
|
||||
)
|
||||
|
||||
case $(menu "Install" " Dictation\n Claude Code\n Codex\n Gemini CLI\n Copilot CLI\n Cursor CLI\n LM Studio\n Ollama\n Crush") in
|
||||
case $(menu "Install" " Dictation\n LM Studio\n Ollama\n Crush") in
|
||||
*Dictation*) present_terminal omarchy-voxtype-install ;;
|
||||
*Claude*) install "Claude Code" "claude-code" ;;
|
||||
*Codex*) install "Codex" "openai-codex" ;;
|
||||
*Gemini*) install "Gemini CLI" "gemini-cli" ;;
|
||||
*Copilot*) install "Copilot CLI" "github-copilot-cli" ;;
|
||||
*Cursor*) install "Cursor CLI" "cursor-cli" ;;
|
||||
*Studio*) install "LM Studio" "lmstudio" ;;
|
||||
*Studio*) install "LM Studio" "lmstudio-bin" ;;
|
||||
*Ollama*) install "Ollama" $ollama_pkg ;;
|
||||
*Crush*) install "Crush" "crush-bin" ;;
|
||||
*) show_install_menu ;;
|
||||
@@ -520,9 +529,10 @@ show_update_channel_menu() {
|
||||
esac
|
||||
}
|
||||
show_update_process_menu() {
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n Walker\n Waybar") in
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Mako\n Swayosd\n Walker\n Waybar") in
|
||||
*Hypridle*) omarchy-restart-hypridle ;;
|
||||
*Hyprsunset*) omarchy-restart-hyprsunset ;;
|
||||
*Mako*) omarchy-restart-mako ;;
|
||||
*Swayosd*) omarchy-restart-swayosd ;;
|
||||
*Walker*) omarchy-restart-walker ;;
|
||||
*Waybar*) omarchy-restart-waybar ;;
|
||||
@@ -546,10 +556,11 @@ show_update_config_menu() {
|
||||
}
|
||||
|
||||
show_update_hardware_menu() {
|
||||
case $(menu "Restart" " Audio\n Wi-Fi\n Bluetooth") in
|
||||
case $(menu "Restart" " Audio\n Wi-Fi\n Bluetooth\n Trackpad") in
|
||||
*Audio*) present_terminal omarchy-restart-pipewire ;;
|
||||
*Wi-Fi*) present_terminal omarchy-restart-wifi ;;
|
||||
*Bluetooth*) present_terminal omarchy-restart-bluetooth ;;
|
||||
*Trackpad*) present_terminal omarchy-restart-trackpad ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
@@ -568,7 +579,7 @@ show_about() {
|
||||
|
||||
show_system_menu() {
|
||||
local options=" Screensaver\n Lock"
|
||||
[[ ! -f ~/.local/state/omarchy/toggles/suspend-off ]] && options="$options\n Suspend"
|
||||
! omarchy-toggle-enabled suspend-off && options="$options\n Suspend"
|
||||
omarchy-hibernation-available && options="$options\n Hibernate"
|
||||
options="$options\n Logout\n Restart\n Shutdown"
|
||||
|
||||
@@ -593,6 +604,7 @@ go_to_menu() {
|
||||
*apps*) walker -p "Launch…" ;;
|
||||
*learn*) show_learn_menu ;;
|
||||
*trigger*) show_trigger_menu ;;
|
||||
*toggle*) show_toggle_menu ;;
|
||||
*share*) show_share_menu ;;
|
||||
*background*) show_background_menu ;;
|
||||
*capture*) show_capture_menu ;;
|
||||
@@ -613,6 +625,8 @@ go_to_menu() {
|
||||
USER_EXTENSIONS="$HOME/.config/omarchy/extensions/menu.sh"
|
||||
[[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS"
|
||||
|
||||
toggle_existing_menu
|
||||
|
||||
if [[ -n $1 ]]; then
|
||||
BACK_TO_EXIT=true
|
||||
go_to_menu "$1"
|
||||
|
||||
@@ -46,8 +46,12 @@ parse_keycodes() {
|
||||
while IFS= read -r line; do
|
||||
if [[ $line =~ code:([0-9]+) ]]; then
|
||||
code="${BASH_REMATCH[1]}"
|
||||
symbol=$(lookup_keycode_cached "$code" "$XKB_KEYMAP_CACHE")
|
||||
echo "${line/code:${code}/$symbol}"
|
||||
if [[ $code == "201" ]]; then
|
||||
echo "${line/SUPER SHIFT,code:201/,COPILOT KEY}"
|
||||
else
|
||||
symbol=$(lookup_keycode_cached "$code" "$XKB_KEYMAP_CACHE")
|
||||
echo "${line/code:${code}/$symbol}"
|
||||
fi
|
||||
elif [[ $line =~ mouse:([0-9]+) ]]; then
|
||||
code="${BASH_REMATCH[1]}"
|
||||
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install an npx wrapper for a given npm package.
|
||||
# Usage: omarchy-npx-install <package> [command-name]
|
||||
#
|
||||
# If command-name is omitted, it defaults to the package name.
|
||||
# Example: omarchy-npx-install opencode-ai opencode
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Usage: omarchy-npx-install <package> [command-name]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
package=$1
|
||||
command=${2:-$1}
|
||||
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
|
||||
cat > "$HOME/.local/bin/$command" <<EOF
|
||||
#!/bin/bash
|
||||
exec mise exec node@latest -- npx --yes $package "\$@"
|
||||
EOF
|
||||
|
||||
chmod +x "$HOME/.local/bin/$command"
|
||||
@@ -20,7 +20,8 @@ pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")
|
||||
|
||||
if [[ -n $pkg_names ]]; then
|
||||
# Add aur/ prefix to each package name and convert to space-separated for yay
|
||||
sudo -v
|
||||
source omarchy-sudo-keepalive
|
||||
|
||||
echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm
|
||||
sudo updatedb
|
||||
omarchy-show-done
|
||||
|
||||
@@ -17,7 +17,9 @@ fzf_args=(
|
||||
pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}")
|
||||
|
||||
if [[ -n $pkg_names ]]; then
|
||||
# Convert newline-separated selections to space-separated for yay
|
||||
source omarchy-sudo-keepalive
|
||||
|
||||
# Convert newline-separated selections to space-separated for pacman
|
||||
echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm
|
||||
omarchy-show-done
|
||||
fi
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the correct power profile on boot based on current AC/battery state.
|
||||
# The udev rules only fire on state *changes*, so without this, booting
|
||||
# on AC leaves you in the default balanced mode.
|
||||
|
||||
if omarchy-battery-present && ! omarchy-ac-present; then
|
||||
omarchy-powerprofiles-set battery
|
||||
else
|
||||
omarchy-powerprofiles-set ac
|
||||
fi
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the power profile to the requested level, falling back to balanced
|
||||
# if the requested profile isn't available on this machine.
|
||||
#
|
||||
# Usage: omarchy-powerprofiles-set <ac|battery>
|
||||
|
||||
mapfile -t profiles < <(powerprofilesctl list | awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }')
|
||||
|
||||
case "$1" in
|
||||
ac)
|
||||
# Prefer performance, fall back to balanced
|
||||
if [[ " ${profiles[*]} " == *" performance "* ]]; then
|
||||
powerprofilesctl set performance
|
||||
else
|
||||
powerprofilesctl set balanced
|
||||
fi
|
||||
;;
|
||||
battery)
|
||||
powerprofilesctl set balanced
|
||||
;;
|
||||
esac
|
||||
@@ -3,7 +3,4 @@
|
||||
# Overwrite the user tmux config with the Omarchy default and reload tmux.
|
||||
|
||||
omarchy-refresh-config tmux/tmux.conf
|
||||
|
||||
if pgrep -x tmux; then
|
||||
tmux source-file ~/.config/tmux/tmux.conf
|
||||
fi
|
||||
omarchy-restart-tmux
|
||||
|
||||
@@ -3,6 +3,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 "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
|
||||
|
||||
@@ -13,6 +13,10 @@ if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI w
|
||||
cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf
|
||||
hyprctl reload
|
||||
|
||||
# Remove npx stubs
|
||||
rm -f ~/.local/bin/codex ~/.local/bin/gemini ~/.local/bin/copilot \
|
||||
~/.local/bin/opencode ~/.local/bin/playwright-cli ~/.local/bin/pi
|
||||
|
||||
omarchy-pkg-drop \
|
||||
aether \
|
||||
typora \
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Restart tmux if running with the latest configuration
|
||||
|
||||
if pgrep -x tmux; then
|
||||
tmux source-file ~/.config/tmux/tmux.conf
|
||||
fi
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Reset the trackpad by unbinding and rebinding its driver.
|
||||
# Covers both driver paths:
|
||||
# - i2c_hid_acpi (DesignWare I2C, e.g. XPS 14/16 Synaptics trackpad)
|
||||
# - intel_quicki2c (THC Touch Host Controller)
|
||||
|
||||
# Try i2c_hid_acpi path (DesignWare I2C trackpads)
|
||||
for dev in /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*; do
|
||||
[ -e "$dev" ] || continue
|
||||
I2C_DEVICE=$(basename "$dev")
|
||||
echo "Resetting $I2C_DEVICE via i2c_hid_acpi unbind/rebind..."
|
||||
echo "$I2C_DEVICE" | sudo tee /sys/bus/i2c/drivers/i2c_hid_acpi/unbind > /dev/null
|
||||
sleep 1
|
||||
echo "$I2C_DEVICE" | sudo tee /sys/bus/i2c/drivers/i2c_hid_acpi/bind > /dev/null
|
||||
echo "Done"
|
||||
done
|
||||
|
||||
# Also try THC path
|
||||
if lsmod | grep -q intel_quicki2c; then
|
||||
echo "Reloading intel_quicki2c..."
|
||||
sudo modprobe -r intel_quicki2c && sudo modprobe intel_quicki2c
|
||||
fi
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Prompt for sudo once and keep the credential alive in the background.
|
||||
# Source this script so the trap applies to the calling shell:
|
||||
# source omarchy-sudo-keepalive
|
||||
|
||||
sudo -v
|
||||
while true; do sudo -n true; sleep 60; done 2>/dev/null &
|
||||
SUDO_KEEPALIVE_PID=$!
|
||||
trap "kill $SUDO_KEEPALIVE_PID 2>/dev/null" EXIT
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle passwordless sudo for the current user.
|
||||
# First run: enables passwordless sudo for 15 minutes (after confirmation).
|
||||
# Second run: disables it early.
|
||||
|
||||
NOPASSWD_FILE="/etc/sudoers.d/99-omarchy-nopasswd-${USER}"
|
||||
TIMER_NAME="omarchy-nopasswd-expire-${USER}"
|
||||
|
||||
# Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up
|
||||
if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then
|
||||
sudo rm "$NOPASSWD_FILE"
|
||||
fi
|
||||
|
||||
# Check for the file directly — sudo -n can stay cached or be granted by other rules
|
||||
if sudo test -f "$NOPASSWD_FILE"; then
|
||||
sudo rm "$NOPASSWD_FILE"
|
||||
sudo systemctl stop "${TIMER_NAME}.timer" 2>/dev/null
|
||||
echo "Passwordless sudo has been DISABLED. Sudo will require a password again."
|
||||
else
|
||||
echo ""
|
||||
echo "⚠️ WARNING: This will allow ANY process running as your user to"
|
||||
echo "execute ANY command as root WITHOUT a password for 15 minutes."
|
||||
echo ""
|
||||
echo "This is useful for AI agents that need to run sudo commands,"
|
||||
echo "but it significantly weakens the security of your system."
|
||||
echo "Anyone or anything with access to your user account gets full root."
|
||||
echo ""
|
||||
echo "Passwordless sudo will automatically disable after 15 minutes."
|
||||
echo "Run this command again to disable it early."
|
||||
echo ""
|
||||
|
||||
if gum confirm "Enable passwordless sudo for 15 minutes? This is a significant security risk!"; then
|
||||
echo "${USER} ALL=(ALL) NOPASSWD: ALL" | sudo tee "$NOPASSWD_FILE" > /dev/null
|
||||
sudo chmod 440 "$NOPASSWD_FILE"
|
||||
sudo systemd-run --on-active=15m --timer-property=AccuracySec=1s --unit="$TIMER_NAME" \
|
||||
rm "$NOPASSWD_FILE"
|
||||
echo "Passwordless sudo has been ENABLED. It will automatically disable in 15 minutes."
|
||||
echo "Note: if you restart before then, run omarchy-sudo-passwordless-toggle again to disable it."
|
||||
else
|
||||
echo "Aborted. No changes made."
|
||||
fi
|
||||
fi
|
||||
@@ -9,7 +9,7 @@ progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
|
||||
[[ $progress == "0.00" ]] && progress="0.01"
|
||||
|
||||
swayosd-client \
|
||||
--monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
|
||||
--monitor "$(omarchy-hyprland-monitor-focused)" \
|
||||
--custom-icon display-brightness \
|
||||
--custom-progress "$progress" \
|
||||
--custom-progress-text "${percent}%"
|
||||
|
||||
@@ -9,7 +9,7 @@ progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
|
||||
[[ $progress == "0.00" ]] && progress="0.01"
|
||||
|
||||
swayosd-client \
|
||||
--monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
|
||||
--monitor "$(omarchy-hyprland-monitor-focused)" \
|
||||
--custom-icon keyboard-brightness \
|
||||
--custom-progress "$progress" \
|
||||
--custom-progress-text "${percent}%"
|
||||
|
||||
@@ -13,12 +13,12 @@ if omarchy-cmd-present chromium || omarchy-cmd-present brave; then
|
||||
fi
|
||||
|
||||
if omarchy-cmd-present chromium; then
|
||||
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null
|
||||
chromium --refresh-platform-policy --no-startup-window >/dev/null
|
||||
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null
|
||||
chromium --refresh-platform-policy --no-startup-window &>/dev/null
|
||||
fi
|
||||
|
||||
if omarchy-cmd-present brave; then
|
||||
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null
|
||||
brave --refresh-platform-policy --no-startup-window >/dev/null
|
||||
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null
|
||||
brave --refresh-platform-policy --no-startup-window &>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -7,9 +7,8 @@ VS_CODE_THEME="$HOME/.config/omarchy/current/theme/vscode.json"
|
||||
set_theme() {
|
||||
local editor_cmd="$1"
|
||||
local settings_path="$2"
|
||||
local skip_flag="$3"
|
||||
|
||||
omarchy-cmd-present "$editor_cmd" && [[ ! -f $skip_flag ]] || return 0
|
||||
omarchy-cmd-present "$editor_cmd" || return 0
|
||||
|
||||
if [[ -f $VS_CODE_THEME ]]; then
|
||||
theme_name=$(jq -r '.name' "$VS_CODE_THEME")
|
||||
@@ -34,6 +33,7 @@ set_theme() {
|
||||
fi
|
||||
}
|
||||
|
||||
set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-vscode-theme-changes"
|
||||
set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-codium-theme-changes"
|
||||
set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-cursor-theme-changes"
|
||||
! omarchy-toggle-enabled skip-vscode-theme-changes && set_theme "code" "$HOME/.config/Code/User/settings.json"
|
||||
! omarchy-toggle-enabled skip-vscode-insiders-theme-changes && set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json"
|
||||
! omarchy-toggle-enabled skip-codium-theme-changes && set_theme "codium" "$HOME/.config/VSCodium/User/settings.json"
|
||||
! omarchy-toggle-enabled skip-cursor-theme-changes && set_theme "cursor" "$HOME/.config/Cursor/User/settings.json"
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Toggle Omarchy features between enabled and disabled
|
||||
|
||||
ENABLED_NOTIFICATION=""
|
||||
DISABLED_NOTIFICATION=""
|
||||
|
||||
while [[ $# -gt 1 ]]; do
|
||||
case $1 in
|
||||
--enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
--disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
FLAG_NAME="$1"
|
||||
FLAG="$HOME/.local/state/omarchy/toggles/$FLAG_NAME"
|
||||
|
||||
if [[ -f $FLAG ]]; then
|
||||
rm $FLAG
|
||||
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
||||
else
|
||||
mkdir -p "$(dirname $FLAG)"
|
||||
touch $FLAG
|
||||
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
||||
fi
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a toggle is enabled (flag file exists)
|
||||
[[ -f "$HOME/.local/state/omarchy/toggles/$1" ]]
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
if pgrep -x hypridle >/dev/null; then
|
||||
pkill -x hypridle
|
||||
notify-send " Stop locking computer when idle"
|
||||
notify-send -u low " Stop locking computer when idle"
|
||||
else
|
||||
uwsm-app -- hypridle >/dev/null 2>&1 &
|
||||
notify-send " Now locking computer when idle"
|
||||
notify-send -u low " Now locking computer when idle"
|
||||
fi
|
||||
|
||||
pkill -RTMIN+9 waybar
|
||||
|
||||
@@ -21,10 +21,10 @@ restart_nightlighted_waybar() {
|
||||
|
||||
if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then
|
||||
hyprctl hyprsunset temperature $ON_TEMP
|
||||
notify-send " Nightlight screen temperature"
|
||||
notify-send -u low " Nightlight screen temperature"
|
||||
restart_nightlighted_waybar
|
||||
else
|
||||
hyprctl hyprsunset temperature $OFF_TEMP
|
||||
notify-send " Daylight screen temperature"
|
||||
notify-send -u low " Daylight screen temperature"
|
||||
restart_nightlighted_waybar
|
||||
fi
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
makoctl mode -t do-not-disturb
|
||||
|
||||
if makoctl mode | grep -q 'do-not-disturb'; then
|
||||
notify-send " Silenced notifications"
|
||||
notify-send -u low " Silenced notifications"
|
||||
else
|
||||
notify-send " Enabled notifications"
|
||||
notify-send -u low " Enabled notifications"
|
||||
fi
|
||||
|
||||
pkill -RTMIN+10 waybar
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
STATE_FILE=~/.local/state/omarchy/toggles/screensaver-off
|
||||
|
||||
if [[ -f $STATE_FILE ]]; then
|
||||
rm -f $STATE_FILE
|
||||
notify-send " Screensaver enabled"
|
||||
else
|
||||
mkdir -p "$(dirname $STATE_FILE)"
|
||||
touch $STATE_FILE
|
||||
notify-send " Screensaver disabled"
|
||||
fi
|
||||
omarchy-toggle \
|
||||
--enabled-notification " Screensaver disabled" \
|
||||
--disabled-notification " Screensaver enabled" \
|
||||
screensaver-off
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
STATE_FILE=~/.local/state/omarchy/toggles/suspend-off
|
||||
|
||||
if [[ -f $STATE_FILE ]]; then
|
||||
rm -f $STATE_FILE
|
||||
notify-send " Suspend now available in system menu"
|
||||
else
|
||||
mkdir -p "$(dirname $STATE_FILE)"
|
||||
touch $STATE_FILE
|
||||
notify-send " Suspend removed from system menu"
|
||||
fi
|
||||
omarchy-toggle \
|
||||
--enabled-notification " Suspend removed from system menu" \
|
||||
--disabled-notification " Suspend now available in system menu" \
|
||||
suspend-off
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
omarchy-toggle waybar-off
|
||||
|
||||
if pgrep -x waybar >/dev/null; then
|
||||
pkill -x waybar
|
||||
else
|
||||
|
||||
+8
-1
@@ -2,10 +2,17 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Run the update inside a PTY so pacman/yay keep showing download progress
|
||||
# while still logging the full session for later analysis.
|
||||
if [[ -z $OMARCHY_UPDATE_LOGGED ]]; then
|
||||
script_command=$(printf '%q ' "$0" "$@")
|
||||
exec env OMARCHY_UPDATE_LOGGED=1 script -qefc "$script_command" "/tmp/omarchy-update.log"
|
||||
fi
|
||||
|
||||
trap 'echo ""; echo -e "\033[0;31mSomething went wrong during the update!\n\nPlease review the output above carefully, correct the error, and retry the update.\n\nIf you need assistance, get help from the community at https://omarchy.org/discord\033[0m"' ERR
|
||||
|
||||
if [[ $1 == "-y" ]] || omarchy-update-confirm; then
|
||||
omarchy-snapshot create || (( $? == 127 ))
|
||||
omarchy-snapshot create || (($? == 127))
|
||||
omarchy-update-git
|
||||
omarchy-update-perform
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Update system firmware using fwupd. Ensures the fwupd EFI binary is installed
|
||||
# in the ESP so UEFI capsule updates work with the Limine bootloader.
|
||||
|
||||
set -e
|
||||
echo -e "\e[32mUpdate Firmware\e[0m"
|
||||
|
||||
@@ -7,5 +10,9 @@ if omarchy-cmd-missing fwupdmgr; then
|
||||
omarchy-pkg-add fwupd
|
||||
fi
|
||||
|
||||
if [[ -d /sys/firmware/efi ]] && [[ -f /usr/lib/fwupd/efi/fwupdx64.efi ]]; then
|
||||
sudo install -D /usr/lib/fwupd/efi/fwupdx64.efi /boot/EFI/arch/fwupdx64.efi
|
||||
fi
|
||||
|
||||
fwupdmgr refresh --force
|
||||
sudo fwupdmgr update
|
||||
|
||||
@@ -4,5 +4,12 @@ set -e
|
||||
|
||||
echo -e "\e[32mUpdate Omarchy\e[0m"
|
||||
|
||||
omarchy-update-time
|
||||
|
||||
# Suppress Hyprland config errors while git updates default config files mid-pull
|
||||
hyprctl keyword debug:suppress_errors true &>/dev/null || true
|
||||
|
||||
git -C $OMARCHY_PATH pull --autostash
|
||||
git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge
|
||||
|
||||
hyprctl reload &>/dev/null || true
|
||||
|
||||
@@ -3,13 +3,9 @@
|
||||
set -e
|
||||
|
||||
# Ensure screensaver/sleep doesn't set in during updates
|
||||
hyprctl dispatch tagwindow +noidle &> /dev/null || true
|
||||
|
||||
# Capture update logs
|
||||
exec > >(tee "/tmp/omarchy-update.log") 2>&1
|
||||
hyprctl dispatch tagwindow +noidle &>/dev/null || true
|
||||
|
||||
# Perform all update steps
|
||||
omarchy-update-time
|
||||
omarchy-update-keyring
|
||||
omarchy-update-available-reset
|
||||
omarchy-update-system-pkgs
|
||||
@@ -23,4 +19,4 @@ omarchy-update-analyze-logs
|
||||
omarchy-update-restart
|
||||
|
||||
# Re-enable screensaver/sleep after updates
|
||||
hyprctl dispatch tagwindow -- -noidle &> /dev/null || true
|
||||
hyprctl dispatch tagwindow -- -noidle &>/dev/null || true
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo
|
||||
|
||||
if [[ ! -d /usr/lib/modules/$(uname -r) ]]; then
|
||||
gum confirm "Linux kernel has been updated. Reboot?" && omarchy-system-reboot
|
||||
elif [[ -f $HOME/.local/state/omarchy/reboot-required ]]; then
|
||||
gum confirm "Updates require reboot. Ready?" && omarchy-system-reboot
|
||||
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
|
||||
fi
|
||||
|
||||
for file in "$HOME"/.local/state/omarchy/restart-*-required; do
|
||||
if [[ -f $file ]]; then
|
||||
filename=$(basename "$file")
|
||||
|
||||
@@ -11,6 +11,9 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then
|
||||
cp $OMARCHY_PATH/default/voxtype/config.toml ~/.config/voxtype/
|
||||
|
||||
voxtype setup --download --no-post-install
|
||||
if omarchy-hw-vulkan; then
|
||||
voxtype setup gpu --enable || true
|
||||
fi
|
||||
voxtype setup systemd
|
||||
|
||||
omarchy-restart-waybar
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
--light-header-color: #dbdbdb; /* H1-H3 */
|
||||
--select-text-bg-color: #186a9a;
|
||||
--accent-color: #4f525a;
|
||||
--background-color: #101010;
|
||||
--background-color: #000000;
|
||||
--font-color: #bbbcbc;
|
||||
--header-color: #bebebe; /* H4-H6 */
|
||||
--border-color: #232629;
|
||||
|
||||
@@ -20,5 +20,6 @@ decorations = "None"
|
||||
[keyboard]
|
||||
bindings = [
|
||||
{ key = "Insert", mods = "Shift", action = "Paste" },
|
||||
{ key = "Insert", mods = "Control", action = "Copy" }
|
||||
{ key = "Insert", mods = "Control", action = "Copy" },
|
||||
{ key = "Return", mods = "Shift", chars = "\u001B\r" }
|
||||
]
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
+73
-47
@@ -1,18 +1,18 @@
|
||||
#? Config file for btop
|
||||
#? Config file for btop v.1.4.6
|
||||
|
||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||
color_theme = "current"
|
||||
|
||||
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
||||
theme_background = True
|
||||
theme_background = true
|
||||
|
||||
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
|
||||
truecolor = True
|
||||
truecolor = true
|
||||
|
||||
#* Set to true to force tty mode regardless if a real tty has been detected or not.
|
||||
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
|
||||
force_tty = False
|
||||
force_tty = false
|
||||
|
||||
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
|
||||
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
|
||||
@@ -22,10 +22,13 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul
|
||||
|
||||
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
|
||||
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
|
||||
vim_keys = True
|
||||
vim_keys = true
|
||||
|
||||
#* Rounded corners on boxes, is ignored if TTY mode is ON.
|
||||
rounded_corners = True
|
||||
rounded_corners = true
|
||||
|
||||
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
|
||||
terminal_sync = true
|
||||
|
||||
#* Default symbols to use for graph creation, "braille", "block" or "tty".
|
||||
#* "braille" offers the highest resolution but might not be included in all fonts.
|
||||
@@ -60,37 +63,40 @@ update_ms = 2000
|
||||
proc_sorting = "cpu lazy"
|
||||
|
||||
#* Reverse sorting order, True or False.
|
||||
proc_reversed = False
|
||||
proc_reversed = false
|
||||
|
||||
#* Show processes as a tree.
|
||||
proc_tree = False
|
||||
proc_tree = false
|
||||
|
||||
#* Use the cpu graph colors in the process list.
|
||||
proc_colors = True
|
||||
proc_colors = true
|
||||
|
||||
#* Use a darkening gradient in the process list.
|
||||
proc_gradient = True
|
||||
proc_gradient = true
|
||||
|
||||
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
|
||||
proc_per_core = False
|
||||
proc_per_core = false
|
||||
|
||||
#* Show process memory as bytes instead of percent.
|
||||
proc_mem_bytes = True
|
||||
proc_mem_bytes = true
|
||||
|
||||
#* Show cpu graph for each process.
|
||||
proc_cpu_graphs = True
|
||||
proc_cpu_graphs = true
|
||||
|
||||
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
|
||||
proc_info_smaps = False
|
||||
proc_info_smaps = false
|
||||
|
||||
#* Show proc box on left side of screen instead of right.
|
||||
proc_left = False
|
||||
proc_left = false
|
||||
|
||||
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||
proc_filter_kernel = False
|
||||
proc_filter_kernel = false
|
||||
|
||||
#* In tree-view, always accumulate child process resources in the parent process.
|
||||
proc_aggregate = False
|
||||
proc_aggregate = false
|
||||
|
||||
#* Should cpu and memory usage display be preserved for dead processes when paused.
|
||||
keep_dead_proc_usage = false
|
||||
|
||||
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
||||
#* Select from a list of detected attributes from the options menu.
|
||||
@@ -104,25 +110,28 @@ cpu_graph_lower = "Auto"
|
||||
show_gpu_info = "Auto"
|
||||
|
||||
#* Toggles if the lower CPU graph should be inverted.
|
||||
cpu_invert_lower = True
|
||||
cpu_invert_lower = true
|
||||
|
||||
#* Set to True to completely disable the lower CPU graph.
|
||||
cpu_single_graph = False
|
||||
cpu_single_graph = false
|
||||
|
||||
#* Show cpu box at bottom of screen instead of top.
|
||||
cpu_bottom = False
|
||||
cpu_bottom = false
|
||||
|
||||
#* Shows the system uptime in the CPU box.
|
||||
show_uptime = True
|
||||
show_uptime = true
|
||||
|
||||
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
|
||||
show_cpu_watts = true
|
||||
|
||||
#* Show cpu temperature.
|
||||
check_temp = True
|
||||
check_temp = true
|
||||
|
||||
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
|
||||
cpu_sensor = "Auto"
|
||||
|
||||
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
|
||||
show_coretemp = True
|
||||
show_coretemp = true
|
||||
|
||||
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
|
||||
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
|
||||
@@ -134,63 +143,66 @@ cpu_core_map = ""
|
||||
temp_scale = "celsius"
|
||||
|
||||
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
|
||||
base_10_sizes = False
|
||||
base_10_sizes = false
|
||||
|
||||
#* Show CPU frequency.
|
||||
show_cpu_freq = True
|
||||
show_cpu_freq = true
|
||||
|
||||
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
|
||||
freq_mode = "first"
|
||||
|
||||
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
|
||||
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
|
||||
clock_format = "%X"
|
||||
|
||||
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
|
||||
background_update = True
|
||||
background_update = true
|
||||
|
||||
#* Custom cpu model name, empty string to disable.
|
||||
custom_cpu_name = ""
|
||||
|
||||
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
|
||||
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
|
||||
#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user"
|
||||
disks_filter = ""
|
||||
|
||||
#* Show graphs instead of meters for memory values.
|
||||
mem_graphs = True
|
||||
mem_graphs = true
|
||||
|
||||
#* Show mem box below net box instead of above.
|
||||
mem_below_net = False
|
||||
mem_below_net = false
|
||||
|
||||
#* Count ZFS ARC in cached and available memory.
|
||||
zfs_arc_cached = True
|
||||
zfs_arc_cached = true
|
||||
|
||||
#* If swap memory should be shown in memory box.
|
||||
show_swap = True
|
||||
show_swap = true
|
||||
|
||||
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
|
||||
swap_disk = True
|
||||
swap_disk = true
|
||||
|
||||
#* If mem box should be split to also show disks info.
|
||||
show_disks = True
|
||||
show_disks = true
|
||||
|
||||
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
|
||||
only_physical = True
|
||||
only_physical = true
|
||||
|
||||
#* Read disks list from /etc/fstab. This also disables only_physical.
|
||||
use_fstab = True
|
||||
use_fstab = true
|
||||
|
||||
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
|
||||
zfs_hide_datasets = False
|
||||
zfs_hide_datasets = false
|
||||
|
||||
#* Set to true to show available disk space for privileged users.
|
||||
disk_free_priv = False
|
||||
disk_free_priv = false
|
||||
|
||||
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
|
||||
show_io_stat = True
|
||||
show_io_stat = true
|
||||
|
||||
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
|
||||
io_mode = False
|
||||
io_mode = false
|
||||
|
||||
#* Set to True to show combined read/write io graphs in io mode.
|
||||
io_graph_combined = False
|
||||
io_graph_combined = false
|
||||
|
||||
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
|
||||
#* Example: "/mnt/media:100 /:20 /boot:1".
|
||||
@@ -202,29 +214,44 @@ net_download = 100
|
||||
net_upload = 100
|
||||
|
||||
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
|
||||
net_auto = True
|
||||
net_auto = true
|
||||
|
||||
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
||||
net_sync = True
|
||||
net_sync = true
|
||||
|
||||
#* Starts with the Network Interface specified here.
|
||||
net_iface = ""
|
||||
|
||||
#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes.
|
||||
base_10_bitrate = "Auto"
|
||||
|
||||
#* Show battery stats in top right if battery is present.
|
||||
show_battery = True
|
||||
show_battery = true
|
||||
|
||||
#* Which battery to use if multiple are present. "Auto" for auto detection.
|
||||
selected_battery = "Auto"
|
||||
|
||||
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* Show power stats of battery next to charge indicator.
|
||||
show_battery_watts = true
|
||||
|
||||
#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
|
||||
log_level = "WARNING"
|
||||
|
||||
#* Automatically save current settings to config file on exit.
|
||||
save_config_on_exit = true
|
||||
|
||||
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
|
||||
nvml_measure_pcie_speeds = True
|
||||
nvml_measure_pcie_speeds = true
|
||||
|
||||
#* Measure PCIe throughput on AMD cards, may impact performance on certain cards.
|
||||
rsmi_measure_pcie_speeds = true
|
||||
|
||||
#* Horizontally mirror the GPU graph.
|
||||
gpu_mirror_graph = True
|
||||
gpu_mirror_graph = true
|
||||
|
||||
#* Set which GPU vendors to show. Available values are "nvidia amd intel"
|
||||
shown_gpus = "nvidia amd intel"
|
||||
|
||||
#* Custom gpu0 model name, empty string to disable.
|
||||
custom_gpu_name0 = ""
|
||||
@@ -243,4 +270,3 @@ custom_gpu_name4 = ""
|
||||
|
||||
#* Custom gpu5 model name, empty string to disable.
|
||||
custom_gpu_name5 = ""
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# 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)" tmux new
|
||||
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
|
||||
@@ -31,3 +32,8 @@ bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/c
|
||||
# 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-cmd-screenshot # Print Screen Button
|
||||
# bind = SUPER, H, exec, voxtype record toggle # Dictation Button
|
||||
# bind = SUPER, PERIOD, exec, omarchy-launch-walker -m symbols # Emoji Button
|
||||
|
||||
@@ -19,5 +19,8 @@ source = ~/.config/hypr/bindings.conf
|
||||
source = ~/.config/hypr/looknfeel.conf
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
|
||||
# Toggle config flags dynamically
|
||||
source = ~/.local/state/omarchy/toggles/hypr/*.conf
|
||||
|
||||
# Add any other personal Hyprland configuration below
|
||||
# windowrule = workspace 5, match:class qemu
|
||||
|
||||
@@ -11,14 +11,14 @@ input {
|
||||
|
||||
# Change speed of keyboard repeat
|
||||
repeat_rate = 40
|
||||
repeat_delay = 600
|
||||
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: false)
|
||||
# force_no_accel = true
|
||||
|
||||
@@ -47,3 +47,7 @@ windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2
|
||||
# Enable touchpad gestures for changing workspaces
|
||||
# See https://wiki.hyprland.org/Configuring/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
|
||||
|
||||
@@ -7,8 +7,8 @@ general {
|
||||
# gaps_out = 0
|
||||
# border_size = 0
|
||||
|
||||
# Use master layout instead of dwindle
|
||||
# layout = master
|
||||
# Change to niri-like side-scrolling layout
|
||||
# layout = scrolling
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
||||
@@ -27,8 +27,8 @@ animations {
|
||||
# enabled = no
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Dwindle-Layout/
|
||||
dwindle {
|
||||
# https://wiki.hypr.land/Configuring/Variables/#layout
|
||||
layout {
|
||||
# Avoid overly wide single-window layouts on wide screens
|
||||
# single_window_aspect_ratio = 1 1
|
||||
}
|
||||
|
||||
@@ -21,3 +21,6 @@ monitor=,preferred,auto,auto
|
||||
# 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# relative paths are resolved relative to the location of the config file
|
||||
stylesheets: ["../omarchy/current/theme/hyprland-preview-share-picker.css"]
|
||||
# default page selected when the picker is opened
|
||||
default_page: windows
|
||||
default_page: outputs
|
||||
|
||||
window:
|
||||
# height of the application window
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This hook is called with the current battery percentage when the low battery
|
||||
# notification is sent. To put it into use, remove .sample from the name.
|
||||
|
||||
SOUND_FILE="/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"
|
||||
|
||||
if omarchy-cmd-present mpv && [[ -f $SOUND_FILE ]]; then
|
||||
mpv --no-video "$SOUND_FILE" >/dev/null 2>&1
|
||||
fi
|
||||
@@ -4,4 +4,4 @@
|
||||
# To put it into use, remove .sample from the name.
|
||||
|
||||
# Example: Show the name of the theme that was just set.
|
||||
# notify-send "New font" "Your new font is $1"
|
||||
# notify-send -u low "New font" "Your new font is $1"
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
# To put it into use, remove .sample from the name.
|
||||
|
||||
# Example: Show notification after the system has been updated.
|
||||
# notify-send "Update Performed" "Your system is now up to date"
|
||||
# notify-send -u low "Update Performed" "Your system is now up to date"
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
# To put it into use, remove .sample from the name.
|
||||
|
||||
# Example: Show the name of the theme that was just set.
|
||||
# notify-send "New theme" "Your new theme is $1"
|
||||
# notify-send -u low "New theme" "Your new theme is $1"
|
||||
|
||||
+12
-2
@@ -4,7 +4,7 @@ set -g prefix2 C-b
|
||||
bind C-Space send-prefix
|
||||
|
||||
# Reload config
|
||||
bind q source-file ~/.config/tmux/tmux.conf
|
||||
bind q source-file ~/.config/tmux/tmux.conf \; display "Configuration reloaded"
|
||||
|
||||
# Vi mode for copy
|
||||
setw -g mode-keys vi
|
||||
@@ -41,6 +41,11 @@ bind -n M-7 select-window -t 7
|
||||
bind -n M-8 select-window -t 8
|
||||
bind -n M-9 select-window -t 9
|
||||
|
||||
bind -n M-Left select-window -t -1
|
||||
bind -n M-Right select-window -t +1
|
||||
bind -n M-S-Left swap-window -t -1 \; select-window -t -1
|
||||
bind -n M-S-Right swap-window -t +1 \; select-window -t +1
|
||||
|
||||
# Session controls
|
||||
bind R command-prompt -I "#S" "rename-session -- '%%'"
|
||||
bind C new-session -c "#{pane_current_path}"
|
||||
@@ -48,6 +53,9 @@ bind K kill-session
|
||||
bind P switch-client -p
|
||||
bind N switch-client -n
|
||||
|
||||
bind -n M-Up switch-client -p
|
||||
bind -n M-Down switch-client -n
|
||||
|
||||
# General
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ag terminal-overrides ",*:RGB"
|
||||
@@ -69,11 +77,13 @@ set -g status-interval 5
|
||||
set -g status-left-length 30
|
||||
set -g status-right-length 50
|
||||
set -g window-status-separator ""
|
||||
set -gw automatic-rename on
|
||||
set -gw automatic-rename-format '#{b:pane_current_path}'
|
||||
|
||||
# Theme
|
||||
set -g status-style "bg=default,fg=default"
|
||||
set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] "
|
||||
set -g status-right "#[fg=blue]#{?client_prefix,PREFIX ,}#[fg=brightblack]#h "
|
||||
set -g status-right "#[fg=blue]#{?pane_in_mode,COPY ,}#{?client_prefix,PREFIX ,}#{?window_zoomed_flag,ZOOM ,}#[fg=brightblack]#h "
|
||||
set -g window-status-format "#[fg=brightblack] #I:#W "
|
||||
set -g window-status-current-format "#[fg=blue,bold] #I:#W "
|
||||
set -g pane-border-style "fg=brightblack"
|
||||
|
||||
+2
-2
@@ -2,10 +2,10 @@
|
||||
|
||||
# Ensure Omarchy bins are in the path
|
||||
export OMARCHY_PATH=$HOME/.local/share/omarchy
|
||||
export PATH=$OMARCHY_PATH/bin:$PATH
|
||||
export PATH=$OMARCHY_PATH/bin:$PATH:$HOME/.local/bin
|
||||
|
||||
# Set default terminal and editor
|
||||
source ~/.config/uwsm/default
|
||||
|
||||
# Activate mise if present on the system
|
||||
omarchy-cmd-present mise && eval "$(mise activate bash)"
|
||||
omarchy-cmd-present mise && eval "$(mise activate bash --shims)"
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
"format-wifi": "{icon}",
|
||||
"format-ethernet": "",
|
||||
"format-disconnected": "",
|
||||
"tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-wifi": "{essid} ({frequency} GHz)",
|
||||
"tooltip-format-ethernet": "Connected",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"interval": 3,
|
||||
"spacing": 1,
|
||||
|
||||
+17
-6
@@ -6,18 +6,29 @@ if command -v eza &> /dev/null; then
|
||||
alias lta='lt -a'
|
||||
fi
|
||||
|
||||
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
|
||||
if [[ "$TERM" == "xterm-kitty" ]]; then
|
||||
alias ff="fzf --preview 'case \$(file --mime-type -b {}) in image/*) kitty icat --clear --transfer-mode=memory --stdin=no --place=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES}@0x0 {} ;; *) bat --style=numbers --color=always {} ;; esac'"
|
||||
else
|
||||
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
|
||||
fi
|
||||
alias eff='$EDITOR "$(ff)"'
|
||||
sff() { if [ $# -eq 0 ]; then echo "Usage: sff <destination> (e.g. sff host:/tmp/)"; return 1; fi; local file; file=$(find . -type f -printf '%T@\t%p\n' | sort -rn | cut -f2- | ff) && [ -n "$file" ] && scp "$file" "$1"; }
|
||||
|
||||
if command -v zoxide &> /dev/null; then
|
||||
alias cd="zd"
|
||||
zd() {
|
||||
if [ $# -eq 0 ]; then
|
||||
builtin cd ~ && return
|
||||
elif [ -d "$1" ]; then
|
||||
builtin cd "$1"
|
||||
if (( $# == 0 )); then
|
||||
builtin cd ~ || return
|
||||
elif [[ -d $1 ]]; then
|
||||
builtin cd "$1" || return
|
||||
else
|
||||
z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found"
|
||||
if ! z "$@"; then
|
||||
echo "Error: Directory not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
printf "\U000F17A9 "
|
||||
pwd
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Editor used by CLI
|
||||
export SUDO_EDITOR="$EDITOR"
|
||||
export BAT_THEME=ansi
|
||||
|
||||
# Duplicated from .config/uwsm/env so SSH works too
|
||||
export OMARCHY_PATH=$HOME/.local/share/omarchy
|
||||
export PATH=$OMARCHY_PATH/bin:$PATH:$HOME/.local/bin
|
||||
|
||||
@@ -13,23 +13,31 @@ img2jpg() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -quality 95 -strip "${img%.*}-converted.jpg"
|
||||
magick "$img" "$@" -quality 85 -strip "${img%.*}-converted.jpg"
|
||||
}
|
||||
|
||||
# Transcode any image to a small JPG (max 1080px wide) that's great for sharing online
|
||||
# Transcode any image to a small JPG (max 1080px wide)
|
||||
img2jpg-small() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -resize 1080x\> -quality 95 -strip "${img%.*}-small.jpg"
|
||||
magick "$img" "$@" -resize 1080x\> -quality 85 -strip "${img%.*}-small.jpg"
|
||||
}
|
||||
|
||||
# Transcode any image to a medium JPG (max 1800px wide) that's great for sharing online
|
||||
# Transcode any image to a 4K JPG (max 2160px wide)
|
||||
img2jpg-medium() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -resize 1800x\> -quality 95 -strip "${img%.*}-medium.jpg"
|
||||
magick "$img" "$@" -resize 2160x\> -quality 85 -strip "${img%.*}-medium.jpg"
|
||||
}
|
||||
|
||||
# Transcode any image to a 6K JPG (max 3160px wide)
|
||||
img2jpg-large() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -resize 3160x\> -quality 85 -strip "${img%.*}-large.jpg"
|
||||
}
|
||||
|
||||
# Transcode any image to compressed-but-lossless PNG
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Create a new worktree and branch from within current git directory.
|
||||
ga() {
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: ga [branch name]"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local branch="$1"
|
||||
local base="$(basename "$PWD")"
|
||||
local wt_path="../${base}--${branch}"
|
||||
|
||||
git worktree add -b "$branch" "$wt_path"
|
||||
mise trust "$wt_path"
|
||||
cd "$wt_path"
|
||||
}
|
||||
|
||||
# Remove worktree and branch from within active worktree directory.
|
||||
gd() {
|
||||
if gum confirm "Remove worktree and branch?"; then
|
||||
local cwd base branch root worktree
|
||||
|
||||
cwd="$(pwd)"
|
||||
worktree="$(basename "$cwd")"
|
||||
|
||||
# split on first `--`
|
||||
root="${worktree%%--*}"
|
||||
branch="${worktree#*--}"
|
||||
|
||||
# Protect against accidentally nuking a non-worktree directory
|
||||
if [[ "$root" != "$worktree" ]]; then
|
||||
cd "../$root"
|
||||
git worktree remove "$cwd" --force || return 1
|
||||
git branch -D "$branch"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
+2
-5
@@ -2,10 +2,7 @@ if command -v mise &> /dev/null; then
|
||||
eval "$(mise activate bash)"
|
||||
fi
|
||||
|
||||
if command -v starship &> /dev/null; then
|
||||
# clear stale readline state before rendering prompt (prevents artifacts in prompt after abnormal exits like SIGQUIT)
|
||||
__sanitize_prompt() { printf '\r\033[K'; }
|
||||
PROMPT_COMMAND="__sanitize_prompt${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
|
||||
if [[ $- == *i* ]] && [[ ${TERM:-} != "dumb" ]] && command -v starship &> /dev/null; then
|
||||
eval "$(starship init bash)"
|
||||
fi
|
||||
|
||||
@@ -14,7 +11,7 @@ if command -v zoxide &> /dev/null; then
|
||||
fi
|
||||
|
||||
if command -v try &> /dev/null; then
|
||||
eval "$(SHELL=/bin/bash try init ~/Work/tries)"
|
||||
eval "$(SHELL=/bin/bash command try init ~/Work/tries)"
|
||||
fi
|
||||
|
||||
if command -v fzf &> /dev/null; then
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user