diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index bbb2a68..2b979db 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -2,6 +2,7 @@ import re import os import subprocess import psutil +from PIL import Image, ImageDraw, ImageFont from libqtile import layout, bar, widget from libqtile.config import Key, Drag, Click, Group, Screen @@ -105,26 +106,26 @@ mouse = [ #endregion #region Groups -group_names = [("", 'h',{'layout': 'monadtall'}), - ("", 'c',{'layout': 'monadtall'}), - ("", 'f',{'layout': 'monadtall'}), - ("", 'm',{'layout': 'monadtall'}), - ("", 's',{'layout': 'monadtall'}), - ("", 'w',{'layout': 'monadtall'}), - ("", 'v',{'layout': 'monadtall'}), - ("", 'l',{'layout': 'monadtall'}), - ("", 'd',{'layout': 'monadtall'}), - ("", 'o',{'layout': 'monadtall'}), - ("", 'g',{'layout': 'monadtall'})] +group_names = [("","Home", 'h',{'layout': 'monadtall'}), + ("","Coding", 'c',{'layout': 'monadtall'}), + ("","Browser", 'f',{'layout': 'monadtall'}), + ("","Mail", 'm',{'layout': 'monadtall'}), + ("","Music", 's',{'layout': 'monadtall'}), + ("","Chat", 'w',{'layout': 'monadtall'}), + ("","Video", 'v',{'layout': 'monadtall'}), + ("","Documents", 'l',{'layout': 'monadtall'}), + ("","Discord", 'd',{'layout': 'monadtall'}), + ("","VM's", 'o',{'layout': 'monadtall'}), + ("","Gaming", 'g',{'layout': 'monadtall'})] -groups = [Group(name, **kwargs) for name, key, kwargs in group_names] +groups = [Group(icon, **kwargs) for icon, name, key, kwargs in group_names] -for (name,key, kwargs) in group_names: +for (icon,name,key, kwargs) in group_names: keys.extend([ - Key(["mod1","control"], str(key), lazy.group[name].toscreen(), + Key(["mod1","control"], str(key), lazy.group[icon].toscreen(), desc="Switch to group {}".format(name)), - Key(['mod1','control', "shift"], str(key), lazy.window.togroup(name), + Key(['mod1','control', "shift"], str(key), lazy.window.togroup(icon), desc="move focused window to group {}".format(name)), ]) #endregion @@ -584,7 +585,9 @@ cursor_warp = False auto_fullscreen = True focus_on_window_activation = "smart" -#export keys into textfile +#region Hotkey_Wallpaper + +#create hotkey textfile if os.path.isfile(hotkey_file): os.remove(hotkey_file) with open(hotkey_file,'w') as file: @@ -595,8 +598,9 @@ with open(hotkey_file,'w') as file: modifiers += '{:^7}'.format( str(modifier).replace("mod1","Alt").replace("mod4","Super").replace("shift","Shift").replace("control","Ctrl") ) + "+" - file.write('{:30}'.format(modifiers+' '+str(key.key).upper())+"=>\t"+key.desc) - file.write('\n') + file.write('{:30}'.format(modifiers+' '+str(key.key).upper())+"=> "+key.desc) + file.write('\n\n') +#endregion # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this # string besides java UI toolkits; you can see several discussions on the diff --git a/qtile/.config/qtile/hotkeyimage.py b/qtile/.config/qtile/hotkeyimage.py new file mode 100644 index 0000000..8458a73 --- /dev/null +++ b/qtile/.config/qtile/hotkeyimage.py @@ -0,0 +1,29 @@ +from PIL import Image, ImageDraw, ImageFont +import os +import time + +hotkey_file='/home/paul/Hotkeys' +hotkey_picture='/home/paul/Hotkeys.png' + +with open(hotkey_file) as file: + lines = [line.rstrip() for line in file] + +text1='' +for line in lines[len(lines)//2:]: + text1+=line +"\n" + +text2='' +for line in lines[:len(lines)//2]: + text2+=line +"\n" + +if os.path.isfile(hotkey_picture): + os.remove(hotkey_picture) + +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') +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') +image.save(hotkey_picture) + +image.show() \ No newline at end of file