Adding screenshot shortcut.

This commit is contained in:
Rodolphe Breard 2015-07-13 14:04:40 +02:00
parent 5f8555e62f
commit 8085aea394

View file

@ -35,8 +35,10 @@ class ConfigWrapper:
self.groups = [] self.groups = []
self.layouts = [] self.layouts = []
def _add_key(self, key, action, *, extra_mod=None): def _add_key(self, key, action, *, extra_mod=None, no_mod=False):
mod = [self.mod] mod = []
if not no_mod:
mod.append(self.mod)
if extra_mod: if extra_mod:
mod.append(extra_mod) mod.append(extra_mod)
k = Key(mod, key, action) k = Key(mod, key, action)
@ -66,6 +68,11 @@ class ConfigWrapper:
self._add_key('w', lazy.window.kill()) self._add_key('w', lazy.window.kill())
self._add_key('Return', lazy.spawn(self.term)) self._add_key('Return', lazy.spawn(self.term))
self._add_key('l', lazy.spawn('xscreensaver-command --lock')) self._add_key('l', lazy.spawn('xscreensaver-command --lock'))
self._add_key(
'Print',
lazy.spawn("scrot -e 'mv $f ~/pictures/ 2>/dev/null'"),
no_mod=True
)
self._add_key('r', lazy.spawncmd()) self._add_key('r', lazy.spawncmd())
self._add_key('r', lazy.restart(), extra_mod='control') self._add_key('r', lazy.restart(), extra_mod='control')
self._add_key('q', lazy.shutdown(), extra_mod='control') self._add_key('q', lazy.shutdown(), extra_mod='control')