Add Quickshell bar
This commit is contained in:
@@ -251,6 +251,8 @@ stop_screenrecording() {
|
||||
|
||||
toggle_screenrecording_indicator() {
|
||||
pkill -RTMIN+8 waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
quickshell ipc -p "$OMARCHY_PATH/default/quickshell/bar" call bar refreshScreenRecording >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
screenrecording_active() {
|
||||
|
||||
@@ -3,4 +3,28 @@
|
||||
# omarchy:summary=Show current monospace font
|
||||
# omarchy:examples=omarchy font current
|
||||
|
||||
grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1
|
||||
bar_config="$HOME/.config/omarchy/bar.json"
|
||||
|
||||
if [[ -f $bar_config ]]; then
|
||||
font_family=$(python3 - "$bar_config" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
|
||||
try:
|
||||
with open(sys.argv[1]) as file:
|
||||
data = json.load(file)
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
data = {}
|
||||
|
||||
font = data.get("fontFamily") if isinstance(data, dict) else None
|
||||
if font:
|
||||
print(font)
|
||||
PY
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ -n $font_family ]]; then
|
||||
printf '%s\n' "$font_family"
|
||||
else
|
||||
grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1
|
||||
fi
|
||||
|
||||
@@ -28,6 +28,26 @@ if [[ -n $font_name ]]; then
|
||||
|
||||
sed -i "s/font_family = .*/font_family = $font_name/g" ~/.config/hypr/hyprlock.conf
|
||||
sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/waybar/style.css
|
||||
mkdir -p "$HOME/.config/omarchy"
|
||||
python3 - "$HOME/.config/omarchy/bar.json" "$font_name" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
|
||||
path, font_name = sys.argv[1], sys.argv[2]
|
||||
try:
|
||||
with open(path) as file:
|
||||
data = json.load(file)
|
||||
if not isinstance(data, dict):
|
||||
data = {}
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
data = {}
|
||||
|
||||
data["fontFamily"] = font_name
|
||||
|
||||
with open(path, "w") as file:
|
||||
json.dump(data, file, indent=2)
|
||||
file.write("\n")
|
||||
PY
|
||||
sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/swayosd/style.css
|
||||
xmlstarlet ed -L \
|
||||
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/string' \
|
||||
@@ -35,6 +55,10 @@ if [[ -n $font_name ]]; then
|
||||
~/.config/fontconfig/fonts.conf
|
||||
|
||||
omarchy-restart-waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
if quickshell list -p "$OMARCHY_PATH/default/quickshell/bar" 2>/dev/null | grep -q '^Instance '; then
|
||||
omarchy-restart-bar
|
||||
fi
|
||||
omarchy-restart-swayosd
|
||||
|
||||
if pgrep -x ghostty; then
|
||||
|
||||
+15
-15
@@ -218,7 +218,7 @@ show_toggle_menu() {
|
||||
*Nightlight*) omarchy-toggle-nightlight ;;
|
||||
*Idle*) omarchy-toggle-idle ;;
|
||||
*Notifications*) omarchy-toggle-notification-silencing ;;
|
||||
*Bar*) omarchy-toggle-waybar ;;
|
||||
*Bar*) omarchy-toggle-bar ;;
|
||||
*Layout*) omarchy-hyprland-workspace-layout-toggle ;;
|
||||
*Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;;
|
||||
*Gaps*) omarchy-hyprland-window-gaps-toggle ;;
|
||||
@@ -271,7 +271,7 @@ show_hardware_touchpad_haptics_menu() {
|
||||
}
|
||||
|
||||
show_style_menu() {
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Waybar\n Corners\n Hyprland\n Screensaver\n About") in
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Bar\n Corners\n Hyprland\n Screensaver\n About") in
|
||||
|
||||
*Theme*) show_theme_menu ;;
|
||||
*Unlock*) omarchy-launch-walker -m menus:omarchyunlocks --width 800 --minheight 400 ;;
|
||||
@@ -279,7 +279,7 @@ show_style_menu() {
|
||||
*Background*) show_background_menu ;;
|
||||
*Corners*) show_style_corners_menu ;;
|
||||
*Hyprland*) open_in_editor "$(hypr_config_file looknfeel)" ;;
|
||||
*Waybar*) show_waybar_position_menu ;;
|
||||
*Bar*) show_bar_position_menu ;;
|
||||
*Screensaver*) show_screensaver_menu ;;
|
||||
*About*) show_about_menu ;;
|
||||
*) show_main_menu ;;
|
||||
@@ -294,12 +294,12 @@ show_style_corners_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
show_waybar_position_menu() {
|
||||
case $(menu "Waybar Position" " Top\n Bottom\n Left\n Right") in
|
||||
*Top*) omarchy-style-waybar-position top ;;
|
||||
*Bottom*) omarchy-style-waybar-position bottom ;;
|
||||
*Left*) omarchy-style-waybar-position left ;;
|
||||
*Right*) omarchy-style-waybar-position right ;;
|
||||
show_bar_position_menu() {
|
||||
case $(menu "Bar Position" " Top\n Bottom\n Left\n Right") in
|
||||
*Top*) omarchy-style-bar-position top ;;
|
||||
*Bottom*) omarchy-style-bar-position bottom ;;
|
||||
*Left*) omarchy-style-bar-position left ;;
|
||||
*Right*) omarchy-style-bar-position right ;;
|
||||
*) show_style_menu ;;
|
||||
esac
|
||||
}
|
||||
@@ -489,14 +489,14 @@ show_setup_default_editor_menu() {
|
||||
}
|
||||
|
||||
show_setup_config_menu() {
|
||||
case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
||||
case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Bar\n XCompose") in
|
||||
*Hyprland*) open_in_editor "$(hypr_config_file hyprland)" ;;
|
||||
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;;
|
||||
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
|
||||
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;;
|
||||
*Swayosd*) open_in_editor ~/.config/swayosd/config.toml && omarchy-restart-swayosd ;;
|
||||
*Walker*) open_in_editor ~/.config/walker/config.toml && omarchy-restart-walker ;;
|
||||
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && omarchy-restart-waybar ;;
|
||||
*Bar*) open_in_editor ~/.config/omarchy/bar.json && omarchy-restart-bar ;;
|
||||
*XCompose*) open_in_editor ~/.XCompose && omarchy-restart-xcompose ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
@@ -813,19 +813,19 @@ show_update_channel_menu() {
|
||||
esac
|
||||
}
|
||||
show_update_process_menu() {
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Mako\n Swayosd\n Walker\n Waybar") in
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Mako\n Swayosd\n Walker\n Bar") 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 ;;
|
||||
*Bar*) omarchy-restart-bar ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_update_config_menu() {
|
||||
case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Plymouth\n Swayosd\n Tmux\n Walker\n Waybar") in
|
||||
case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Plymouth\n Swayosd\n Tmux\n Walker\n Bar") in
|
||||
*Hyprland*) present_terminal omarchy-refresh-hyprland ;;
|
||||
*Hypridle*) present_terminal omarchy-refresh-hypridle ;;
|
||||
*Hyprlock*) present_terminal omarchy-refresh-hyprlock ;;
|
||||
@@ -834,7 +834,7 @@ show_update_config_menu() {
|
||||
*Swayosd*) present_terminal omarchy-refresh-swayosd ;;
|
||||
*Tmux*) present_terminal omarchy-refresh-tmux ;;
|
||||
*Walker*) present_terminal omarchy-refresh-walker ;;
|
||||
*Waybar*) present_terminal omarchy-refresh-waybar ;;
|
||||
*Bar*) present_terminal omarchy-refresh-bar ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Reset bar user overrides to Omarchy defaults
|
||||
# omarchy:examples=omarchy refresh bar
|
||||
|
||||
set -e
|
||||
|
||||
OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}"
|
||||
DEFAULT_CONFIG="$OMARCHY_PATH/config/omarchy/bar.json"
|
||||
|
||||
if [[ ! -f $DEFAULT_CONFIG ]]; then
|
||||
echo "Missing default bar config at $DEFAULT_CONFIG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
omarchy-refresh-config omarchy/bar.json
|
||||
omarchy-restart-bar
|
||||
@@ -18,8 +18,9 @@ USAGE
|
||||
fi
|
||||
|
||||
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprlock.conf.bak.1753817951)
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
user_config_file="${HOME}/.config/$config_file"
|
||||
default_config_file="${HOME}/.local/share/omarchy/config/$config_file"
|
||||
default_config_file="$OMARCHY_PATH/config/$config_file"
|
||||
backup_config_file="$user_config_file.bak.$(date +%s)"
|
||||
|
||||
mkdir -p "$(dirname "$user_config_file")"
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Restart the bar
|
||||
# omarchy:examples=omarchy restart bar
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
CONFIG_DIR="$OMARCHY_PATH/default/quickshell/bar"
|
||||
|
||||
quickshell kill -p "$CONFIG_DIR" >/dev/null 2>&1 || true
|
||||
setsid uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$CONFIG_DIR" >/dev/null 2>&1 &
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set bar position
|
||||
# omarchy:args=<top|bottom|left|right>
|
||||
# omarchy:examples=omarchy-style-bar-position top | omarchy style bar position bottom
|
||||
|
||||
set -e
|
||||
|
||||
CONFIG_FILE="$HOME/.config/omarchy/bar.json"
|
||||
position=$1
|
||||
|
||||
if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then
|
||||
echo "Usage: omarchy-style-bar-position top|bottom|left|right" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$CONFIG_FILE")"
|
||||
python3 - "$CONFIG_FILE" "$position" <<'PY'
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
path, position = sys.argv[1], sys.argv[2]
|
||||
try:
|
||||
with open(path) as file:
|
||||
data = json.load(file)
|
||||
if not isinstance(data, dict):
|
||||
data = {}
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
data = {}
|
||||
|
||||
data["position"] = position
|
||||
|
||||
with open(path, "w") as file:
|
||||
json.dump(data, file, indent=2)
|
||||
file.write("\n")
|
||||
PY
|
||||
|
||||
omarchy-restart-bar
|
||||
@@ -53,6 +53,10 @@ fi
|
||||
if pgrep -x waybar >/dev/null; then
|
||||
omarchy-restart-waybar
|
||||
fi
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
if quickshell list -p "$OMARCHY_PATH/default/quickshell/bar" 2>/dev/null | grep -q '^Instance '; then
|
||||
omarchy-restart-bar
|
||||
fi
|
||||
omarchy-restart-swayosd
|
||||
omarchy-restart-terminal
|
||||
omarchy-restart-hyprctl
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle bar visibility
|
||||
# omarchy:examples=omarchy toggle bar
|
||||
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
CONFIG_DIR="$OMARCHY_PATH/default/quickshell/bar"
|
||||
|
||||
omarchy-toggle bar-off
|
||||
|
||||
if quickshell list -p "$CONFIG_DIR" 2>/dev/null | grep -q '^Instance '; then
|
||||
quickshell kill -p "$CONFIG_DIR" >/dev/null 2>&1 || true
|
||||
else
|
||||
uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$CONFIG_DIR" >/dev/null 2>&1 &
|
||||
fi
|
||||
@@ -11,3 +11,5 @@ else
|
||||
fi
|
||||
|
||||
pkill -RTMIN+9 waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
quickshell ipc -p "$OMARCHY_PATH/default/quickshell/bar" call bar refreshIndicators >/dev/null 2>&1 || true
|
||||
|
||||
@@ -11,3 +11,5 @@ else
|
||||
fi
|
||||
|
||||
pkill -RTMIN+10 waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
quickshell ipc -p "$OMARCHY_PATH/default/quickshell/bar" call bar refreshIndicators >/dev/null 2>&1 || true
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Ensure Waybar icon offering the available update is removed
|
||||
# omarchy:summary=Ensure the status bar icon offering the available update is removed
|
||||
|
||||
pkill -RTMIN+7 waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
quickshell ipc -p "$OMARCHY_PATH/default/quickshell/bar" call bar refreshUpdate >/dev/null 2>&1 || true
|
||||
exit 0
|
||||
|
||||
@@ -21,5 +21,9 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then
|
||||
voxtype setup systemd
|
||||
|
||||
omarchy-restart-waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
if quickshell list -p "$OMARCHY_PATH/default/quickshell/bar" 2>/dev/null | grep -q '^Instance '; then
|
||||
omarchy-restart-bar
|
||||
fi
|
||||
notify-send " Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000
|
||||
fi
|
||||
|
||||
@@ -6,3 +6,7 @@ set -e
|
||||
|
||||
omarchy-launch-floating-terminal-with-presentation "voxtype setup model"
|
||||
omarchy-restart-waybar
|
||||
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
|
||||
if quickshell list -p "$OMARCHY_PATH/default/quickshell/bar" 2>/dev/null | grep -q '^Instance '; then
|
||||
omarchy-restart-bar
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user