BlingCorp / bling

Utilities for the awesome window manager
https://blingcorp.github.io/bling/
MIT License
851 stars 51 forks source link

Scratchpads won't work #176

Closed ForgotMyPasswd closed 2 years ago

ForgotMyPasswd commented 2 years ago

Hello, I'm trying to setup scratchpads so i could get a dropdown terminal on any tag without switching to my terminal tag, which I have set my terminal to always open on. I tried copying the example, swapping out wezterm for kitty:

local bling = require("modules.bling")

local term_scratch = bling.module.scratchpad {
    command = "kitty --class=spad",                   -- How to spawn the scratchpad
    rule = { instance = "spad" },                     -- The rule that the scratchpad will be searched by
    sticky = true,                                    -- Whether the scratchpad should be sticky
    autoclose = true,                                 -- Whether it should hide itself when losing focus
    floating = true,                                  -- Whether it should be floating (MUST BE TRUE FOR ANIMATIONS)
    geometry = {x=0, y=0, height=300, width=1366}, -- The geometry in a floating state
    reapply = true,                                   -- Whether all those properties should be reapplied on every new opening of the scratchpad (MUST BE TRUE FOR ANIMATIONS)
    dont_focus_before_close  = false,                 -- When set to true, the scratchpad will be closed by the toggle function regardless of whether its focused or not. When set to false, the toggle function will first bring the scratchpad into focus and only close it on a second call
}

And then toggling the scratchpad with a keybind:

awful.keyboard.append_global_keybinding({
  awful.key({ modkey, "Shift"}, "Return", function() term_scratch:toggle() end,
    {description = "Toggle Drop-Down Terminal", group = "Applications"}),
})

But the scratchpad won't open. I've tried with other terminals but it wont work for me, and I'm not sure why. Thanks in advance for any help.

Nooo37 commented 2 years ago

Is there any error in stdout?

ForgotMyPasswd commented 2 years ago

Is there any error in stdout?

How would I capture the stdout for the module?

javacafe01 commented 2 years ago

@Forgotten-Email When I try your code the keybind portion breaks. Your actual scratchpad code works fine.

javacafe01 commented 2 years ago

@Forgotten-Email found the issue.

In AwesomeWM there is awful.keyboard.append_global_keybinding and awful.keyboard.append_global_keybindings. Because you are using a table of key(s), you need the latter.

ForgotMyPasswd commented 2 years ago

@Forgotten-Email found the issue.

In AwesomeWM there is awful.keyboard.append_global_keybinding and awful.keyboard.append_global_keybindings. Because you are using a table of key(s), you need the latter.

That worked, I’m surprised I didn’t realise that before. Thanks for the help :D