glazewm icon indicating copy to clipboard operation
glazewm copied to clipboard

Hide the bar (or auto-hide)

Open felipecrp opened this issue 1 year ago • 4 comments

Hi,

It would be great if we could hide the bar. An auto-hide function or binding to hide would enable the use of more space on the screen.

Regards

felipecrp avatar Jul 18 '23 15:07 felipecrp

i made something like that with autohotkey its useable

  • uses autohotkey v1.3
  • download autohotkey
  • then just compile this file that's it

ModifyConfig.ahk

; Define a function to toggle the "height" value in the config.yaml file
ToggleHeightValue() {
    ; Set the path to the config file
    configFile := "C:\Users\<yourname>\.glaze-wm\config.yaml"

    ; Read the contents of the config file
    FileRead, configContent, %configFile%

    ; Toggle the "height" value between "0px" and "30px"
    IfInString, configContent, height: "0px"
        StringReplace, modifiedConfig, configContent, height: "0px", height: "30px"
    Else
        StringReplace, modifiedConfig, configContent, height: "30px", height: "0px"

    ; Write the modified content back to the config file
    FileDelete, %configFile%
    FileAppend, %modifiedConfig%, %configFile%

    ; Send Alt+Shift+R to reload the configuration
    ReloadConfig()
}

; Define a function to reload the config using Alt+Shift+R
ReloadConfig() {
    ; Bring GlazeWM to the front
    WinActivate, ahk_exe GlazeWM.exe
    WinWaitActive, ahk_exe GlazeWM.exe,, 2

    ; Wait for a moment to give focus back to GlazeWM
    Sleep, 0.01

    ; Send Alt+Shift+R to reload the configuration
    SendInput, !+r
}

; Define a hotkey (Alt+Ctrl+]) to trigger the toggle
!^]::ToggleHeightValue()

; Trigger the config reload when the script starts
ReloadConfig()

I hope there they add a official keystroke to the code

hrdkmishra avatar Aug 05 '23 06:08 hrdkmishra

It would be really nice to hide the bar when something is launched in full screen or a full-size borderless window. Many games fight with the bar, and YouTube just gives up the screen estate.

btvoidx avatar Aug 23 '23 17:08 btvoidx

i made something like that with autohotkey its useable

  • uses autohotkey v1.3
  • download autohotkey
  • then just compile this file that's it

ModifyConfig.ahk

; Define a function to toggle the "height" value in the config.yaml file
ToggleHeightValue() {
    ; Set the path to the config file
    configFile := "C:\Users\<yourname>\.glaze-wm\config.yaml"

    ; Read the contents of the config file
    FileRead, configContent, %configFile%

    ; Toggle the "height" value between "0px" and "30px"
    IfInString, configContent, height: "0px"
        StringReplace, modifiedConfig, configContent, height: "0px", height: "30px"
    Else
        StringReplace, modifiedConfig, configContent, height: "30px", height: "0px"

    ; Write the modified content back to the config file
    FileDelete, %configFile%
    FileAppend, %modifiedConfig%, %configFile%

    ; Send Alt+Shift+R to reload the configuration
    ReloadConfig()
}

; Define a function to reload the config using Alt+Shift+R
ReloadConfig() {
    ; Bring GlazeWM to the front
    WinActivate, ahk_exe GlazeWM.exe
    WinWaitActive, ahk_exe GlazeWM.exe,, 2

    ; Wait for a moment to give focus back to GlazeWM
    Sleep, 0.01

    ; Send Alt+Shift+R to reload the configuration
    SendInput, !+r
}

; Define a hotkey (Alt+Ctrl+]) to trigger the toggle
!^]::ToggleHeightValue()

; Trigger the config reload when the script starts
ReloadConfig()

I hope there they add a official keystroke to the code

Thank you for your contribution. It is a nice solution and I will try using it.

Still, I believe it would be great to have this as a builtin feature.

felipecrp avatar Sep 06 '23 02:09 felipecrp

just came here to comment to make this an official! please @lars-berger would love the ability to hide the top bar whenever an application has entered full screen. This would really help for playing games or having transparent fullscreen terminals. Thanks!

something like hiding the top bar when there is a fullscreen application IN THAT workspace. would work wonders. <3

dan-myles avatar Mar 30 '24 04:03 dan-myles

I'm closing feature requests and bugs about the built-in bar since it's now been swapped out for Zebar. If Zebar doesn't fix what you need, a new issue for it can be opened over here

lars-berger avatar Aug 15 '24 08:08 lars-berger