diff --git a/README.md b/README.md index abe4a77..619d76f 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ Usage of nwg-drawer: GTK theme name, eg. "Adwaita-dark" -is int Icon Size (default 64) + -k + Set GTK layer shell keyboard interactivity to "on-demand" mode (default "exclusive") -lang string force lang, e.g. "en", "pl" -nocats diff --git a/main.go b/main.go index 426d138..a4778ca 100644 --- a/main.go +++ b/main.go @@ -118,6 +118,7 @@ func defaultStringIfBlank(s, fallback string) string { var cssFileName = flag.String("s", "drawer.css", "Styling: css file name") var targetOutput = flag.String("o", "", "name of the Output to display the drawer on (sway only)") var displayVersion = flag.Bool("v", false, "display Version information") +var keyboard = flag.Bool("k", false, "Set GTK layer shell keyboard interactivity to 'on-demand' mode") var overlay = flag.Bool("ovl", false, "use OVerLay layer") var gtkTheme = flag.String("g", "", "GTK theme name") var gtkIconTheme = flag.String("i", "", "GTK icon theme name") @@ -386,7 +387,14 @@ func main() { layershell.SetMargin(win, layershell.LAYER_SHELL_EDGE_RIGHT, *marginRight) layershell.SetMargin(win, layershell.LAYER_SHELL_EDGE_BOTTOM, *marginBottom) - layershell.SetKeyboardMode(win, layershell.LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE) + if *keyboard { + log.Info("Setting GTK layer shell keyboard mode to: on-demand") + layershell.SetKeyboardMode(win, layershell.LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND) + } else { + log.Info("Setting GTK layer shell keyboard mode to default: exclusive") + layershell.SetKeyboardMode(win, layershell.LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE) + } + } win.Connect("destroy", func() {