Prevent wiping waybar configs to reposition
This commit is contained in:
@@ -15,31 +15,15 @@ if [[ ! $position =~ ^(top|bottom|left|right)$ ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
if [[ $position == "left" || $position == "right" ]]; then
|
||||||
height=0
|
height=0
|
||||||
width=28
|
width=28
|
||||||
horizontal=false
|
|
||||||
else
|
else
|
||||||
height=26
|
height=26
|
||||||
width=0
|
width=0
|
||||||
horizontal=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change position
|
|
||||||
sed -i -E "s/(\"position\"[[:space:]]*:[[:space:]]*\")[a-z]+(\")/\\1${position}\\2/" "$WAYBAR_CONFIG"
|
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"
|
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
|
omarchy-restart-waybar
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"height": 26,
|
"height": 26,
|
||||||
"width": 0,
|
"width": 0,
|
||||||
"modules-left": ["custom/omarchy", "hyprland/workspaces"],
|
"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-center": ["clock#horizontal", "clock#vertical", "custom/weather", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"group/tray-expander",
|
"group/tray-expander",
|
||||||
"bluetooth",
|
"bluetooth",
|
||||||
@@ -61,12 +61,18 @@
|
|||||||
"on-click": "omarchy-launch-or-focus-tui btop",
|
"on-click": "omarchy-launch-or-focus-tui btop",
|
||||||
"on-click-right": "alacritty"
|
"on-click-right": "alacritty"
|
||||||
},
|
},
|
||||||
"clock": {
|
"clock#horizontal": {
|
||||||
"format": "{:L%A %H:%M}",
|
"format": "{:L%A %H:%M}",
|
||||||
"format-alt": "{:L%d %B W%V %Y}",
|
"format-alt": "{:L%d %B W%V %Y}",
|
||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
||||||
},
|
},
|
||||||
|
"clock#vertical": {
|
||||||
|
"format": "{:%H\n —\n%M}",
|
||||||
|
"format-alt": "{:L%d %B W%V %Y}",
|
||||||
|
"tooltip": false,
|
||||||
|
"on-click-right": "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"
|
||||||
|
},
|
||||||
"custom/weather": {
|
"custom/weather": {
|
||||||
"exec": "$OMARCHY_PATH/default/waybar/weather.sh",
|
"exec": "$OMARCHY_PATH/default/waybar/weather.sh",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
@@ -135,9 +141,13 @@
|
|||||||
"transition-duration": 600,
|
"transition-duration": 600,
|
||||||
"children-class": "tray-group-item"
|
"children-class": "tray-group-item"
|
||||||
},
|
},
|
||||||
"modules": ["custom/expand-icon", "tray"]
|
"modules": ["group/expand-icons", "tray"]
|
||||||
},
|
},
|
||||||
"custom/expand-icon": {
|
"group/expand-icons": {
|
||||||
|
"orientation": "inherit",
|
||||||
|
"modules": ["custom/expand-icon#horizontal", "custom/expand-icon#vertical"]
|
||||||
|
},
|
||||||
|
"custom/expand-icon#horizontal": {
|
||||||
"format": "",
|
"format": "",
|
||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
"on-scroll-up": "",
|
"on-scroll-up": "",
|
||||||
@@ -145,6 +155,15 @@
|
|||||||
"on-scroll-left": "",
|
"on-scroll-left": "",
|
||||||
"on-scroll-right": ""
|
"on-scroll-right": ""
|
||||||
},
|
},
|
||||||
|
"custom/expand-icon#vertical": {
|
||||||
|
"format": "",
|
||||||
|
"rotate": 270,
|
||||||
|
"tooltip": false,
|
||||||
|
"on-scroll-up": "",
|
||||||
|
"on-scroll-down": "",
|
||||||
|
"on-scroll-left": "",
|
||||||
|
"on-scroll-right": ""
|
||||||
|
},
|
||||||
"custom/screenrecording-indicator": {
|
"custom/screenrecording-indicator": {
|
||||||
"on-click": "omarchy-capture-screenrecording",
|
"on-click": "omarchy-capture-screenrecording",
|
||||||
"exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh",
|
"exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh",
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ tooltip {
|
|||||||
#custom-voxtype.recording {
|
#custom-voxtype.recording {
|
||||||
color: #a55555;
|
color: #a55555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left .modules-left, .right .modules-left { margin: 8px 0 0 0; }
|
.left .modules-left, .right .modules-left { margin: 8px 0 0 0; }
|
||||||
.left .modules-right, .right .modules-right { margin: 0 0 8px 0; }
|
.left .modules-right, .right .modules-right { margin: 0 0 8px 0; }
|
||||||
|
|
||||||
@@ -145,3 +146,44 @@ tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.left #custom-voxtype, .right #custom-voxtype { margin: 7.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; }
|
||||||
|
|
||||||
|
#custom-expand-icon.vertical,
|
||||||
|
.left #custom-expand-icon.horizontal,
|
||||||
|
.right #custom-expand-icon.horizontal {
|
||||||
|
opacity: 0;
|
||||||
|
font-size: 0;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left #custom-expand-icon.vertical,
|
||||||
|
.right #custom-expand-icon.vertical {
|
||||||
|
opacity: 1;
|
||||||
|
font-size: inherit;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 12px;
|
||||||
|
margin: 1.5px 0;
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock.vertical,
|
||||||
|
.left #clock.horizontal,
|
||||||
|
.right #clock.horizontal {
|
||||||
|
opacity: 0;
|
||||||
|
font-size: 0;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left #clock.vertical,
|
||||||
|
.right #clock.vertical {
|
||||||
|
opacity: 1;
|
||||||
|
font-size: inherit;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 12px;
|
||||||
|
margin: 8.75px 0 0 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
echo "Refresh Waybar config and style for position support"
|
||||||
|
|
||||||
|
if gum confirm "Replace current Waybar config and style (backups will be made)?"; then
|
||||||
|
omarchy-refresh-waybar
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user