Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make notification via awful #55

Open
kleinpetr opened this issue Jun 6, 2020 · 1 comment
Open

make notification via awful #55

kleinpetr opened this issue Jun 6, 2020 · 1 comment

Comments

@kleinpetr
Copy link

kleinpetr commented Jun 6, 2020

Hey,

is there some chance to generate custom notification via awful?

I am creating my own sh script for toggling keyboard layouts like this

#!/bin/bash

actual_layout=$(setxkbmap -query | grep layout)

if [[ $actual_layout == *"us"* ]]; then
        setxkbmap -layout "cz(qwerty)"
else
        setxkbmap -layout "us"
fi

xmodmap $HOME/.Xmodmap

and rebind the keys/global.lua shortcut mod+space, like this

awful.key(
    {modkey},
    'space',
    function()
      -- _G.screen.primary.left_panel:toggle(true)
      awful.spawn('nextkblayout.sh')
      -- HERE I WANT SHOW NOTIFICATION WITH CUSTOM MESSAGE
    end,
    {description = 'show main menu', group = 'awesome'}
  ),

is it possible?

@kleinpetr
Copy link
Author

Ok I am found the naught solution like this

awful.spawn.easy_async_with_shell('nextkblayout', function(out)
        naughty.notify({
          title = 'Keyboard layout switched',
          text = out
        })
      end)

but the notify appears after few seconds, not at the same moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant