diff options
Diffstat (limited to '.config/qtile/keys.py')
-rw-r--r-- | .config/qtile/keys.py | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/.config/qtile/keys.py b/.config/qtile/keys.py index dd48118..80f7ee0 100644 --- a/.config/qtile/keys.py +++ b/.config/qtile/keys.py @@ -6,13 +6,35 @@ from libqtile.config import Click, Drag class MyKeys(): + """ + My usual keybindings. + + I use emacs-like keybindings, I prefer to initialize them + in config.py and change my browser and term in different + machines, or even mod if I'm on a mac. This way I won't have conflicting + keybindings between machines. + """ + def __init__(self, mod, browser, term, editor): + """ + Usual customization. + + I usually change those quite often in my config.py. + I prefer having my keys seperated so I won't mess anything up, + especially if you are running the same config in different machines + """ self.mod = mod self.browser = browser self.term = term self.editor = editor def init_keys(self): + """ + Keyboard keybindings | Emacs-like | Set them and forget them. + + I'm used to having the superkey to control my window manager, + and control for my emacs. + """ my_keys = [ Key([self.mod], "Return", lazy.spawn(self.term), @@ -110,35 +132,39 @@ class MyKeys(): # Volume controls Key([], "XF86AudioLowerVolume", lazy.spawn('amixer sset Master 5%-'), - ), + ), Key([], "XF86AudioRaiseVolume", lazy.spawn('amixer sset Master 5%+'), - ), - # Spotify - Key([self.mod, "shift"], "p", + ), + # Music controls | MOC + Key([self.mod], "p", lazy.spawn("mocp -G "), - ), - Key([self.mod, "shift"], "n", + ), + Key([self.mod], "o", lazy.spawn("mocp -f"), - ), - Key([self.mod, "shift"], "b", + ), + Key([self.mod], "i", lazy.spawn("mocp -r"), - ), + ), # Change languages Key([self.mod], "F1", - lazy.spawn("setxkbmap us -option ctrl:swapcaps"), - ), - Key([self.mod],"F2", - lazy.spawn("setxkbmap gr"), - ), + lazy.spawn("setxkbmap us -option ctrl:swapcaps"), + ), + Key([self.mod], "F2", + lazy.spawn("setxkbmap gr"), + ), ] return my_keys def init_mouse(self): + """Mouse keys | cause sometimes we have to use the mouse.""" mouse_keys = [ - Drag([self.mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), - Drag([self.mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([self.mod], "Button2", lazy.window.bring_to_front()), + Drag([self.mod], "Button1", lazy.window.set_position_floating(), + start=lazy.window.get_position()), + Drag([self.mod], "Button3", lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([self.mod], "Button2", + lazy.window.bring_to_front()), ] return mouse_keys |