From 2aaf1b4daa13ee6716450bd336610b7bdebd6b81 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Sat, 19 Dec 2020 15:34:30 +0100 Subject: [PATCH] reworked hotkey script --- qtile/.config/qtile/config.py | 6 ++++-- qtile/.config/qtile/hotkeyimage.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index fd8f46f..d62d99c 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -74,6 +74,7 @@ keys = [ Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"), Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"), Key([mod],"v", lazy.spawn("code"),desc="Launch visual studio code"), + Key([mod, "shift"],"s", lazy.spawn('gscreenshot -s -o -f /tmp/screenshots'),desc="take a screenshot"), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), @@ -130,7 +131,8 @@ for (icon,name,key, kwargs) in group_names: Key(['mod1','control', "shift"], str(key), lazy.window.togroup(icon), desc="move focused window to group {}".format(name)), - Key(['mod1','control'],'space',lazy.group['scratchpad'].dropdown_toggle('term')), + Key(['mod1','control'],'space',lazy.group['scratchpad'].dropdown_toggle('term'), + desc="open the dropdown terminal"), ]) #endregion @@ -603,7 +605,7 @@ with open(hotkey_file,'w') as file: str(modifier).replace("mod1","Alt").replace("mod4","Super").replace("shift","Shift").replace("control","Ctrl") ) + "+" file.write('{:30}'.format(modifiers+' '+str(key.key).upper())+"=> "+key.desc) - file.write('\n\n') + file.write('\n') #endregion # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this diff --git a/qtile/.config/qtile/hotkeyimage.py b/qtile/.config/qtile/hotkeyimage.py index 8458a73..5ca5554 100644 --- a/qtile/.config/qtile/hotkeyimage.py +++ b/qtile/.config/qtile/hotkeyimage.py @@ -19,11 +19,13 @@ for line in lines[:len(lines)//2]: if os.path.isfile(hotkey_picture): os.remove(hotkey_picture) +fontsize = 19 + image = Image.new(mode = "RGB", size = (1440,900), color=(43,46,59)) -ImageDraw.Draw(image).text((10,10), text1, font=ImageFont.truetype('/usr/share/fonts/ubuntu/UbuntuMono-R.ttf',15), fill='#ffffff') +ImageDraw.Draw(image).text((10,10), text1, font=ImageFont.truetype('/usr/share/fonts/ubuntu/UbuntuMono-R.ttf',fontsize), fill='#ffffff') image.save(hotkey_picture) image = Image.open(hotkey_picture) -ImageDraw.Draw(image).text((750,10), text2, font=ImageFont.truetype('/usr/share/fonts/ubuntu/UbuntuMono-R.ttf',15), fill='#ffffff') +ImageDraw.Draw(image).text((750,10), text2, font=ImageFont.truetype('/usr/share/fonts/ubuntu/UbuntuMono-R.ttf',fontsize), fill='#ffffff') image.save(hotkey_picture) image.show() \ No newline at end of file