mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Compare commits
16 Commits
tmux
...
463417a281
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
463417a281 | ||
|
|
bbb57e98c1 | ||
|
|
e38dd063a6 | ||
|
|
a4d6e3ab03 | ||
|
|
fc529b368d | ||
|
|
ce01b6e0d6 | ||
|
|
450d4dd82b | ||
|
|
8895384b0e | ||
|
|
e4b7372666 | ||
|
|
a30448ceec | ||
|
|
4fadf666e6 | ||
|
|
07ede07193 | ||
|
|
527819b750 | ||
|
|
98bfe20839 | ||
|
|
4d48409926 | ||
|
|
ffafe1727e |
@@ -2,6 +2,7 @@
|
||||
|
||||
# Take a screenshot of the whole screen, a specific window, or a user-drawn region.
|
||||
# Saves to ~/Pictures by default, but that can be changed via OMARCHY_SCREENSHOT_DIR or XDG_PICTURES_DIR ENVs.
|
||||
# Editor defaults to Satty but can be changed via --editor=<name> or OMARCHY_SCREENSHOT_EDITOR env
|
||||
|
||||
[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
|
||||
OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}"
|
||||
@@ -13,6 +14,33 @@ fi
|
||||
|
||||
pkill slurp && exit 0
|
||||
|
||||
SCREENSHOT_EDITOR="${OMARCHY_SCREENSHOT_EDITOR:-satty}"
|
||||
|
||||
# Parse --editor flag from any position
|
||||
ARGS=()
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" == --editor=* ]]; then
|
||||
SCREENSHOT_EDITOR="${arg#--editor=}"
|
||||
else
|
||||
ARGS+=("$arg")
|
||||
fi
|
||||
done
|
||||
set -- "${ARGS[@]}"
|
||||
|
||||
open_editor() {
|
||||
local filepath="$1"
|
||||
if [[ "$SCREENSHOT_EDITOR" == "satty" ]]; then
|
||||
satty --filename "$filepath" \
|
||||
--output-filename "$filepath" \
|
||||
--early-exit \
|
||||
--actions-on-enter save-to-clipboard \
|
||||
--save-after-copy \
|
||||
--copy-command 'wl-copy'
|
||||
else
|
||||
$SCREENSHOT_EDITOR "$filepath"
|
||||
fi
|
||||
}
|
||||
|
||||
MODE="${1:-smart}"
|
||||
PROCESSING="${2:-slurp}"
|
||||
|
||||
@@ -46,7 +74,7 @@ case "$MODE" in
|
||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
|
||||
# If the selction area is L * W < 20, we'll assume you were trying to select whichever
|
||||
# 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
|
||||
if [[ "$SELECTION" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then
|
||||
if (( ${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20 )); then
|
||||
@@ -71,16 +99,19 @@ case "$MODE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -z "$SELECTION" ] && exit 0
|
||||
[[ -z $SELECTION ]] && exit 0
|
||||
|
||||
FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png"
|
||||
FILEPATH="$OUTPUT_DIR/$FILENAME"
|
||||
|
||||
if [[ $PROCESSING == "slurp" ]]; then
|
||||
grim -g "$SELECTION" - |
|
||||
satty --filename - \
|
||||
--output-filename "$OUTPUT_DIR/screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png" \
|
||||
--early-exit \
|
||||
--actions-on-enter save-to-clipboard \
|
||||
--save-after-copy \
|
||||
--copy-command 'wl-copy'
|
||||
grim -g "$SELECTION" "$FILEPATH" || exit 1
|
||||
wl-copy < "$FILEPATH"
|
||||
|
||||
(
|
||||
ACTION=$(notify-send "Screenshot copied & saved" "Click to edit" -t 10000 -i "$FILEPATH" -A "default=edit")
|
||||
[[ "$ACTION" == "default" ]] && open_editor "$FILEPATH"
|
||||
) &
|
||||
else
|
||||
grim -g "$SELECTION" - | wl-copy
|
||||
fi
|
||||
|
||||
@@ -59,11 +59,7 @@ sudo mkdir -p /etc/mkinitcpio.conf.d
|
||||
echo "Adding resume hook to $MKINITCPIO_CONF"
|
||||
echo "HOOKS+=(resume)" | sudo tee "$MKINITCPIO_CONF" >/dev/null
|
||||
|
||||
# Configure suspend-then-hibernate
|
||||
echo "Configuring suspend-then-hibernate"
|
||||
sudo mkdir -p /etc/systemd/logind.conf.d /etc/systemd/sleep.conf.d /usr/lib/systemd/system-sleep
|
||||
sudo cp "$OMARCHY_PATH/default/systemd/lid.conf" /etc/systemd/logind.conf.d/
|
||||
sudo cp "$OMARCHY_PATH/default/systemd/hibernate.conf" /etc/systemd/sleep.conf.d/
|
||||
# Ensure keyboard backlight doesn't prevent sleep
|
||||
sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/
|
||||
|
||||
# Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate)
|
||||
|
||||
@@ -491,7 +491,7 @@ show_remove_elixir_menu() {
|
||||
}
|
||||
|
||||
show_update_menu() {
|
||||
case $(menu "Update" " Omarchy\n Channel\n Config\n Extra Themes\n Process\n Hardware\n Firmware\n Password\n Timezone\n Time") in
|
||||
case $(menu "Update" " Omarchy\n Channel\n Config\n Extra Themes\n Process\n Hardware\n Firmware\n Password\n Timezone\n Time") in
|
||||
*Omarchy*) present_terminal omarchy-update ;;
|
||||
*Channel*) show_update_channel_menu ;;
|
||||
*Config*) show_update_config_menu ;;
|
||||
|
||||
5
bin/omarchy-refresh-tmux
Executable file
5
bin/omarchy-refresh-tmux
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Overwrite the user tmux config with the Omarchy default and reload tmux.
|
||||
|
||||
omarchy-refresh-config tmux/tmux.conf
|
||||
5
bin/omarchy-wifi-powersave
Executable file
5
bin/omarchy-wifi-powersave
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
for iface in /sys/class/net/*/wireless; do
|
||||
iface="$(basename "$(dirname "$iface")")"
|
||||
iw dev "$iface" set power_save "$1" 2>/dev/null
|
||||
done
|
||||
@@ -25,6 +25,9 @@ bindd = SUPER SHIFT, P, Google Photos, exec, omarchy-launch-or-focus-webapp "Goo
|
||||
bindd = SUPER SHIFT, X, X, exec, omarchy-launch-webapp "https://x.com/"
|
||||
bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/compose/post"
|
||||
|
||||
# Add extra bindings
|
||||
# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server
|
||||
|
||||
# Overwrite existing bindings, like putting Omarchy Menu on Super + Space
|
||||
# unbind = SUPER, SPACE
|
||||
# bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu
|
||||
|
||||
@@ -1,5 +1,53 @@
|
||||
# Theme
|
||||
source-file ~/.config/omarchy/current/theme/tmux.conf
|
||||
# Prefix
|
||||
set -g prefix C-Space
|
||||
set -g prefix2 C-b
|
||||
bind C-Space send-prefix
|
||||
|
||||
# Reload config
|
||||
bind q source-file ~/.config/tmux/tmux.conf
|
||||
|
||||
# Vi mode for copy
|
||||
setw -g mode-keys vi
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
|
||||
# Pane Controls
|
||||
bind h split-window -h -c "#{pane_current_path}"
|
||||
bind v split-window -v -c "#{pane_current_path}"
|
||||
bind -n C-M-PageUp split-window -h -c "#{pane_current_path}"
|
||||
bind -n C-M-PageDown split-window -v -c "#{pane_current_path}"
|
||||
bind -n C-M-Home split-window -h -c "#{pane_current_path}"
|
||||
bind -n C-M-End kill-pane
|
||||
|
||||
bind -n C-M-Left select-pane -L
|
||||
bind -n C-M-Right select-pane -R
|
||||
bind -n C-M-Up select-pane -U
|
||||
bind -n C-M-Down select-pane -D
|
||||
|
||||
bind -n C-M-S-Left resize-pane -L 5
|
||||
bind -n C-M-S-Down resize-pane -D 5
|
||||
bind -n C-M-S-Up resize-pane -U 5
|
||||
bind -n C-M-S-Right resize-pane -R 5
|
||||
|
||||
# Window navigation
|
||||
bind r command-prompt -I "#W" "rename-window -- '%%'"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind x kill-window
|
||||
bind -n C-S-Home new-window -c "#{pane_current_path}"
|
||||
bind -n C-S-End kill-window
|
||||
|
||||
bind -n C-S-PageUp next-window
|
||||
bind -n C-S-PageDown previous-window
|
||||
|
||||
# Session controls
|
||||
bind R command-prompt -I "#S" "rename-session -- '%%'"
|
||||
bind C new-session
|
||||
bind X kill-session
|
||||
bind -n C-M-S-Home new-session -c "#{pane_current_path}"
|
||||
bind -n C-M-S-End kill-session
|
||||
|
||||
bind -n C-M-S-PageUp switch-client -p
|
||||
bind -n C-M-S-PageDown switch-client -n
|
||||
|
||||
# General
|
||||
set -g default-terminal "tmux-256color"
|
||||
@@ -22,31 +70,15 @@ set -g status-left-length 30
|
||||
set -g status-right-length 50
|
||||
set -g window-status-separator ""
|
||||
|
||||
# Reload config
|
||||
bind M-r source-file ~/.config/tmux/tmux.conf
|
||||
|
||||
# Rename window / session
|
||||
bind r command-prompt -I "#W" "rename-window -- '%%'"
|
||||
bind R command-prompt -I "#S" "rename-session -- '%%'"
|
||||
|
||||
# Vi mode for copy
|
||||
setw -g mode-keys vi
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
|
||||
# Pane resizing
|
||||
bind -r S-Left resize-pane -L 10
|
||||
bind -r S-Down resize-pane -D 10
|
||||
bind -r S-Up resize-pane -U 10
|
||||
bind -r S-Right resize-pane -R 10
|
||||
|
||||
# Saner splits that open in the same directory
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# New windows in same directory
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
# Sessions
|
||||
bind C new-session
|
||||
bind X kill-session
|
||||
# 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 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"
|
||||
set -g pane-active-border-style "fg=blue"
|
||||
set -g message-style "bg=default,fg=blue"
|
||||
set -g message-command-style "bg=default,fg=blue"
|
||||
set -g mode-style "bg=blue,fg=black"
|
||||
setw -g clock-mode-colour blue
|
||||
|
||||
@@ -87,3 +87,24 @@ img2png() {
|
||||
-define png:exclude-chunk=all \
|
||||
"${img%.*}-optimized.png"
|
||||
}
|
||||
|
||||
# SSH Port Forwarding Functions
|
||||
fip() {
|
||||
[[ $# -lt 2 ]] && echo "Usage: fip <host> <port1> [port2] ..." && return 1
|
||||
local host="$1"
|
||||
shift
|
||||
for port in "$@"; do
|
||||
ssh -f -N -L "$port:localhost:$port" "$host" && echo "Forwarding localhost:$port -> $host:$port"
|
||||
done
|
||||
}
|
||||
|
||||
dip() {
|
||||
[[ $# -eq 0 ]] && echo "Usage: dip <port1> [port2] ..." && return 1
|
||||
for port in "$@"; do
|
||||
pkill -f "ssh.*-L $port:localhost:$port" && echo "Stopped forwarding port $port" || echo "No forwarding on port $port"
|
||||
done
|
||||
}
|
||||
|
||||
lip() {
|
||||
pgrep -af "ssh.*-L [0-9]+:localhost:[0-9]+" || echo "No active forwards"
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ bindd = CTRL, F2, Apple Display brightness up, exec, omarchy-brightness-display-
|
||||
bindd = SHIFT CTRL, F2, Apple Display full brightness, exec, omarchy-brightness-display-apple +60000
|
||||
|
||||
# Captures
|
||||
bindd = , PRINT, Screenshot with editing, exec, omarchy-cmd-screenshot
|
||||
bindd = SHIFT, PRINT, Screenshot to clipboard, exec, omarchy-cmd-screenshot smart clipboard
|
||||
bindd = , PRINT, Screenshot, exec, omarchy-cmd-screenshot
|
||||
bindd = ALT, PRINT, Screenrecording, exec, omarchy-menu screenrecord
|
||||
bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a
|
||||
|
||||
|
||||
@@ -28,3 +28,7 @@ on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy
|
||||
|
||||
[summary~="Learn Keybindings"]
|
||||
on-button-left=exec sh -c 'omarchy-notification-dismiss "Learn Keybindings"; omarchy-menu-keybindings'
|
||||
|
||||
[summary~="Screenshot copied & saved"]
|
||||
max-icon-size=80
|
||||
format=<b>%s</b>\n%b
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[Sleep]
|
||||
HibernateDelaySec=90min
|
||||
SuspendEstimationSec=0
|
||||
@@ -1,2 +0,0 @@
|
||||
[Login]
|
||||
HandleLidSwitch=suspend-then-hibernate
|
||||
@@ -1,11 +0,0 @@
|
||||
set -g status-style "bg={{ background }},fg={{ foreground }}"
|
||||
set -g status-left "#[fg={{ background }},bg={{ accent }},bold] #S #[bg={{ background }}] "
|
||||
set -g status-right "#[fg={{ accent }}]#{?client_prefix,PREFIX ,}#[fg={{ color8 }}]#h "
|
||||
set -g window-status-format "#[fg={{ color8 }}] #I:#W "
|
||||
set -g window-status-current-format "#[fg={{ accent }},bold] #I:#W "
|
||||
set -g pane-border-style "fg={{ color8 }}"
|
||||
set -g pane-active-border-style "fg={{ accent }}"
|
||||
set -g message-style "bg={{ background }},fg={{ accent }}"
|
||||
set -g message-command-style "bg={{ background }},fg={{ accent }}"
|
||||
set -g mode-style "bg={{ accent }},fg={{ background }}"
|
||||
setw -g clock-mode-colour "{{ accent }}"
|
||||
@@ -20,6 +20,7 @@ run_logged $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh
|
||||
run_logged $OMARCHY_INSTALL/config/input-group.sh
|
||||
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh
|
||||
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
|
||||
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hibernation.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/network.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh
|
||||
|
||||
9
install/config/wifi-powersave-rules.sh
Normal file
9
install/config/wifi-powersave-rules.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
if omarchy-battery-present; then
|
||||
cat <<EOF | sudo tee "/etc/udev/rules.d/99-wifi-powersave.rules"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="$HOME/.local/share/omarchy/bin/omarchy-wifi-powersave on"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="$HOME/.local/share/omarchy/bin/omarchy-wifi-powersave off"
|
||||
EOF
|
||||
|
||||
sudo udevadm control --reload
|
||||
sudo udevadm trigger --subsystem-match=power_supply
|
||||
fi
|
||||
3
migrations/1770811646.sh
Normal file
3
migrations/1770811646.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
echo "Disable WiFi power save on AC power"
|
||||
|
||||
source $OMARCHY_PATH/install/config/wifi-powersave-rules.sh
|
||||
Reference in New Issue
Block a user