BIN
bin/nwg-drawer
BIN
bin/nwg-drawer
Binary file not shown.
13
main.go
13
main.go
@@ -204,6 +204,7 @@ func main() {
|
||||
log.Fatal("Unable to create window:", err)
|
||||
}
|
||||
|
||||
if wayland() {
|
||||
layershell.InitForWindow(win)
|
||||
|
||||
var output2mon map[string]*gdk.Monitor
|
||||
@@ -232,6 +233,7 @@ func main() {
|
||||
}
|
||||
|
||||
layershell.SetKeyboardMode(win, layershell.LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE)
|
||||
}
|
||||
|
||||
win.Connect("destroy", func() {
|
||||
gtk.MainQuit()
|
||||
@@ -274,6 +276,17 @@ func main() {
|
||||
cancelClose()
|
||||
})
|
||||
|
||||
/*
|
||||
In case someone REALLY needed to use X11 - for some stupid Zoom meeting or something, this allows
|
||||
the drawer to behave properly on Openbox, and possibly somewhere else. For sure not on i3.
|
||||
This feature is not really supported and will stay undocumented.
|
||||
*/
|
||||
if !wayland() {
|
||||
println("Not Wayland, oh really?")
|
||||
win.SetDecorated(false)
|
||||
win.Maximize()
|
||||
}
|
||||
|
||||
// Set up UI
|
||||
outerVBox, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 0)
|
||||
win.Add(outerVBox)
|
||||
|
||||
4
tools.go
4
tools.go
@@ -20,6 +20,10 @@ import (
|
||||
"github.com/joshuarubin/go-sway"
|
||||
)
|
||||
|
||||
func wayland() bool {
|
||||
return os.Getenv("WAYLAND_DISPLAY") != "" || os.Getenv("XDG_SESSION_TYPE") == "wayland"
|
||||
}
|
||||
|
||||
/*
|
||||
Window leave-notify-event event quits the program with glib Timeout 500 ms.
|
||||
We might have left the window by accident, so let's clear the timeout if window re-entered.
|
||||
|
||||
Reference in New Issue
Block a user