Control Waybar position (#5730)
* Waybar positioning and shape * Reveal weather again on left/right * Fix indicators moving bar left/right * Clean it up * Cleanup * One step forward, one step backwards * Fix styles * More style massage * More tweaks * Just position for now * Fix keys * No longer needed * No need to reset * Simplify * Reset but protect waybar configs * Not needed * Fix glyph * Not needed * Cleanup * Better wording Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
f26cc8f157
commit
afcfaf6b1e
+13
-1
@@ -265,13 +265,15 @@ show_hardware_touchpad_haptics_menu() {
|
||||
}
|
||||
|
||||
show_style_menu() {
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Corners\n Hyprland\n Screensaver\n About") in
|
||||
case $(menu "Style" " Theme\n Unlock\n Font\n Background\n Waybar\n Corners\n Hyprland\n Screensaver\n About") in
|
||||
|
||||
*Theme*) show_theme_menu ;;
|
||||
*Unlock*) omarchy-launch-walker -m menus:omarchyunlocks --width 800 --minheight 400 ;;
|
||||
*Font*) show_font_menu ;;
|
||||
*Background*) show_background_menu ;;
|
||||
*Corners*) show_style_corners_menu ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
||||
*Waybar*) show_waybar_position_menu ;;
|
||||
*Screensaver*) show_screensaver_menu ;;
|
||||
*About*) show_about_menu ;;
|
||||
*) show_main_menu ;;
|
||||
@@ -286,6 +288,16 @@ 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_style_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_about_menu() {
|
||||
case $(menu "About" " Edit Text\n Set From Image\n Restore Default") in
|
||||
*Text*) omarchy-branding-about text ;;
|
||||
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set Waybar position
|
||||
# omarchy:args=<top|bottom|left|right>
|
||||
# omarchy:examples=omarchy-style-waybar-position top | omarchy style waybar-position bottom
|
||||
|
||||
set -e
|
||||
|
||||
WAYBAR_CONFIG="$HOME/.config/waybar/config.jsonc"
|
||||
|
||||
position=$1
|
||||
|
||||
if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then
|
||||
echo "Usage: omarchy-style-waybar-position top|bottom|left|right" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Reset config and styles before making adjustments
|
||||
omarchy-refresh-config waybar/config.jsonc
|
||||
omarchy-refresh-config waybar/style.css
|
||||
|
||||
if [[ $position == "left" || $position == "right" ]]; then
|
||||
height=0
|
||||
width=26
|
||||
horizontal=false
|
||||
else
|
||||
height=26
|
||||
width=0
|
||||
horizontal=true
|
||||
fi
|
||||
|
||||
# Change position
|
||||
sed -i -E "s/(\"position\"[[:space:]]*:[[:space:]]*\")[a-z]+(\")/\\1${position}\\2/" "$WAYBAR_CONFIG"
|
||||
|
||||
# Change height/width
|
||||
sed -i -E "s/(\"height\"[[:space:]]*:[[:space:]]*)[0-9]+/\\1${height}/; s/(\"width\"[[:space:]]*:[[:space:]]*)[0-9]+/\\1${width}/" "$WAYBAR_CONFIG"
|
||||
|
||||
# Change the clock format
|
||||
if [[ $horizontal == true ]]; then
|
||||
sed -i -E '/"clock"[[:space:]]*:[[:space:]]*\{/,/\}/ s/"format"[[:space:]]*:[[:space:]]*"[^"]*"/"format": "{:L%A %H:%M}"/' "$WAYBAR_CONFIG"
|
||||
else
|
||||
sed -i -E '/"clock"[[:space:]]*:[[:space:]]*\{/,/\}/ s/"format"[[:space:]]*:[[:space:]]*"[^"]*"/"format": "{:%H\\n —\\n%M}"/' "$WAYBAR_CONFIG"
|
||||
fi
|
||||
|
||||
omarchy-restart-waybar
|
||||
@@ -4,6 +4,7 @@
|
||||
"position": "top",
|
||||
"spacing": 0,
|
||||
"height": 26,
|
||||
"width": 0,
|
||||
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
|
||||
"modules-center": ["clock", "custom/weather", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||
"modules-right": [
|
||||
|
||||
@@ -70,6 +70,7 @@ tooltip {
|
||||
#custom-weather {
|
||||
margin-left: 7.5px;
|
||||
margin-right: 7.5px;
|
||||
min-width: 14px;
|
||||
}
|
||||
|
||||
#custom-weather.unavailable {
|
||||
@@ -109,3 +110,38 @@ tooltip {
|
||||
#custom-voxtype.recording {
|
||||
color: #a55555;
|
||||
}
|
||||
.left .modules-left, .right .modules-left { margin: 8px 0 0 0; }
|
||||
.left .modules-right, .right .modules-right { margin: 0 0 8px 0; }
|
||||
|
||||
.left #workspaces button, .right #workspaces button {
|
||||
padding: 6px 0;
|
||||
margin: 1.5px 0;
|
||||
}
|
||||
|
||||
.left #cpu, .right #cpu,
|
||||
.left #battery, .right #battery,
|
||||
.left #pulseaudio, .right #pulseaudio,
|
||||
.left #custom-omarchy, .right #custom-omarchy,
|
||||
.left #custom-update, .right #custom-update {
|
||||
margin: 1.5px 0;
|
||||
padding: 6px 0;
|
||||
min-width: 0;
|
||||
min-height: 12px;
|
||||
}
|
||||
|
||||
.left #tray, .right #tray { margin: 0 0 16px 0; }
|
||||
.left #bluetooth, .right #bluetooth { margin: 1.5px 0; padding: 6px 0; min-height: 12px; }
|
||||
.left #network, .right #network { margin: 1.5px 0; padding: 6px 0; min-height: 12px; }
|
||||
.left #custom-expand-icon, .right #custom-expand-icon { margin: 1.5px 0; padding: 6px 0; min-height: 12px; }
|
||||
.left #clock, .right #clock { margin: 8.75px 0 0 0; }
|
||||
.left #custom-weather, .right #custom-weather { margin: 1.5px 0; padding: 6px 0; min-height: 12px; min-width: 14px; margin-right: 4px; }
|
||||
|
||||
.left #custom-screenrecording-indicator, .right #custom-screenrecording-indicator,
|
||||
.left #custom-idle-indicator, .right #custom-idle-indicator,
|
||||
.left #custom-notification-silencing-indicator, .right #custom-notification-silencing-indicator {
|
||||
margin: 5px 0 0 0;
|
||||
min-width: 0;
|
||||
min-height: 12px;
|
||||
}
|
||||
|
||||
.left #custom-voxtype, .right #custom-voxtype { margin: 7.5px 0 0 0; min-width: 0; min-height: 12px; }
|
||||
|
||||
@@ -13,6 +13,10 @@ bindd = , XF86Calculator, Calculator, exec, gnome-calculator
|
||||
|
||||
# Aesthetics
|
||||
bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar
|
||||
bindd = SUPER SHIFT CTRL, UP, Move Waybar to top, exec, omarchy-style-waybar-position top
|
||||
bindd = SUPER SHIFT CTRL, DOWN, Move Waybar to bottom, exec, omarchy-style-waybar-position bottom
|
||||
bindd = SUPER SHIFT CTRL, LEFT, Move Waybar to left, exec, omarchy-style-waybar-position left
|
||||
bindd = SUPER SHIFT CTRL, RIGHT, Move Waybar to right, exec, omarchy-style-waybar-position right
|
||||
bindd = SUPER CTRL, SPACE, Theme background menu, exec, omarchy-menu background
|
||||
bindd = SUPER SHIFT CTRL, SPACE, Theme menu, exec, omarchy-menu theme
|
||||
bindd = SUPER, BACKSPACE, Toggle window transparency, exec, omarchy-hyprland-window-transparency-toggle
|
||||
|
||||
Reference in New Issue
Block a user