Add Quickshell bar

This commit is contained in:
Ryan Hughes
2026-05-14 02:21:47 -04:00
parent 6b074c7a17
commit 30dc9fddde
21 changed files with 1812 additions and 24 deletions
+2
View File
@@ -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() {
+25 -1
View File
@@ -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
+24
View File
@@ -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
View File
@@ -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
}
+17
View File
@@ -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
+2 -1
View File
@@ -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")"
+10
View File
@@ -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 &
+39
View File
@@ -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
+4
View File
@@ -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
+15
View File
@@ -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
+2
View File
@@ -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
+3 -1
View File
@@ -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
+4
View File
@@ -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
+4
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
{}
+1 -1
View File
@@ -1,7 +1,7 @@
hl.on("hyprland.start", function()
hl.exec_cmd("uwsm-app -- hypridle")
hl.exec_cmd("uwsm-app -- mako")
hl.exec_cmd("! omarchy-toggle-enabled waybar-off && uwsm-app -- waybar")
hl.exec_cmd("! omarchy-toggle-enabled bar-off && uwsm-app -- env OMARCHY_PATH=$HOME/.local/share/omarchy quickshell -p $HOME/.local/share/omarchy/default/quickshell/bar")
hl.exec_cmd("uwsm-app -- fcitx5 --disable notificationitem")
hl.exec_cmd("uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill")
hl.exec_cmd("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1")
+5 -5
View File
@@ -11,11 +11,11 @@ hl.bind("SUPER + K", hl.dsp.exec_cmd("omarchy-menu-keybindings"), { description
hl.bind("SUPER + ALT + K", hl.dsp.exec_cmd("omarchy-menu-tmux-keybindings"), { description = "Show Tmux key bindings" })
hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"), { description = "Calculator" })
hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_cmd("omarchy-toggle-waybar"), { description = "Toggle top bar" })
hl.bind("SUPER + SHIFT + CTRL + UP", hl.dsp.exec_cmd("omarchy-style-waybar-position top"), { description = "Move Waybar to top" })
hl.bind("SUPER + SHIFT + CTRL + DOWN", hl.dsp.exec_cmd("omarchy-style-waybar-position bottom"), { description = "Move Waybar to bottom" })
hl.bind("SUPER + SHIFT + CTRL + LEFT", hl.dsp.exec_cmd("omarchy-style-waybar-position left"), { description = "Move Waybar to left" })
hl.bind("SUPER + SHIFT + CTRL + RIGHT", hl.dsp.exec_cmd("omarchy-style-waybar-position right"), { description = "Move Waybar to right" })
hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_cmd("omarchy-toggle-bar"), { description = "Toggle top bar" })
hl.bind("SUPER + SHIFT + CTRL + UP", hl.dsp.exec_cmd("omarchy-style-bar-position top"), { description = "Move bar to top" })
hl.bind("SUPER + SHIFT + CTRL + DOWN", hl.dsp.exec_cmd("omarchy-style-bar-position bottom"), { description = "Move bar to bottom" })
hl.bind("SUPER + SHIFT + CTRL + LEFT", hl.dsp.exec_cmd("omarchy-style-bar-position left"), { description = "Move bar to left" })
hl.bind("SUPER + SHIFT + CTRL + RIGHT", hl.dsp.exec_cmd("omarchy-style-bar-position right"), { description = "Move bar to right" })
hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu background"), { description = "Background switcher" })
hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu theme"), { description = "Theme menu" })
hl.bind("SUPER + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-transparency-toggle"), { description = "Toggle window transparency" })
+108
View File
@@ -0,0 +1,108 @@
# Omarchy bar
This is the Quickshell implementation of the Omarchy status bar.
- `shell.qml` is Omarchy-owned bar engine code. Users should not edit it directly.
- `bar-defaults.json` is the Omarchy-owned default layout and module settings.
- User overrides live in `~/.config/omarchy/bar.json` and are merged over defaults at runtime.
- `omarchy-style-bar-position` updates only the user override file.
- Wi-Fi/LAN state is polled from the active route and NetworkManager so the QML can mirror Waybar's network icons.
- Tooltips use a small Quickshell `PopupWindow`, not Qt Quick Controls' clipped default tooltip.
Example user override:
```json
{
"position": "right",
"layout": {
"left": ["omarchy", "workspaces"],
"center": ["clock", "weather", "update"],
"right": ["tray", "bluetooth", "network", "audio", "cpu", "battery"]
},
"modules": {
"clock": {
"format": "HH:mm",
"formatAlt": "dd MMMM 'W'ww yyyy",
"verticalFormat": "HH\n—\nmm"
}
}
}
```
`centerAnchor` defaults to `clock`. When the anchor module is present in the `center` list, it is pinned to the exact center of the bar and modules before/after it flank that anchor. If the anchor is not in the center list, the center list is centered as a group.
Available built-in modules: `omarchy`, `workspaces`, `clock`, `weather`, `update`, `voxtype`, `screenRecording`, `idle`, `notifications`, `tray`, `bluetooth`, `network`, `audio`, `cpu`, `battery`.
## Custom modules
Add a module name to a layout list, then define it under `modules` in `~/.config/omarchy/bar.json`.
For simple text/JSON output, use a command module:
```json
{
"layout": {
"right": ["tray", "vpn", "audio", "cpu"]
},
"modules": {
"vpn": {
"type": "command",
"exec": "~/.config/omarchy/bar/scripts/vpn-status",
"interval": 5,
"tooltip": "VPN",
"onClick": "nm-connection-editor"
}
}
}
```
The command may print plain text or Waybar-style JSON, for example:
```json
{"text":"󰌆","tooltip":"Work VPN","class":"active"}
```
For advanced custom UI, use QML:
```json
{
"layout": {
"right": ["gpu", "audio", "cpu"]
},
"modules": {
"gpu": {
"type": "qml"
}
}
}
```
Then create `~/.config/omarchy/bar/modules/gpu.qml`. If you want to store it elsewhere, add a `source` path.
Custom QML modules should be an `Item` with `implicitWidth` and `implicitHeight`. They may optionally define these properties, which the bar fills after loading:
```qml
import QtQuick
Item {
property var bar
property string moduleName
property var settings
implicitWidth: 28
implicitHeight: bar ? bar.barSize : 26
Text {
anchors.centerIn: parent
text: "GPU"
color: bar ? bar.foreground : "white"
font.family: bar ? bar.fontFamily : "monospace"
font.pixelSize: 12
}
MouseArea {
anchors.fill: parent
onClicked: if (bar) bar.run("omarchy-launch-or-focus-tui btop")
}
}
```
+17
View File
@@ -0,0 +1,17 @@
{
"position": "top",
"fontFamily": "JetBrainsMono Nerd Font",
"centerAnchor": "clock",
"layout": {
"left": ["omarchy", "workspaces"],
"center": ["clock", "weather", "update", "voxtype", "screenRecording", "idle", "notifications"],
"right": ["tray", "bluetooth", "network", "audio", "cpu", "battery"]
},
"modules": {
"clock": {
"format": "dddd HH:mm",
"formatAlt": "dd MMMM 'W'ww yyyy",
"verticalFormat": "HH\n—\nmm"
}
}
}
File diff suppressed because it is too large Load Diff