mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 12:47:49 +02:00
Compare commits
20
Commits
@@ -55,6 +55,7 @@ GROUP_DESCRIPTIONS[reinstall]="Reinstall and reset workflows"
|
||||
GROUP_DESCRIPTIONS[remove]="Removal workflows"
|
||||
GROUP_DESCRIPTIONS[restart]="Restart Omarchy components"
|
||||
GROUP_DESCRIPTIONS[setup]="Interactive setup wizards"
|
||||
GROUP_DESCRIPTIONS[screensaver]="Screensaver branding and animation"
|
||||
GROUP_DESCRIPTIONS[snapshot]="System snapshots"
|
||||
GROUP_DESCRIPTIONS[state]="Persistent Omarchy state"
|
||||
GROUP_DESCRIPTIONS[sudo]="Sudo configuration helpers"
|
||||
@@ -62,6 +63,7 @@ GROUP_DESCRIPTIONS[swayosd]="SwayOSD status display helpers"
|
||||
GROUP_DESCRIPTIONS[system]="Reboot, shutdown, logout, and lock"
|
||||
GROUP_DESCRIPTIONS[theme]="Theme management"
|
||||
GROUP_DESCRIPTIONS[toggle]="Toggle Omarchy features"
|
||||
GROUP_DESCRIPTIONS[transcode]="Image and video transcoding"
|
||||
GROUP_DESCRIPTIONS[tui]="Terminal UI launchers"
|
||||
GROUP_DESCRIPTIONS[tz]="Timezone selection"
|
||||
GROUP_DESCRIPTIONS[update]="Omarchy and system updates"
|
||||
|
||||
@@ -16,6 +16,7 @@ if [[ -f $FIRST_RUN_MODE ]]; then
|
||||
bash "$OMARCHY_PATH/install/first-run/firewall.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gnome-theme.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gtk-primary-paste.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/elephant.sh"
|
||||
sudo rm -f /etc/sudoers.d/first-run
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ omarchy-pkg-add \
|
||||
libretro-sameboy libretro-scummvm libretro-shaders-slang libretro-snes9x \
|
||||
libretro-yabause \
|
||||
libretro-fbneo-git \
|
||||
libretro-database-git
|
||||
libretro-database-git \
|
||||
retroarch-joypad-autoconfig-git
|
||||
|
||||
# Set up ~/Games for BIOS files and ROMs
|
||||
mkdir -p "$HOME/Games/bios" "$HOME/Games/roms"
|
||||
@@ -49,6 +50,7 @@ set_cfg libretro_info_path "/usr/share/libretro/info"
|
||||
set_cfg overlay_directory "/usr/share/libretro/overlays"
|
||||
set_cfg osk_overlay_directory "/usr/share/libretro/overlays/keyboards"
|
||||
set_cfg video_shader_dir "/usr/share/libretro/shaders/shaders_slang"
|
||||
set_cfg joypad_autoconfig_dir "/usr/share/libretro/autoconfig"
|
||||
|
||||
# Point at the database, cheats, and cursors from libretro-database-git
|
||||
set_cfg content_database_path "/usr/share/libretro/database/rdb"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install Helix and configure it to use the current Omarchy theme.
|
||||
# omarchy:summary=Install Helix and configure it to use the current Omarchy theme
|
||||
|
||||
echo "Installing Helix..."
|
||||
omarchy-pkg-add helix
|
||||
|
||||
+46
-2
@@ -93,10 +93,12 @@ show_learn_menu() {
|
||||
}
|
||||
|
||||
show_trigger_menu() {
|
||||
case $(menu "Trigger" " Capture\n Share\n Toggle\n Hardware") in
|
||||
case $(menu "Trigger" " Capture\n Transcode\n Share\n Toggle\n Workspace\n Hardware") in
|
||||
*Capture*) show_capture_menu ;;
|
||||
*Transcode*) show_transcode_menu ;;
|
||||
*Share*) show_share_menu ;;
|
||||
*Toggle*) show_toggle_menu ;;
|
||||
*Workspace*) show_workspace_menu ;;
|
||||
*Hardware*) show_hardware_menu ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
@@ -166,6 +168,22 @@ show_share_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_transcode_menu() {
|
||||
case $(menu "Transcode" " Picture\n Video") in
|
||||
*Picture*) present_terminal "omarchy-transcode --path '$HOME/Pictures'" ;;
|
||||
*Video*) present_terminal "omarchy-transcode --path '$HOME/Videos'" ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_workspace_menu() {
|
||||
case $(menu "Workspace" " Restore\n Save") in
|
||||
*Restore*) omarchy-workspace-restore ;;
|
||||
*Save*) omarchy-workspace-save ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_toggle_menu() {
|
||||
local options=" Screensaver\n Nightlight\n Idle Lock\n Notifications\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Direct Boot\n Passwordless Sudo"
|
||||
|
||||
@@ -217,12 +235,36 @@ show_style_menu() {
|
||||
*Font*) show_font_menu ;;
|
||||
*Background*) show_background_menu ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||
*Screensaver*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;;
|
||||
*Screensaver*) show_screensaver_menu ;;
|
||||
*About*) open_in_editor ~/.config/omarchy/branding/about.txt ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_screensaver_menu() {
|
||||
case $(menu "Screensaver" " Set From Image\n Restore Default\n Edit Text\n Preview") in
|
||||
*Image*) set_screensaver_from_image ;;
|
||||
*Default*) terminal bash -lc 'omarchy-screensaver-set-logo default; echo; read -n 1 -s -r -p "Press any key to close..."' ;;
|
||||
*Text*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;;
|
||||
*Preview*) omarchy-launch-screensaver force ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_screensaver_from_image() {
|
||||
terminal bash -lc '
|
||||
image=$(fd --type file --ignore-case --extension svg --extension png . "$HOME" 2>/dev/null | fzf --prompt "Logo image> ")
|
||||
if [[ -n $image ]]; then
|
||||
if omarchy-screensaver-set-logo "$image"; then
|
||||
echo
|
||||
echo "Preview with: omarchy-launch-screensaver force"
|
||||
fi
|
||||
echo
|
||||
read -n 1 -s -r -p "Press any key to close..."
|
||||
fi
|
||||
'
|
||||
}
|
||||
|
||||
show_theme_menu() {
|
||||
omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400
|
||||
}
|
||||
@@ -647,7 +689,9 @@ go_to_menu() {
|
||||
*trigger*) show_trigger_menu ;;
|
||||
*toggle*) show_toggle_menu ;;
|
||||
*hardware*) show_hardware_menu ;;
|
||||
*workspace*) show_workspace_menu ;;
|
||||
*share*) show_share_menu ;;
|
||||
*transcode*) show_transcode_menu ;;
|
||||
*background*) show_background_menu ;;
|
||||
*capture*) show_capture_menu ;;
|
||||
*style*) show_style_menu ;;
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
|
||||
omarchy-refresh-config waybar/config.jsonc
|
||||
omarchy-refresh-config waybar/style.css
|
||||
echo "top" >"$HOME/.config/waybar/.style"
|
||||
omarchy-restart-waybar
|
||||
|
||||
@@ -21,7 +21,8 @@ omarchy-pkg-drop \
|
||||
libretro-parallel-n64 libretro-picodrive libretro-play libretro-ppsspp \
|
||||
libretro-sameboy libretro-scummvm libretro-shaders-slang libretro-snes9x \
|
||||
libretro-yabause \
|
||||
libretro-fbneo-git
|
||||
libretro-fbneo-git \
|
||||
retroarch-joypad-autoconfig-git
|
||||
|
||||
rm -rf \
|
||||
"$HOME/.config/retroarch" \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Reload Helix configuration (used by the Omarchy theme switching).
|
||||
# omarchy:summary=Reload Helix configuration
|
||||
|
||||
if pgrep -x helix >/dev/null; then
|
||||
pkill -USR1 helix
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
for dev in /sys/bus/i2c/drivers/i2c_hid_acpi/i2c-*; do
|
||||
[ -e "$dev" ] || continue
|
||||
[[ -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
|
||||
|
||||
Executable
+384
@@ -0,0 +1,384 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set the screensaver logo text from an SVG/PNG or the default
|
||||
# omarchy:args=<default|path-to-logo.svg|png> [--width <columns>] [--height <rows>] [--mode <braille|block>] [--threshold <percent>] [--invert] [--stdout]
|
||||
# omarchy:examples=omarchy screensaver set logo ~/logo.svg | omarchy screensaver set logo default | omarchy screensaver set logo ~/logo.png --width 80 --mode block --stdout
|
||||
|
||||
set -o pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: omarchy-screensaver-set-logo <default|path-to-logo.svg|png> [options]
|
||||
|
||||
Sets the screensaver logo text from an image.
|
||||
Pass "default" instead of an image path to restore the Omarchy default.
|
||||
By default, writes to ~/.config/omarchy/branding/screensaver.txt.
|
||||
|
||||
Options:
|
||||
-w, --width <columns> Maximum output width in terminal columns (default: 80)
|
||||
-H, --height <rows> Maximum output height in terminal rows (default: 26)
|
||||
-m, --mode <braille|block> Output style (default: braille)
|
||||
-t, --threshold <percent> Pixel threshold from 0-100 (default: 50)
|
||||
--invert Treat light pixels as the logo instead of dark pixels
|
||||
--no-trim Preserve surrounding whitespace/background
|
||||
--stdout Print converted text instead of writing the screensaver file
|
||||
--help Show this help
|
||||
EOF
|
||||
}
|
||||
|
||||
width=80
|
||||
height=26
|
||||
mode=braille
|
||||
threshold=50
|
||||
invert=false
|
||||
trim=true
|
||||
output_path="$HOME/.config/omarchy/branding/screensaver.txt"
|
||||
image_path=""
|
||||
reset_default=false
|
||||
|
||||
while (($# > 0)); do
|
||||
case "$1" in
|
||||
--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-w | --width)
|
||||
shift
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Missing value for --width" >&2
|
||||
exit 1
|
||||
fi
|
||||
width="$1"
|
||||
;;
|
||||
--width=*)
|
||||
width="${1#*=}"
|
||||
;;
|
||||
-H | --height)
|
||||
shift
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Missing value for --height" >&2
|
||||
exit 1
|
||||
fi
|
||||
height="$1"
|
||||
;;
|
||||
--height=*)
|
||||
height="${1#*=}"
|
||||
;;
|
||||
-m | --mode)
|
||||
shift
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Missing value for --mode" >&2
|
||||
exit 1
|
||||
fi
|
||||
mode="$1"
|
||||
;;
|
||||
--mode=*)
|
||||
mode="${1#*=}"
|
||||
;;
|
||||
--block | --blocks)
|
||||
mode=block
|
||||
;;
|
||||
--braille)
|
||||
mode=braille
|
||||
;;
|
||||
-t | --threshold)
|
||||
shift
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Missing value for --threshold" >&2
|
||||
exit 1
|
||||
fi
|
||||
threshold="$1"
|
||||
;;
|
||||
--threshold=*)
|
||||
threshold="${1#*=}"
|
||||
;;
|
||||
--invert)
|
||||
invert=true
|
||||
;;
|
||||
--no-trim)
|
||||
trim=false
|
||||
;;
|
||||
--stdout)
|
||||
output_path="-"
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
if [[ $1 == "default" && -z $image_path ]]; then
|
||||
reset_default=true
|
||||
elif [[ -z $image_path ]]; then
|
||||
image_path="$1"
|
||||
else
|
||||
echo "Unexpected argument: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if (($# > 0)); then
|
||||
while (($# > 0)); do
|
||||
if [[ $1 == "default" && -z $image_path ]]; then
|
||||
reset_default=true
|
||||
elif [[ -z $image_path ]]; then
|
||||
image_path="$1"
|
||||
else
|
||||
echo "Unexpected argument: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $reset_default == "true" ]]; then
|
||||
if [[ -n $image_path ]]; then
|
||||
echo "default does not accept an image path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
default_path="${OMARCHY_PATH:-$HOME/.local/share/omarchy}/logo.txt"
|
||||
if [[ ! -f $default_path ]]; then
|
||||
echo "Default screensaver logo text not found: $default_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $output_path == "-" ]]; then
|
||||
cat "$default_path"
|
||||
else
|
||||
mkdir -p "$(dirname "$output_path")"
|
||||
cp "$default_path" "$output_path"
|
||||
echo "Restored default screensaver logo text to $output_path"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z $image_path ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $width =~ ^[0-9]+$ ]] || (( width < 1 )); then
|
||||
echo "Invalid width: $width" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $height =~ ^[0-9]+$ ]] || (( height < 1 )); then
|
||||
echo "Invalid height: $height" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $mode != "braille" && $mode != "block" ]]; then
|
||||
echo "Invalid mode: $mode (expected braille or block)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $threshold =~ ^[0-9]+$ ]] || (( threshold < 0 || threshold > 100 )); then
|
||||
echo "Invalid threshold: $threshold (expected 0-100)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f $image_path ]]; then
|
||||
echo "Logo file not found: $image_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if omarchy-cmd-missing magick; then
|
||||
echo "ImageMagick is required to convert logo images" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$mode" in
|
||||
braille)
|
||||
pixel_width=$((width * 2))
|
||||
pixel_height=$((height * 4))
|
||||
;;
|
||||
block)
|
||||
pixel_width=$width
|
||||
pixel_height=$((height * 2))
|
||||
;;
|
||||
esac
|
||||
|
||||
alpha_min=$(magick -background none "$image_path" -alpha extract -format '%[fx:minima]' info: 2>/dev/null) || {
|
||||
echo "Unable to read logo image: $image_path" >&2
|
||||
exit 1
|
||||
}
|
||||
alpha_max=$(magick -background none "$image_path" -alpha extract -format '%[fx:maxima]' info: 2>/dev/null) || {
|
||||
echo "Unable to read logo image: $image_path" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
use_alpha=false
|
||||
if awk -v min="$alpha_min" -v max="$alpha_max" 'BEGIN { exit !(min < 0.999 && max > min) }'; then
|
||||
use_alpha=true
|
||||
fi
|
||||
|
||||
magick_args=(-background none "$image_path" -auto-orient)
|
||||
|
||||
if [[ $use_alpha == "true" ]]; then
|
||||
magick_args+=(-alpha extract -alpha off)
|
||||
if [[ $invert == "true" ]]; then
|
||||
magick_args+=(-negate)
|
||||
fi
|
||||
else
|
||||
magick_args+=(-alpha remove -alpha off -colorspace Gray)
|
||||
if [[ $invert == "false" ]]; then
|
||||
magick_args+=(-negate)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $trim == "true" ]]; then
|
||||
magick_args+=(-bordercolor black -border 1 -trim +repage)
|
||||
fi
|
||||
|
||||
magick_args+=(-resize "${pixel_width}x${pixel_height}" -threshold "${threshold}%" -negate -compress none pbm:-)
|
||||
|
||||
tmp_output=$(mktemp)
|
||||
trap 'rm -f "$tmp_output"' EXIT
|
||||
|
||||
if [[ $mode == "braille" ]]; then
|
||||
if ! magick "${magick_args[@]}" | awk '
|
||||
BEGIN {
|
||||
braille_base = 10240
|
||||
dot[0,0] = 1
|
||||
dot[0,1] = 2
|
||||
dot[0,2] = 4
|
||||
dot[1,0] = 8
|
||||
dot[1,1] = 16
|
||||
dot[1,2] = 32
|
||||
dot[0,3] = 64
|
||||
dot[1,3] = 128
|
||||
}
|
||||
{
|
||||
sub(/#.*/, "")
|
||||
for (i = 1; i <= NF; i++) {
|
||||
token[++token_count] = $i
|
||||
}
|
||||
}
|
||||
END {
|
||||
if (token[1] != "P1") {
|
||||
exit 1
|
||||
}
|
||||
|
||||
width = token[2]
|
||||
height = token[3]
|
||||
pixel_offset = 4
|
||||
|
||||
for (y = 0; y < height; y += 4) {
|
||||
line = ""
|
||||
for (x = 0; x < width; x += 2) {
|
||||
code = 0
|
||||
for (dy = 0; dy < 4; dy++) {
|
||||
for (dx = 0; dx < 2; dx++) {
|
||||
if (y + dy < height && x + dx < width) {
|
||||
pixel = token[pixel_offset + ((y + dy) * width) + x + dx]
|
||||
if (pixel == 1) {
|
||||
code += dot[dx,dy]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (code == 0) {
|
||||
line = line " "
|
||||
} else {
|
||||
line = line sprintf("%c", braille_base + code)
|
||||
}
|
||||
}
|
||||
sub(/[ ]+$/, "", line)
|
||||
lines[++line_count] = line
|
||||
}
|
||||
|
||||
first = 1
|
||||
while (first <= line_count && lines[first] ~ /^[ ]*$/) {
|
||||
first++
|
||||
}
|
||||
|
||||
last = line_count
|
||||
while (last >= first && lines[last] ~ /^[ ]*$/) {
|
||||
last--
|
||||
}
|
||||
|
||||
for (i = first; i <= last; i++) {
|
||||
print lines[i]
|
||||
}
|
||||
}
|
||||
' >"$tmp_output"; then
|
||||
echo "Unable to convert logo image: $image_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if ! magick "${magick_args[@]}" | awk '
|
||||
BEGIN {
|
||||
block["11"] = "█"
|
||||
block["10"] = "▀"
|
||||
block["01"] = "▄"
|
||||
block["00"] = " "
|
||||
}
|
||||
{
|
||||
sub(/#.*/, "")
|
||||
for (i = 1; i <= NF; i++) {
|
||||
token[++token_count] = $i
|
||||
}
|
||||
}
|
||||
END {
|
||||
if (token[1] != "P1") {
|
||||
exit 1
|
||||
}
|
||||
|
||||
width = token[2]
|
||||
height = token[3]
|
||||
pixel_offset = 4
|
||||
|
||||
for (y = 0; y < height; y += 2) {
|
||||
line = ""
|
||||
for (x = 0; x < width; x++) {
|
||||
top = token[pixel_offset + (y * width) + x]
|
||||
bottom = (y + 1 < height) ? token[pixel_offset + ((y + 1) * width) + x] : 0
|
||||
line = line block[top bottom]
|
||||
}
|
||||
sub(/[ ]+$/, "", line)
|
||||
lines[++line_count] = line
|
||||
}
|
||||
|
||||
first = 1
|
||||
while (first <= line_count && lines[first] ~ /^[ ]*$/) {
|
||||
first++
|
||||
}
|
||||
|
||||
last = line_count
|
||||
while (last >= first && lines[last] ~ /^[ ]*$/) {
|
||||
last--
|
||||
}
|
||||
|
||||
for (i = first; i <= last; i++) {
|
||||
print lines[i]
|
||||
}
|
||||
}
|
||||
' >"$tmp_output"; then
|
||||
echo "Unable to convert logo image: $image_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -s $tmp_output ]]; then
|
||||
echo "No logo pixels found in: $image_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $output_path == "-" ]]; then
|
||||
cat "$tmp_output"
|
||||
else
|
||||
mkdir -p "$(dirname "$output_path")"
|
||||
cp "$tmp_output" "$output_path"
|
||||
echo "Wrote screensaver logo text to $output_path"
|
||||
fi
|
||||
@@ -5,5 +5,5 @@
|
||||
THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"
|
||||
|
||||
if [[ -f $THEME_NAME_PATH ]]; then
|
||||
omarchy-theme-set "$(cat $THEME_NAME_PATH)"
|
||||
OMARCHY_THEME_SKIP_BACKGROUND=1 omarchy-theme-set "$(cat $THEME_NAME_PATH)"
|
||||
fi
|
||||
|
||||
@@ -45,7 +45,9 @@ mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"
|
||||
echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
|
||||
|
||||
# Change background with theme
|
||||
omarchy-theme-bg-next
|
||||
if [[ $OMARCHY_THEME_SKIP_BACKGROUND != "1" ]]; then
|
||||
omarchy-theme-bg-next
|
||||
fi
|
||||
|
||||
# Restart components to apply new theme
|
||||
if pgrep -x waybar >/dev/null; then
|
||||
|
||||
Executable
+231
@@ -0,0 +1,231 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:group=transcode
|
||||
# omarchy:name=
|
||||
# omarchy:summary=Transcode pictures and videos for sharing
|
||||
# omarchy:args=[--path path] [input] [format] [resolution]
|
||||
# omarchy:examples=omarchy transcode|omarchy transcode --path ~/Downloads|omarchy transcode ~/Videos/demo.mov mp4 1080p|omarchy transcode ~/Pictures/wallpaper.heic jpg medium
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
omarchy transcode [--path path] [input] [format] [resolution]
|
||||
|
||||
With no input, fuzzy-pick a picture or video from ~/Pictures and ~/Videos,
|
||||
or only from --path when provided. Then pick the output format and resolution.
|
||||
|
||||
Options:
|
||||
--path path Limit interactive fuzzy file selection to this path
|
||||
|
||||
Formats:
|
||||
Pictures: jpg, png
|
||||
Videos: mp4, gif
|
||||
|
||||
Resolutions:
|
||||
Pictures: high, medium, low
|
||||
Videos: 4k, 1080p, 720p
|
||||
EOF
|
||||
}
|
||||
|
||||
pick_file() {
|
||||
local search_path="$1"
|
||||
local paths=()
|
||||
|
||||
if [[ -n $search_path ]]; then
|
||||
[[ -e $search_path ]] || { echo "Path not found: $search_path" >&2; return 1; }
|
||||
paths=("$search_path")
|
||||
else
|
||||
paths=("$HOME/Pictures" "$HOME/Videos")
|
||||
fi
|
||||
|
||||
find "${paths[@]}" -type f \
|
||||
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' -o -iname '*.gif' -o -iname '*.heic' -o -iname '*.avif' \
|
||||
-o -iname '*.mp4' -o -iname '*.mov' -o -iname '*.m4v' -o -iname '*.mkv' -o -iname '*.webm' -o -iname '*.avi' \) \
|
||||
-printf '%T@\t%p\n' 2>/dev/null | sort -rn | cut -f2- | fzf --layout=reverse-list --prompt="Transcode file> "
|
||||
}
|
||||
|
||||
pick_option() {
|
||||
local prompt="$1"
|
||||
shift
|
||||
|
||||
gum choose --header "$prompt" "$@"
|
||||
}
|
||||
|
||||
media_type() {
|
||||
local mime
|
||||
mime=$(file -b --mime-type "$1")
|
||||
|
||||
case "$mime" in
|
||||
image/*) echo picture ;;
|
||||
video/*) echo video ;;
|
||||
*)
|
||||
echo "Unsupported file type: $mime" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
output_path() {
|
||||
local input="$1"
|
||||
local format="$2"
|
||||
local resolution="$3"
|
||||
local dir base stem
|
||||
|
||||
dir=$(dirname -- "$input")
|
||||
base=$(basename -- "$input")
|
||||
stem="${base%.*}"
|
||||
|
||||
printf '%s/%s-%s.%s' "$dir" "$stem" "$resolution" "$format"
|
||||
}
|
||||
|
||||
transcode_picture() {
|
||||
local input="$1" format="$2" resolution="$3" output="$4"
|
||||
local resize
|
||||
|
||||
case "$resolution" in
|
||||
high) resize='3160x>' ;;
|
||||
medium) resize='2160x>' ;;
|
||||
low) resize='1080x>' ;;
|
||||
*)
|
||||
echo "Invalid picture resolution: $resolution" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$format" in
|
||||
jpg)
|
||||
magick "$input" -resize "$resize" -quality 85 -strip "$output"
|
||||
;;
|
||||
png)
|
||||
magick "$input" -resize "$resize" -strip -define png:compression-filter=5 \
|
||||
-define png:compression-level=9 \
|
||||
-define png:compression-strategy=1 \
|
||||
-define png:exclude-chunk=all \
|
||||
"$output"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid picture format: $format" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
transcode_video() {
|
||||
local input="$1" format="$2" resolution="$3" output="$4"
|
||||
local scale
|
||||
|
||||
case "$resolution" in
|
||||
4k) scale='scale=-2:2160' ;;
|
||||
1080p) scale='scale=-2:1080' ;;
|
||||
720p) scale='scale=-2:720' ;;
|
||||
*)
|
||||
echo "Invalid video resolution: $resolution" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$format" in
|
||||
mp4)
|
||||
if [[ $resolution == "4k" ]]; then
|
||||
ffmpeg -i "$input" -vf "$scale" -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 192k "$output"
|
||||
else
|
||||
ffmpeg -i "$input" -vf "$scale" -c:v libx264 -preset fast -crf 23 -c:a copy "$output"
|
||||
fi
|
||||
;;
|
||||
gif)
|
||||
ffmpeg -i "$input" -vf "fps=10,$scale:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" "$output"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid video format: $format" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
copy_to_clipboard() {
|
||||
local output="$1"
|
||||
local uri
|
||||
|
||||
uri="file://$(realpath -- "$output")"
|
||||
printf '%s\n' "$uri" | wl-copy --type text/uri-list
|
||||
}
|
||||
|
||||
main() {
|
||||
local input="" format="" resolution="" search_path=""
|
||||
local type output positional=()
|
||||
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--path)
|
||||
shift
|
||||
[[ $# -gt 0 ]] || { echo "Missing value for --path" >&2; return 2; }
|
||||
search_path="$1"
|
||||
;;
|
||||
--help | -h)
|
||||
usage
|
||||
return 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
positional+=("$@")
|
||||
break
|
||||
;;
|
||||
--*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
return 2
|
||||
;;
|
||||
*)
|
||||
positional+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
input="${positional[0]:-}"
|
||||
format="${positional[1]:-}"
|
||||
resolution="${positional[2]:-}"
|
||||
|
||||
if [[ -z $input ]]; then
|
||||
input=$(pick_file "$search_path")
|
||||
fi
|
||||
|
||||
[[ -n $input ]] || return 1
|
||||
[[ -f $input ]] || { echo "File not found: $input" >&2; return 1; }
|
||||
|
||||
type=$(media_type "$input")
|
||||
|
||||
if [[ -z $format ]]; then
|
||||
if [[ $type == "picture" ]]; then
|
||||
format=$(pick_option "Select format..." jpg png)
|
||||
else
|
||||
format=$(pick_option "Select format..." mp4 gif)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $resolution ]]; then
|
||||
if [[ $type == "picture" ]]; then
|
||||
resolution=$(pick_option "Select resolution..." high medium low)
|
||||
else
|
||||
resolution=$(pick_option "Select resolution..." 4k 1080p 720p)
|
||||
fi
|
||||
fi
|
||||
|
||||
output=$(output_path "$input" "$format" "$resolution")
|
||||
|
||||
if [[ $type == "picture" ]]; then
|
||||
transcode_picture "$input" "$format" "$resolution" "$output"
|
||||
else
|
||||
transcode_video "$input" "$format" "$resolution" "$output"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
copy_to_clipboard "$output"
|
||||
echo "Your $type has been transcoded into $format as $resolution. It's on your clipboard."
|
||||
echo ""
|
||||
echo "It's also in $output"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set Waybar style
|
||||
# omarchy:args=<top|pill|float|toggle|list>
|
||||
# omarchy:examples=omarchy waybar set pill | omarchy waybar set float | omarchy waybar set toggle
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
STYLE_DIR="$OMARCHY_PATH/config/waybar/styles"
|
||||
CONFIG_DIR="$OMARCHY_PATH/config/waybar/configs"
|
||||
CURRENT_STYLE_FILE="$HOME/.config/waybar/.style"
|
||||
STYLE=${1:-toggle}
|
||||
|
||||
list_styles() {
|
||||
for style in "$STYLE_DIR"/*.css; do
|
||||
[[ -e $style ]] || continue
|
||||
basename "$style" .css
|
||||
done
|
||||
}
|
||||
|
||||
current_style() {
|
||||
if [[ -f $CURRENT_STYLE_FILE ]]; then
|
||||
read -r current <"$CURRENT_STYLE_FILE"
|
||||
[[ -n $current ]] && printf '%s\n' "$current" && return
|
||||
fi
|
||||
|
||||
echo "top"
|
||||
}
|
||||
|
||||
if [[ $STYLE == "list" ]]; then
|
||||
list_styles
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ $STYLE == "default" ]]; then
|
||||
STYLE="top"
|
||||
fi
|
||||
|
||||
if [[ $STYLE == "toggle" ]]; then
|
||||
if [[ $(current_style) == "pill" ]]; then
|
||||
STYLE="top"
|
||||
else
|
||||
STYLE="pill"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f $STYLE_DIR/$STYLE.css || ! -f $CONFIG_DIR/$STYLE.jsonc ]]; then
|
||||
echo "Unknown Waybar style '$STYLE'"
|
||||
echo "Available styles:"
|
||||
list_styles
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.config/waybar"
|
||||
cp "$CONFIG_DIR/$STYLE.jsonc" "$HOME/.config/waybar/config.jsonc"
|
||||
cp "$STYLE_DIR/$STYLE.css" "$HOME/.config/waybar/style.css"
|
||||
echo "$STYLE" >"$CURRENT_STYLE_FILE"
|
||||
|
||||
omarchy-restart-waybar
|
||||
Executable
+395
@@ -0,0 +1,395 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Restore the saved layout for the current Hyprland workspace
|
||||
# omarchy:args=
|
||||
# omarchy:examples=omarchy workspace restore
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
monitor=$(omarchy-hyprland-monitor-focused)
|
||||
workspace=$(hyprctl monitors -j | jq -r --arg monitor "$monitor" '.[] | select(.name == $monitor) | .activeWorkspace.id')
|
||||
file="$HOME/.config/hypr/workspaces/$monitor-$workspace.tsv"
|
||||
|
||||
if [[ ! -f $file ]]; then
|
||||
notify-send -u low " No saved workspace $workspace for $monitor" "$file" -t 3000
|
||||
exit 1
|
||||
fi
|
||||
|
||||
restore_data=$(grep -v '^#' "$file" || true)
|
||||
|
||||
if [[ -z $restore_data ]]; then
|
||||
notify-send -u low " No windows saved for workspace $workspace" "$file" -t 3000
|
||||
exit 1
|
||||
fi
|
||||
|
||||
restore_map=$(mktemp)
|
||||
assigned_addresses=$(mktemp)
|
||||
trap 'rm -f "$restore_map" "$assigned_addresses"' EXIT
|
||||
|
||||
declare -a classes commands xs ys ws hs focuseds addresses launched
|
||||
count=0
|
||||
|
||||
while IFS=$'\t' read -r _ saved_workspace mode class command x y w h focused; do
|
||||
[[ -n $class ]] || continue
|
||||
|
||||
workspace=$saved_workspace
|
||||
classes[count]=$class
|
||||
commands[count]=$command
|
||||
xs[count]=$x
|
||||
ys[count]=$y
|
||||
ws[count]=$w
|
||||
hs[count]=$h
|
||||
focuseds[count]=${focused:-false}
|
||||
addresses[count]=""
|
||||
launched[count]=false
|
||||
(( count += 1 ))
|
||||
done <<< "$restore_data"
|
||||
|
||||
hyprctl dispatch workspace "$workspace" >/dev/null
|
||||
|
||||
for (( i = 0; i < count; i++ )); do
|
||||
class=${classes[i]}
|
||||
hyprctl keyword windowrulev2 "workspace $workspace silent,class:^($class)$" >/dev/null
|
||||
|
||||
if [[ ${mode:-tiled} == "floating" ]]; then
|
||||
hyprctl keyword windowrulev2 "float,class:^($class)$" >/dev/null
|
||||
else
|
||||
hyprctl keyword windowrulev2 "tile,class:^($class)$" >/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
existing_unassigned_json() {
|
||||
local class=$1
|
||||
|
||||
{
|
||||
hyprctl clients -j | jq -r --arg class "$class" '.[] | select(.class == $class or .initialClass == $class) | .address' |
|
||||
grep -Fvx -f "$assigned_addresses" || true
|
||||
} | jq -R -s -c 'split("\n")[:-1]'
|
||||
}
|
||||
|
||||
wait_for_address() {
|
||||
local class=$1
|
||||
local existing=${2:-[]}
|
||||
local tries=0
|
||||
local address=""
|
||||
|
||||
while [[ -z $address ]]; do
|
||||
address=$(hyprctl clients -j | jq -r --arg class "$class" --argjson existing "$existing" \
|
||||
'.[] | select((.class == $class or .initialClass == $class) and (.address as $address | $existing | index($address) | not)) | .address' | head -n1)
|
||||
|
||||
if [[ -n $address ]]; then
|
||||
printf '%s\n' "$address"
|
||||
return 0
|
||||
fi
|
||||
|
||||
sleep 0.2
|
||||
(( tries += 1 ))
|
||||
|
||||
# Single-instance apps may focus/reuse an existing window instead of creating a new one.
|
||||
if (( tries >= 25 )) && [[ $existing != "[]" ]]; then
|
||||
jq -r '.[0]' <<< "$existing"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if (( tries >= 75 )); then
|
||||
echo "Timed out waiting for $class" >&2
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
ensure_window() {
|
||||
local id=$1
|
||||
local class=${classes[id]}
|
||||
local command=${commands[id]}
|
||||
local existing address
|
||||
|
||||
if [[ ${launched[id]} == "true" ]]; then
|
||||
last_address=${addresses[id]}
|
||||
return 0
|
||||
fi
|
||||
|
||||
existing=$(existing_unassigned_json "$class")
|
||||
|
||||
if [[ $existing != "[]" && ( $class == chrome-* || $class == chromium* ) ]]; then
|
||||
address=$(jq -r '.[0]' <<< "$existing")
|
||||
else
|
||||
hyprctl dispatch exec "[workspace $workspace silent] $command" >/dev/null
|
||||
address=$(wait_for_address "$class" "$existing") || return 1
|
||||
fi
|
||||
|
||||
hyprctl dispatch movetoworkspacesilent "$workspace,address:$address" >/dev/null || true
|
||||
|
||||
if [[ ${mode:-tiled} == "floating" ]]; then
|
||||
hyprctl dispatch setfloating "address:$address" >/dev/null || true
|
||||
hyprctl dispatch resizewindowpixel exact "${ws[id]}" "${hs[id]}",address:"$address" >/dev/null || true
|
||||
hyprctl dispatch movewindowpixel exact "${xs[id]}" "${ys[id]}",address:"$address" >/dev/null || true
|
||||
else
|
||||
hyprctl dispatch settiled "address:$address" >/dev/null || true
|
||||
hyprctl dispatch focuswindow "address:$address" >/dev/null || true
|
||||
fi
|
||||
|
||||
addresses[id]=$address
|
||||
launched[id]=true
|
||||
printf '%s\n' "$address" >>"$assigned_addresses"
|
||||
printf '%s\t%s\t%s\t%s\t%s\t%s\n' "$address" "$id" "${xs[id]}" "${ys[id]}" "${ws[id]}" "${hs[id]}" >>"$restore_map"
|
||||
|
||||
if [[ ${focuseds[id]} == "true" ]]; then
|
||||
focused_address=$address
|
||||
fi
|
||||
|
||||
sleep 0.4
|
||||
last_address=$address
|
||||
}
|
||||
|
||||
choose_rep() {
|
||||
local best=""
|
||||
local best_area=-1
|
||||
local id area
|
||||
|
||||
for id in "$@"; do
|
||||
area=$(( ws[id] * hs[id] ))
|
||||
if (( area > best_area )); then
|
||||
best=$id
|
||||
best_area=$area
|
||||
fi
|
||||
done
|
||||
|
||||
printf '%s\n' "$best"
|
||||
}
|
||||
|
||||
find_launched_address() {
|
||||
local id
|
||||
|
||||
for id in "$@"; do
|
||||
if [[ ${launched[id]} == "true" ]]; then
|
||||
printf '%s\n' "${addresses[id]}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
opposite_direction() {
|
||||
case $1 in
|
||||
l) echo r ;;
|
||||
r) echo l ;;
|
||||
u) echo d ;;
|
||||
d) echo u ;;
|
||||
esac
|
||||
}
|
||||
|
||||
abs() {
|
||||
local value=$1
|
||||
if (( value < 0 )); then
|
||||
echo $(( -value ))
|
||||
else
|
||||
echo "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
find_partition() {
|
||||
local ids=("$@")
|
||||
local best_score=9223372036854775807
|
||||
local best_a=""
|
||||
local best_b=""
|
||||
local best_dir=""
|
||||
local orientation i j id edge start cut gap right bottom area_a area_b score valid a b
|
||||
|
||||
for orientation in v h; do
|
||||
for i in "${ids[@]}"; do
|
||||
for j in "${ids[@]}"; do
|
||||
if [[ $orientation == "v" ]]; then
|
||||
edge=$(( xs[i] + ws[i] ))
|
||||
start=${xs[j]}
|
||||
[[ $edge -lt $start ]] || continue
|
||||
else
|
||||
edge=$(( ys[i] + hs[i] ))
|
||||
start=${ys[j]}
|
||||
[[ $edge -lt $start ]] || continue
|
||||
fi
|
||||
|
||||
cut=$(( (edge + start) / 2 ))
|
||||
gap=$(( start - edge ))
|
||||
valid=true
|
||||
a=""
|
||||
b=""
|
||||
area_a=0
|
||||
area_b=0
|
||||
|
||||
for id in "${ids[@]}"; do
|
||||
if [[ $orientation == "v" ]]; then
|
||||
right=$(( xs[id] + ws[id] ))
|
||||
if (( right <= cut )); then
|
||||
a="$a $id"
|
||||
area_a=$(( area_a + ws[id] * hs[id] ))
|
||||
elif (( xs[id] >= cut )); then
|
||||
b="$b $id"
|
||||
area_b=$(( area_b + ws[id] * hs[id] ))
|
||||
else
|
||||
valid=false
|
||||
break
|
||||
fi
|
||||
else
|
||||
bottom=$(( ys[id] + hs[id] ))
|
||||
if (( bottom <= cut )); then
|
||||
a="$a $id"
|
||||
area_a=$(( area_a + ws[id] * hs[id] ))
|
||||
elif (( ys[id] >= cut )); then
|
||||
b="$b $id"
|
||||
area_b=$(( area_b + ws[id] * hs[id] ))
|
||||
else
|
||||
valid=false
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
[[ $valid == "true" && -n $a && -n $b ]] || continue
|
||||
|
||||
score=$(abs $(( area_a - area_b )))
|
||||
score=$(( score * 1000 - gap ))
|
||||
|
||||
if (( score < best_score )); then
|
||||
best_score=$score
|
||||
best_a=${a# }
|
||||
best_b=${b# }
|
||||
if [[ $orientation == "v" ]]; then
|
||||
best_dir=r
|
||||
else
|
||||
best_dir=d
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
if [[ -z $best_a || -z $best_b ]]; then
|
||||
fallback_partition "${ids[@]}"
|
||||
return
|
||||
fi
|
||||
|
||||
read -r -a part_a <<< "$best_a"
|
||||
read -r -a part_b <<< "$best_b"
|
||||
part_dir=$best_dir
|
||||
}
|
||||
|
||||
fallback_partition() {
|
||||
local ids=("$@")
|
||||
local sorted=()
|
||||
local line id bbox_min_x=999999 bbox_min_y=999999 bbox_max_x=0 bbox_max_y=0 bbox_w bbox_h key index
|
||||
|
||||
for id in "${ids[@]}"; do
|
||||
(( xs[id] < bbox_min_x )) && bbox_min_x=${xs[id]}
|
||||
(( ys[id] < bbox_min_y )) && bbox_min_y=${ys[id]}
|
||||
(( xs[id] + ws[id] > bbox_max_x )) && bbox_max_x=$(( xs[id] + ws[id] ))
|
||||
(( ys[id] + hs[id] > bbox_max_y )) && bbox_max_y=$(( ys[id] + hs[id] ))
|
||||
done
|
||||
|
||||
bbox_w=$(( bbox_max_x - bbox_min_x ))
|
||||
bbox_h=$(( bbox_max_y - bbox_min_y ))
|
||||
|
||||
while read -r line; do
|
||||
sorted+=("${line#* }")
|
||||
done < <(
|
||||
for id in "${ids[@]}"; do
|
||||
if (( bbox_w >= bbox_h )); then
|
||||
key=${xs[id]}
|
||||
else
|
||||
key=${ys[id]}
|
||||
fi
|
||||
printf '%s %s\n' "$key" "$id"
|
||||
done | sort -n
|
||||
)
|
||||
|
||||
part_a=()
|
||||
part_b=()
|
||||
for index in "${!sorted[@]}"; do
|
||||
if (( index < ${#sorted[@]} / 2 )); then
|
||||
part_a+=("${sorted[index]}")
|
||||
else
|
||||
part_b+=("${sorted[index]}")
|
||||
fi
|
||||
done
|
||||
|
||||
if (( bbox_w >= bbox_h )); then
|
||||
part_dir=r
|
||||
else
|
||||
part_dir=d
|
||||
fi
|
||||
}
|
||||
|
||||
materialize_group() {
|
||||
local ids=("$@")
|
||||
local rep_a rep_b addr_a addr_b dir opposite
|
||||
|
||||
if (( ${#ids[@]} == 0 )); then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if (( ${#ids[@]} == 1 )); then
|
||||
ensure_window "${ids[0]}" >/dev/null || true
|
||||
return 0
|
||||
fi
|
||||
|
||||
find_partition "${ids[@]}"
|
||||
dir=$part_dir
|
||||
opposite=$(opposite_direction "$dir")
|
||||
|
||||
addr_a=$(find_launched_address "${part_a[@]}" || true)
|
||||
addr_b=$(find_launched_address "${part_b[@]}" || true)
|
||||
|
||||
if [[ -z $addr_a && -z $addr_b ]]; then
|
||||
rep_a=$(choose_rep "${part_a[@]}")
|
||||
ensure_window "$rep_a" || return 0
|
||||
addr_a=$last_address
|
||||
hyprctl dispatch focuswindow "address:$addr_a" >/dev/null || true
|
||||
hyprctl dispatch layoutmsg preselect "$dir" >/dev/null || true
|
||||
rep_b=$(choose_rep "${part_b[@]}")
|
||||
ensure_window "$rep_b" || true
|
||||
addr_b=${last_address:-}
|
||||
elif [[ -n $addr_a && -z $addr_b ]]; then
|
||||
hyprctl dispatch focuswindow "address:$addr_a" >/dev/null || true
|
||||
hyprctl dispatch layoutmsg preselect "$dir" >/dev/null || true
|
||||
rep_b=$(choose_rep "${part_b[@]}")
|
||||
ensure_window "$rep_b" || true
|
||||
addr_b=${last_address:-}
|
||||
elif [[ -z $addr_a && -n $addr_b ]]; then
|
||||
hyprctl dispatch focuswindow "address:$addr_b" >/dev/null || true
|
||||
hyprctl dispatch layoutmsg preselect "$opposite" >/dev/null || true
|
||||
rep_a=$(choose_rep "${part_a[@]}")
|
||||
ensure_window "$rep_a" || true
|
||||
addr_a=${last_address:-}
|
||||
fi
|
||||
|
||||
materialize_group "${part_a[@]}"
|
||||
materialize_group "${part_b[@]}"
|
||||
}
|
||||
|
||||
ids=()
|
||||
for (( i = 0; i < count; i++ )); do
|
||||
ids+=("$i")
|
||||
done
|
||||
|
||||
if [[ ${mode:-tiled} == "floating" ]]; then
|
||||
for id in "${ids[@]}"; do
|
||||
ensure_window "$id" >/dev/null || true
|
||||
done
|
||||
else
|
||||
materialize_group "${ids[@]}"
|
||||
|
||||
for _ in 1 2 3 4; do
|
||||
while IFS=$'\t' read -r address _ _ _ w h; do
|
||||
hyprctl dispatch resizewindowpixel exact "$w" "$h",address:"$address" >/dev/null || true
|
||||
done < <(sort -t $'\t' -k3,3n -k4,4n "$restore_map")
|
||||
sleep 0.1
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -n ${focused_address:-} ]]; then
|
||||
hyprctl dispatch focuswindow "address:$focused_address" >/dev/null || true
|
||||
fi
|
||||
|
||||
notify-send -u low " Restored workspace $workspace for $monitor" -t 3000
|
||||
hyprctl dispatch workspace "$workspace" >/dev/null
|
||||
Executable
+74
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Save the current Hyprland workspace app layout to ~/.config/hypr/workspaces/<monitor-name>-<workspace-id>.tsv
|
||||
# omarchy:args=
|
||||
# omarchy:examples=omarchy workspace save
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
monitor=$(omarchy-hyprland-monitor-focused)
|
||||
workspace=$(hyprctl monitors -j | jq -r --arg monitor "$monitor" '.[] | select(.name == $monitor) | .activeWorkspace.id')
|
||||
|
||||
mkdir -p ~/.config/hypr/workspaces
|
||||
file="$HOME/.config/hypr/workspaces/$monitor-$workspace.tsv"
|
||||
clients=$(hyprctl clients -j)
|
||||
active_address=$(hyprctl activewindow -j | jq -r '.address // ""')
|
||||
|
||||
webapp_command() {
|
||||
local class=$1
|
||||
local initial_title=$2
|
||||
local encoded host path
|
||||
|
||||
[[ $class == chrome-* ]] || return 1
|
||||
|
||||
if [[ $initial_title == http://* || $initial_title == https://* ]]; then
|
||||
printf 'omarchy-launch-webapp %s\n' "${initial_title//_/\/}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
encoded=${class#chrome-}
|
||||
encoded=${encoded%-Default}
|
||||
|
||||
if [[ $encoded == *__* ]]; then
|
||||
host=${encoded%%__*}
|
||||
path=${encoded#*__}
|
||||
printf 'omarchy-launch-webapp https://%s/%s\n' "$host" "${path//_/\/}"
|
||||
else
|
||||
printf 'omarchy-launch-webapp https://%s\n' "${encoded//_/\/}"
|
||||
fi
|
||||
}
|
||||
|
||||
launch_command() {
|
||||
local class=$1
|
||||
local initial_title=$2
|
||||
local pid=$3
|
||||
|
||||
if webapp_command "$class" "$initial_title"; then
|
||||
return 0
|
||||
elif [[ -r /proc/$pid/cmdline ]]; then
|
||||
tr '\0' ' ' <"/proc/$pid/cmdline" | sed 's/[[:space:]]*$//'
|
||||
else
|
||||
echo "$class"
|
||||
fi
|
||||
}
|
||||
|
||||
{
|
||||
printf '# monitor\tworkspace\tmode\tclass\tcommand\tx\ty\tw\th\tfocused\n'
|
||||
|
||||
jq -r --argjson workspace "$workspace" '
|
||||
[.[] | select(.workspace.id == $workspace)]
|
||||
| sort_by(.at[0], .at[1])
|
||||
| .[]
|
||||
| [(.initialClass // .class), .initialTitle, .pid, .at[0], .at[1], .size[0], .size[1], .address]
|
||||
| @tsv
|
||||
' <<< "$clients" | while IFS=$'\t' read -r class initial_title pid x y w h address; do
|
||||
command=$(launch_command "$class" "$initial_title" "$pid")
|
||||
focused=false
|
||||
if [[ $address == "$active_address" ]]; then
|
||||
focused=true
|
||||
fi
|
||||
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$monitor" "$workspace" "tiled" "$class" "$command" "$x" "$y" "$w" "$h" "$focused"
|
||||
done
|
||||
} >"$file"
|
||||
|
||||
notify-send -u low " Saved workspace $workspace for $monitor" -t 3000
|
||||
@@ -0,0 +1,193 @@
|
||||
{
|
||||
"reload_style_on_change": true,
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"spacing": 0,
|
||||
"height": 26,
|
||||
"margin-top": 10,
|
||||
"margin-left": 10,
|
||||
"margin-right": 10,
|
||||
"modules-left": ["custom/omarchy", "hyprland/workspaces", "hyprland/window"],
|
||||
"modules-center": ["clock", "custom/update", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||
"modules-right": [
|
||||
"mpris",
|
||||
"group/tray-expander",
|
||||
"backlight",
|
||||
"network",
|
||||
"bluetooth",
|
||||
"pulseaudio",
|
||||
"cpu",
|
||||
"battery"
|
||||
],
|
||||
"hyprland/workspaces": {
|
||||
"on-click": "activate",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9",
|
||||
"10": "0",
|
||||
"active": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": []
|
||||
}
|
||||
},
|
||||
"custom/omarchy": {
|
||||
"format": "<span font='omarchy'>\ue900</span>",
|
||||
"on-click": "omarchy-menu",
|
||||
"on-click-right": "xdg-terminal-exec",
|
||||
"tooltip-format": "Omarchy Menu\n\nSuper + Alt + Space"
|
||||
},
|
||||
"custom/update": {
|
||||
"format": "",
|
||||
"exec": "omarchy-update-available",
|
||||
"on-click": "omarchy-launch-floating-terminal-with-presentation omarchy-update",
|
||||
"tooltip-format": "Omarchy update available",
|
||||
"signal": 7,
|
||||
"interval": 21600
|
||||
},
|
||||
"cpu": {
|
||||
"interval": 5,
|
||||
"format": "",
|
||||
"on-click": "omarchy-launch-or-focus-tui btop",
|
||||
"on-click-right": "alacritty"
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%I:%M %p}",
|
||||
"format-alt": "{:%A %d/%m/%Y}",
|
||||
"tooltip-format": "<span>{calendar}</span>",
|
||||
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
||||
},
|
||||
"network": {
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"format": "{icon} {essid}",
|
||||
"format-wifi": "{icon} {essid}",
|
||||
"format-ethernet": "",
|
||||
"format-disconnected": "",
|
||||
"tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"interval": 3,
|
||||
"spacing": 1,
|
||||
"on-click": "omarchy-launch-wifi"
|
||||
},
|
||||
"battery": {
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-discharging": "{icon}",
|
||||
"format-charging": "{icon}",
|
||||
"format-plugged": "",
|
||||
"format-icons": {
|
||||
"charging": ["", "", "", "", "", "", "", "", "", ""],
|
||||
"default": ["", "", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
"format-full": "",
|
||||
"tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%",
|
||||
"tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%",
|
||||
"interval": 5,
|
||||
"on-click": "omarchy-menu power",
|
||||
"on-click-right": "notify-send -u low \"$(omarchy-battery-status)\"",
|
||||
"states": {
|
||||
"warning": 20,
|
||||
"critical": 10
|
||||
}
|
||||
},
|
||||
"bluetooth": {
|
||||
"format": "",
|
||||
"format-off": "",
|
||||
"format-disabled": "",
|
||||
"format-connected": "",
|
||||
"format-no-controller": "",
|
||||
"tooltip-format": "Devices connected: {num_connections}",
|
||||
"on-click": "omarchy-launch-bluetooth"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon}",
|
||||
"on-click": "omarchy-launch-audio",
|
||||
"on-click-right": "pamixer -t",
|
||||
"tooltip-format": "Playing at {volume}%",
|
||||
"scroll-step": 5,
|
||||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"headset": "",
|
||||
"default": ["", "", ""]
|
||||
}
|
||||
},
|
||||
"group/tray-expander": {
|
||||
"orientation": "inherit",
|
||||
"drawer": {
|
||||
"transition-duration": 600,
|
||||
"children-class": "tray-group-item"
|
||||
},
|
||||
"modules": ["custom/expand-icon", "tray", "memory", "custom/weather"]
|
||||
},
|
||||
"custom/expand-icon": {
|
||||
"format": " ",
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/screenrecording-indicator": {
|
||||
"on-click": "omarchy-capture-screenrecording",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh",
|
||||
"signal": 8,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/idle-indicator": {
|
||||
"on-click": "omarchy-toggle-idle",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh",
|
||||
"signal": 9,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/notification-silencing-indicator": {
|
||||
"on-click": "omarchy-toggle-notification-silencing",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",
|
||||
"signal": 10,
|
||||
"return-type": "json"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 12,
|
||||
"spacing": 12
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["🌑", "🌘", "🌗", "🌖", "🌕"]
|
||||
},
|
||||
"memory": {
|
||||
"format": " {used:0.1f}gb",
|
||||
"interval": 2,
|
||||
"on-click": "omarchy-launch-or-focus-tui btop"
|
||||
},
|
||||
"custom/weather": {
|
||||
"format": "{}°",
|
||||
"tooltip": true,
|
||||
"interval": 600,
|
||||
"exec": "omarchy-cmd-present wttrbar && wttrbar || true",
|
||||
"return-type": "json"
|
||||
},
|
||||
"mpris": {
|
||||
"format": "{player_icon} {artist} - {title}",
|
||||
"format-paused": "{status_icon} <i>{artist} - {title}</i>",
|
||||
"player-icons": {
|
||||
"default": "🎵",
|
||||
"mpv": "🎵"
|
||||
},
|
||||
"status-icons": {
|
||||
"paused": "⏸"
|
||||
},
|
||||
"max-length": 50
|
||||
},
|
||||
"hyprland/window": {
|
||||
"format": "{}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"reload_style_on_change": true,
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"spacing": 0,
|
||||
"height": 26,
|
||||
"modules-left": ["custom/omarchy", "hyprland/workspaces", "hyprland/window"],
|
||||
"modules-center": ["clock", "custom/update", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||
"modules-right": [
|
||||
"mpris",
|
||||
"group/tray-expander",
|
||||
"backlight",
|
||||
"network",
|
||||
"bluetooth",
|
||||
"pulseaudio",
|
||||
"cpu",
|
||||
"battery"
|
||||
],
|
||||
"hyprland/workspaces": {
|
||||
"on-click": "activate",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"6": "",
|
||||
"7": "",
|
||||
"8": "",
|
||||
"9": "",
|
||||
"10": "",
|
||||
"active": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": []
|
||||
}
|
||||
},
|
||||
"custom/omarchy": {
|
||||
"format": "<span font='omarchy'>\ue900</span>",
|
||||
"on-click": "omarchy-menu",
|
||||
"on-click-right": "xdg-terminal-exec",
|
||||
"tooltip-format": "Omarchy Menu\n\nSuper + Alt + Space"
|
||||
},
|
||||
"custom/update": {
|
||||
"format": "",
|
||||
"exec": "omarchy-update-available",
|
||||
"on-click": "omarchy-launch-floating-terminal-with-presentation omarchy-update",
|
||||
"tooltip-format": "Omarchy update available",
|
||||
"signal": 7,
|
||||
"interval": 21600
|
||||
},
|
||||
"cpu": {
|
||||
"interval": 5,
|
||||
"format": "",
|
||||
"on-click": "omarchy-launch-or-focus-tui btop",
|
||||
"on-click-right": "alacritty"
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%I:%M %p}",
|
||||
"format-alt": "{:%A %d/%m/%Y}",
|
||||
"tooltip-format": "<span>{calendar}</span>",
|
||||
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
||||
},
|
||||
"network": {
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"format": "{icon} {essid}",
|
||||
"format-wifi": "{icon} {essid}",
|
||||
"format-ethernet": "",
|
||||
"format-disconnected": "",
|
||||
"tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"interval": 3,
|
||||
"spacing": 1,
|
||||
"on-click": "omarchy-launch-wifi"
|
||||
},
|
||||
"battery": {
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-discharging": "{capacity}% {icon}",
|
||||
"format-charging": "{capacity}% {icon}",
|
||||
"format-plugged": "",
|
||||
"format-icons": {
|
||||
"charging": ["", "", "", "", "", "", "", "", "", ""],
|
||||
"default": ["", "", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
"format-full": "",
|
||||
"tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%",
|
||||
"tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%",
|
||||
"interval": 5,
|
||||
"on-click": "omarchy-menu power",
|
||||
"on-click-right": "notify-send -u low \"$(omarchy-battery-status)\"",
|
||||
"states": {
|
||||
"warning": 20,
|
||||
"critical": 10
|
||||
}
|
||||
},
|
||||
"bluetooth": {
|
||||
"format": "",
|
||||
"format-off": "",
|
||||
"format-disabled": "",
|
||||
"format-connected": "",
|
||||
"format-no-controller": "",
|
||||
"tooltip-format": "Devices connected: {num_connections}",
|
||||
"on-click": "omarchy-launch-bluetooth"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon}",
|
||||
"on-click": "omarchy-launch-audio",
|
||||
"on-click-right": "pamixer -t",
|
||||
"tooltip-format": "Playing at {volume}%",
|
||||
"scroll-step": 5,
|
||||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"headset": "",
|
||||
"default": ["", "", ""]
|
||||
}
|
||||
},
|
||||
"group/tray-expander": {
|
||||
"orientation": "inherit",
|
||||
"drawer": {
|
||||
"transition-duration": 600,
|
||||
"children-class": "tray-group-item"
|
||||
},
|
||||
"modules": ["custom/expand-icon", "tray", "memory", "custom/weather"]
|
||||
},
|
||||
"custom/expand-icon": {
|
||||
"format": " ",
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/screenrecording-indicator": {
|
||||
"on-click": "omarchy-capture-screenrecording",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh",
|
||||
"signal": 8,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/idle-indicator": {
|
||||
"on-click": "omarchy-toggle-idle",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh",
|
||||
"signal": 9,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/notification-silencing-indicator": {
|
||||
"on-click": "omarchy-toggle-notification-silencing",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",
|
||||
"signal": 10,
|
||||
"return-type": "json"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 12,
|
||||
"spacing": 12
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["🌑", "🌘", "🌗", "🌖", "🌕"]
|
||||
},
|
||||
"memory": {
|
||||
"format": " {used:0.1f}gb",
|
||||
"interval": 2,
|
||||
"on-click": "omarchy-launch-or-focus-tui btop"
|
||||
},
|
||||
"custom/weather": {
|
||||
"format": "{}°",
|
||||
"tooltip": true,
|
||||
"interval": 600,
|
||||
"exec": "omarchy-cmd-present wttrbar && wttrbar || true",
|
||||
"return-type": "json"
|
||||
},
|
||||
"mpris": {
|
||||
"format": "{player_icon} {artist} - {title}",
|
||||
"format-paused": "{status_icon} <i>{artist} - {title}</i>",
|
||||
"player-icons": {
|
||||
"default": "🎵",
|
||||
"mpv": "🎵"
|
||||
},
|
||||
"status-icons": {
|
||||
"paused": "⏸"
|
||||
}
|
||||
},
|
||||
"hyprland/window": {
|
||||
"format": "{}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"reload_style_on_change": true,
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"spacing": 0,
|
||||
"height": 26,
|
||||
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
|
||||
"modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||
"modules-right": [
|
||||
"group/tray-expander",
|
||||
"bluetooth",
|
||||
"network",
|
||||
"pulseaudio",
|
||||
"cpu",
|
||||
"battery"
|
||||
],
|
||||
"hyprland/workspaces": {
|
||||
"on-click": "activate",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9",
|
||||
"10": "0",
|
||||
"active": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": []
|
||||
}
|
||||
},
|
||||
"custom/omarchy": {
|
||||
"format": "<span font='omarchy'>\ue900</span>",
|
||||
"on-click": "omarchy-menu",
|
||||
"on-click-right": "xdg-terminal-exec",
|
||||
"tooltip-format": "Omarchy Menu\n\nSuper + Alt + Space"
|
||||
},
|
||||
"custom/update": {
|
||||
"format": "",
|
||||
"exec": "omarchy-update-available",
|
||||
"on-click": "omarchy-launch-floating-terminal-with-presentation omarchy-update",
|
||||
"tooltip-format": "Omarchy update available",
|
||||
"signal": 7,
|
||||
"interval": 21600
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"interval": 5,
|
||||
"format": "",
|
||||
"on-click": "omarchy-launch-or-focus-tui btop",
|
||||
"on-click-right": "alacritty"
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:L%A %H:%M}",
|
||||
"format-alt": "{:L%d %B W%V %Y}",
|
||||
"tooltip": false,
|
||||
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
||||
},
|
||||
"network": {
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
"format": "{icon}",
|
||||
"format-wifi": "{icon}",
|
||||
"format-ethernet": "",
|
||||
"format-disconnected": "",
|
||||
"tooltip-format-wifi": "{essid} ({frequency} GHz)",
|
||||
"tooltip-format-ethernet": "Connected",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"interval": 3,
|
||||
"spacing": 1,
|
||||
"on-click": "omarchy-launch-wifi"
|
||||
},
|
||||
"battery": {
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-discharging": "{icon}",
|
||||
"format-charging": "{icon}",
|
||||
"format-plugged": "",
|
||||
"format-icons": {
|
||||
"charging": ["", "", "", "", "", "", "", "", "", ""],
|
||||
"default": ["", "", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
"format-full": "",
|
||||
"tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%",
|
||||
"tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%",
|
||||
"interval": 5,
|
||||
"on-click": "omarchy-menu power",
|
||||
"on-click-right": "notify-send -u low \"$(omarchy-battery-status)\"",
|
||||
"states": {
|
||||
"warning": 20,
|
||||
"critical": 10
|
||||
}
|
||||
},
|
||||
"bluetooth": {
|
||||
"format": "",
|
||||
"format-off": "",
|
||||
"format-disabled": "",
|
||||
"format-connected": "",
|
||||
"format-no-controller": "",
|
||||
"tooltip-format": "Devices connected: {num_connections}",
|
||||
"on-click": "omarchy-launch-bluetooth"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon}",
|
||||
"on-click": "omarchy-launch-audio",
|
||||
"on-click-right": "pamixer -t",
|
||||
"tooltip-format": "Playing at {volume}%",
|
||||
"scroll-step": 5,
|
||||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"headset": "",
|
||||
"default": ["", "", ""]
|
||||
}
|
||||
},
|
||||
"group/tray-expander": {
|
||||
"orientation": "inherit",
|
||||
"drawer": {
|
||||
"transition-duration": 600,
|
||||
"children-class": "tray-group-item"
|
||||
},
|
||||
"modules": ["custom/expand-icon", "tray"]
|
||||
},
|
||||
"custom/expand-icon": {
|
||||
"format": "",
|
||||
"tooltip": false,
|
||||
"on-scroll-up": "",
|
||||
"on-scroll-down": "",
|
||||
"on-scroll-left": "",
|
||||
"on-scroll-right": ""
|
||||
},
|
||||
"custom/screenrecording-indicator": {
|
||||
"on-click": "omarchy-capture-screenrecording",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh",
|
||||
"signal": 8,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/idle-indicator": {
|
||||
"on-click": "omarchy-toggle-idle",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh",
|
||||
"signal": 9,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/notification-silencing-indicator": {
|
||||
"on-click": "omarchy-toggle-notification-silencing",
|
||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",
|
||||
"signal": 10,
|
||||
"return-type": "json"
|
||||
},
|
||||
"custom/voxtype": {
|
||||
"exec": "omarchy-voxtype-status",
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"idle": "",
|
||||
"recording": "",
|
||||
"transcribing": ""
|
||||
},
|
||||
"tooltip": true,
|
||||
"on-click-right": "omarchy-voxtype-config",
|
||||
"on-click": "omarchy-voxtype-model"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 12,
|
||||
"spacing": 17
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
@import "../omarchy/current/theme/waybar.css";
|
||||
|
||||
* {
|
||||
background-color: @background;
|
||||
color: @foreground;
|
||||
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
padding: 2px 2px;
|
||||
min-height: 0;
|
||||
font-family: 'JetBrainsMono Nerd Font';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.modules-left {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
all: initial;
|
||||
padding: 0 6px;
|
||||
margin: 0 1.5px;
|
||||
min-width: 9px;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#backlight,
|
||||
#custom-weather,
|
||||
#memory,
|
||||
#mpris,
|
||||
#window,
|
||||
#tray,
|
||||
#cpu,
|
||||
#battery,
|
||||
#network,
|
||||
#bluetooth,
|
||||
#pulseaudio,
|
||||
#custom-omarchy,
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator,
|
||||
#custom-update {
|
||||
min-width: 12px;
|
||||
margin: 0 7.5px;
|
||||
}
|
||||
|
||||
#custom-expand-icon {
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
padding: 2px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#custom-update,
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#custom-screenrecording-indicator.active,
|
||||
#custom-idle-indicator.active,
|
||||
#custom-notification-silencing-indicator.active {
|
||||
color: #a55555;
|
||||
}
|
||||
|
||||
#bluetooth {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
#mpris {
|
||||
margin-right: 10px;
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
@import "../omarchy/current/theme/waybar.css";
|
||||
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
font-family: 'JetBrainsMono Nerd Font';
|
||||
font-size: 14px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.modules-left {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: @background;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
padding: 0;
|
||||
margin-left: 5px;
|
||||
transition: .5s;
|
||||
}
|
||||
|
||||
mpris.empty {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
all: initial;
|
||||
padding: 3px 10px 3px 5px;
|
||||
margin: 0 5px;
|
||||
min-width: 9px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
background: @foreground;
|
||||
color: @background;
|
||||
border-radius: 30px;
|
||||
padding: 3px 10px 3px 5px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: alpha(@foreground, .3);
|
||||
border-radius: 30px;
|
||||
padding: 3px 10px 3px 5px;
|
||||
transition: .7s;
|
||||
}
|
||||
|
||||
#workspaces button.active:hover {
|
||||
background: @foreground;
|
||||
color: @background;
|
||||
border-radius: 30px;
|
||||
padding: 3px 10px 3px 5px;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
#custom-weather,
|
||||
#memory,
|
||||
#mpris,
|
||||
#window,
|
||||
#tray-expander,
|
||||
#workspaces,
|
||||
#clock,
|
||||
#cpu,
|
||||
#battery,
|
||||
#network,
|
||||
#bluetooth,
|
||||
#pulseaudio,
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator,
|
||||
#custom-update {
|
||||
background-color: alpha(@foreground, .1);
|
||||
padding: 5px 10px;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
#mpris:hover,
|
||||
#window:hover,
|
||||
#clock:hover,
|
||||
#backlight:hover,
|
||||
#cpu:hover,
|
||||
#network:hover,
|
||||
#bluetooth:hover,
|
||||
#pulseaudio:hover,
|
||||
#custom-screenrecording-indicator:hover,
|
||||
#custom-idle-indicator:hover,
|
||||
#custom-notification-silencing-indicator:hover,
|
||||
#custom-update:hover {
|
||||
background-color: alpha(@foreground, .2);
|
||||
transition: .7s;
|
||||
}
|
||||
|
||||
#custom-expand-icon {
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
#tray,
|
||||
#memory,
|
||||
#custom-weather {
|
||||
background-color: transparent;
|
||||
margin: 5px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
#custom-update,
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
border-radius: 10px;
|
||||
padding: 0 10px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator {
|
||||
border-radius: 10px;
|
||||
min-width: 12px;
|
||||
padding: 0 11px 0 10px;
|
||||
}
|
||||
|
||||
#custom-screenrecording-indicator.active,
|
||||
#custom-idle-indicator.active,
|
||||
#custom-notification-silencing-indicator.active {
|
||||
color: #a55555;
|
||||
}
|
||||
|
||||
#custom-omarchy,
|
||||
#battery {
|
||||
background-color: @foreground;
|
||||
color: @background;
|
||||
min-width: 10px;
|
||||
border-radius: 10px;
|
||||
padding: 0 10px;
|
||||
margin: 5px 0 5px 5px;
|
||||
}
|
||||
|
||||
#workspaces,
|
||||
#mpris {
|
||||
margin: 5px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#window,
|
||||
#mpris {
|
||||
border-radius: 10px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
#tray-expander {
|
||||
padding: 0 0 0 10px;
|
||||
margin-left: 1px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
background-color: alpha(@foreground, .1);
|
||||
border-radius: 10px;
|
||||
padding: 5px 10px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#network {
|
||||
border-radius: 10px 0 0 10px;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
padding: 0 15px 0 10px;
|
||||
border-radius: 0 10px 10px 0;
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
padding: 0 15px 0 10px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
border-radius: 10px;
|
||||
background: @background;
|
||||
border: 3px solid alpha(@foreground, .5);
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
@import "../omarchy/current/theme/waybar.css";
|
||||
|
||||
* {
|
||||
background-color: @background;
|
||||
color: @foreground;
|
||||
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
font-family: 'JetBrainsMono Nerd Font';
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.modules-left {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
all: initial;
|
||||
padding: 0 6px;
|
||||
margin: 0 1.5px;
|
||||
min-width: 9px;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#cpu,
|
||||
#battery,
|
||||
#pulseaudio,
|
||||
#custom-omarchy,
|
||||
#custom-update {
|
||||
min-width: 12px;
|
||||
margin: 0 7.5px;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
#bluetooth {
|
||||
margin-right: 17px;
|
||||
}
|
||||
|
||||
#network {
|
||||
margin-right: 13px;
|
||||
}
|
||||
|
||||
#custom-expand-icon {
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#custom-update {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
margin-left: 8.75px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#custom-screenrecording-indicator,
|
||||
#custom-idle-indicator,
|
||||
#custom-notification-silencing-indicator {
|
||||
min-width: 12px;
|
||||
margin-left: 5px;
|
||||
margin-right: 0;
|
||||
font-size: 10px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
#custom-screenrecording-indicator.active {
|
||||
color: #a55555;
|
||||
}
|
||||
|
||||
#custom-idle-indicator.active,
|
||||
#custom-notification-silencing-indicator.active {
|
||||
color: #a55555;
|
||||
}
|
||||
|
||||
#custom-voxtype {
|
||||
min-width: 12px;
|
||||
margin: 0 0 0 7.5px;
|
||||
}
|
||||
|
||||
#custom-voxtype.recording {
|
||||
color: #a55555;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ _omarchy_complete() {
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _omarchy_complete omarchy
|
||||
complete -o default -F _omarchy_complete omarchy
|
||||
|
||||
# Hide individual omarchy-* binaries from initial-word command completion;
|
||||
# the unified `omarchy` dispatcher is the user-facing entry point.
|
||||
|
||||
@@ -1,58 +1,33 @@
|
||||
# Transcode a video to a good-balance 1080p that's great for sharing online
|
||||
# Transcoding helpers have moved to omarchy-transcode.
|
||||
|
||||
transcode-video-1080p() {
|
||||
ffmpeg -i "$1" -vf scale=1920:1080 -c:v libx264 -preset fast -crf 23 -c:a copy "${1%.*}-1080p.mp4"
|
||||
omarchy-transcode "$1" mp4 1080p
|
||||
}
|
||||
|
||||
# Transcode a video to a good-balance 4K that's great for sharing online
|
||||
transcode-video-4K() {
|
||||
ffmpeg -i "$1" -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 192k "${1%.*}-optimized.mp4"
|
||||
omarchy-transcode "$1" mp4 4k
|
||||
}
|
||||
|
||||
# Transcode a video to an animated GIF using a palette for accurate colors
|
||||
transcode-video-gif() {
|
||||
ffmpeg -i "$1" -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" "${1%.*}.gif"
|
||||
omarchy-transcode "$1" gif 1080p
|
||||
}
|
||||
|
||||
# Transcode any image to JPG image that's great for shrinking wallpapers
|
||||
img2jpg() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -quality 85 -strip "${img%.*}-converted.jpg"
|
||||
omarchy-transcode "$1" jpg high
|
||||
}
|
||||
|
||||
# Transcode any image to a small JPG (max 1080px wide)
|
||||
img2jpg-small() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -resize 1080x\> -quality 85 -strip "${img%.*}-small.jpg"
|
||||
omarchy-transcode "$1" jpg low
|
||||
}
|
||||
|
||||
# Transcode any image to a 4K JPG (max 2160px wide)
|
||||
img2jpg-medium() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -resize 2160x\> -quality 85 -strip "${img%.*}-medium.jpg"
|
||||
omarchy-transcode "$1" jpg medium
|
||||
}
|
||||
|
||||
# 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"
|
||||
omarchy-transcode "$1" jpg high
|
||||
}
|
||||
|
||||
# Transcode any image to compressed-but-lossless PNG
|
||||
img2png() {
|
||||
img="$1"
|
||||
shift
|
||||
|
||||
magick "$img" "$@" -strip -define png:compression-filter=5 \
|
||||
-define png:compression-level=9 \
|
||||
-define png:compression-strategy=1 \
|
||||
-define png:exclude-chunk=all \
|
||||
"${img%.*}-optimized.png"
|
||||
omarchy-transcode "$1" png high
|
||||
}
|
||||
|
||||
@@ -43,6 +43,13 @@ bindd = SUPER CTRL, PRINT, Extract text (OCR) from screenshot, exec, omarchy-cap
|
||||
# File sharing
|
||||
bindd = SUPER CTRL, S, Share, exec, omarchy-menu share
|
||||
|
||||
# Transcoding
|
||||
bindd = SUPER CTRL, R, Transcode, exec, omarchy-menu transcode
|
||||
|
||||
# Workspace layouts
|
||||
bindd = SUPER CTRL, HOME, Restore workspace layout, exec, omarchy-workspace-restore
|
||||
bindd = SUPER CTRL ALT, HOME, Save workspace layout, exec, omarchy-workspace-save
|
||||
|
||||
# Waybar-less information
|
||||
bindd = SUPER CTRL ALT, T, Show time, exec, notify-send -u low " $(date +"%A %H:%M · %d %B %Y · Week %V")"
|
||||
bindd = SUPER CTRL ALT, B, Show battery remaining, exec, notify-send -u low "$(omarchy-battery-status)"
|
||||
|
||||
@@ -4,3 +4,7 @@ general {
|
||||
gaps_in = 0
|
||||
border_size = 0
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding = 0
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ env = GUM_INPUT_HEADER_FOREGROUND,#{{ foreground }}
|
||||
env = GUM_INPUT_HEADER_BACKGROUND,#{{ background }}
|
||||
|
||||
# Gum Choose Style Variables
|
||||
env = GUM_CHOOSE_CURSOR_FOREGROUND,#{{ cursor }}
|
||||
env = GUM_CHOOSE_CURSOR_FOREGROUND,#{{ accent }}
|
||||
env = GUM_CHOOSE_CURSOR_BACKGROUND,#{{ background }}
|
||||
env = GUM_CHOOSE_HEADER_FOREGROUND,#{{ foreground }}
|
||||
env = GUM_CHOOSE_HEADER_BACKGROUND,#{{ background }}
|
||||
|
||||
Executable → Regular
Executable
+1
@@ -0,0 +1 @@
|
||||
gsettings set org.gnome.desktop.interface gtk-enable-primary-paste true
|
||||
@@ -0,0 +1,10 @@
|
||||
echo "Remove stale Xe Panel Replay kernel cmdline from Dell XPS Panther Lake systems"
|
||||
|
||||
DEFAULT_LIMINE="/etc/default/limine"
|
||||
|
||||
if omarchy-hw-match "XPS" && omarchy-hw-intel-ptl; then
|
||||
if [[ -f $DEFAULT_LIMINE ]] && grep -q 'xe\.enable_panel_replay' "$DEFAULT_LIMINE"; then
|
||||
sudo sed -i '/^KERNEL_CMDLINE.*xe\.enable_panel_replay/d' "$DEFAULT_LIMINE"
|
||||
sudo limine-update
|
||||
fi
|
||||
fi
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
echo "Enable middle-click primary paste for GTK/Chromium-family apps (Ghostty, Brave, Chromium)"
|
||||
|
||||
if command -v gsettings >/dev/null; then
|
||||
gsettings set org.gnome.desktop.interface gtk-enable-primary-paste true || true
|
||||
fi
|
||||
@@ -2,7 +2,24 @@ return {
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup()
|
||||
|
||||
local function brighten_borders()
|
||||
for _, group in ipairs({ "FloatBorder", "WinSeparator" }) do
|
||||
vim.api.nvim_set_hl(0, group, { fg = "#6c7086" })
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "catppuccin*",
|
||||
callback = brighten_borders,
|
||||
})
|
||||
|
||||
brighten_borders()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
|
||||
Reference in New Issue
Block a user