Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Show/Hide waybar on specific workspace

Open longwasu opened this issue 2 years ago • 5 comments

How can I only hide waybar on workspace 1. I'm using hyprland.

Or only show on workspaces that have no application.

My monitor is small so I want it has more space to display.

longwasu avatar Sep 18 '23 12:09 longwasu

I don't think the former can be done with Waybar configuration, but it could be achieved using Hyprland IPC or a Hyprland plugin and their workspace event. E.g. based on the event, you could send SIGUSR1 to the waybar process.

The latter might be possible if you use the Window module. I think (but I have not tried) you could style window#waybar as hidden, and then window#waybar.empty as visible. Again though I think this could be better solved by reacting to Hyprland events via IPC.

RobertMueller2 avatar Sep 23 '23 06:09 RobertMueller2

longwasu

Friend, looking for your question I needed to run waydroid in full screen to watch movies And I managed to add a windowrule to the configuration file:

windowrule = fullscreen,^(Waydroid)$

more in : wiki

netoxhoppus avatar Feb 29 '24 05:02 netoxhoppus

You can hide waybar on specific workspace using the following script make sure to have socat installed and to give it proper permission with sudo chmod +x waybar.sh #!/usr/bin/env bash

hidden_on_workspace=3

hide() { killall -SIGUSR1 waybar && touch /tmp/waybar_is_hidden }

show() { if [ -f /tmp/waybar_is_hidden ]; then killall -SIGUSR1 waybar && rm /tmp/waybar_is_hidden >> /dev/null 2>&1 fi }

sleep 1

current_workspace=$(hyprctl activeworkspace | awk 'match($0, /ID ([0-9]+)/, id){print id[1]}') [ $hidden_on_workspace -eq $current_workspace ] && hide

socket_path="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"

if [ -z "$socket_path" ]; then echo "Error: Hyprland socket not found. Is Hyprland running?" exit 1 fi

socat -u "UNIX-CONNECT:$socket_path" STDOUT | while read -r event; do case $event in workspace>>$hidden_on_workspace ) hide ;; workspace>>* ) show ;; esac done

show

Sliman-Baghouri avatar Aug 12 '24 10:08 Sliman-Baghouri

i kinda want to do this on sway, i have one portrait monitor and the bar is just too crowded on it for my tastes. I have specific workspaces bound to that monitor, anyone got tips?

Fuseteam avatar Aug 29 '24 17:08 Fuseteam

oh nvm found the wiki, looks like it is easier in my case just need to define output

Fuseteam avatar Aug 29 '24 17:08 Fuseteam

Old post I know, but if you find this like I did I have a solution. Set up a script to toggle each specific bar, then pkill that process individually.

skytale75 avatar Feb 12 '25 19:02 skytale75