Files
.dotfiles/qtile/.config/qtile/Groups.py
T
2021-10-28 17:18:21 +02:00

103 lines
3.5 KiB
Python

from libqtile.config import Group, ScratchPad, DropDown, Key
from libqtile.command import lazy
from defines import term
from Keys import keys
group_names = [("","Home", 'h',{'layout': 'monadtall'}),
("","Browser", 'f',{'layout': 'monadtall'}),
("","Mail", 'm',{'layout': 'monadtall'}),
("","Coding", 'c',{'layout': 'monadtall'}),
("","Documents", 'l',{'layout': 'monadtall'}),
("","Tor Browser", 't',{'layout': 'monadtall'}),
("","Music", 's',{'layout': 'monadtall'}),
("","Video", 'v',{'layout': 'monadtall'}),
("","Discord", 'd',{'layout': 'monadtall'}),
("1","etc1", '1', {'layout': 'monadtall'}),
("2","etc2", '2', {'layout': 'monadtall'}),
("3","etc3", '3', {'layout': 'monadtall'})]
groups = [Group(icon, **kwargs) for icon, name, key, kwargs in group_names]
groups.append(
ScratchPad("scratchpad",[
DropDown(
"term",
term,
),
DropDown(
"htop",
term + ' -e htop',
),
DropDown(
'sound',
'pavucontrol'
),
DropDown(
'filemanager',
'pcmanfm',
on_focus_lost_hide=False
),
DropDown(
'bitwarden',
'bitwarden-desktop',
on_focus_lost_hide=False,
),
DropDown(
'WhatsApp',
'whatsapp-for-linux',
height = 0.5,
width = 0.5,
x = .25,
on_focus_lost_hide=False,
opacity=1
),
DropDown(
'Signal',
'signal-desktop',
height = 0.5,
width = 0.5,
x = .25,
on_focus_lost_hide=False,
opacity = 1
),
DropDown(
'Qalculate!',
'qalculate-gtk',
height = 0.5,
width = 0.5,
x = .25,
on_focus_lost_hide=True,
opacity = 1
),
])
)
for (icon,name,key, kwargs) in group_names:
keys.extend([
Key(["mod1","control"], str(key), lazy.group[icon].toscreen(),
desc="Switch to group {}".format(name)),
Key(['mod1','control', "shift"], str(key), lazy.window.togroup(icon),
desc="move focused window to group {}".format(name)),
])
keys.extend([
Key(['mod1','control'],'space',lazy.group['scratchpad'].dropdown_toggle('term'),
desc="open the dropdown terminal"),
Key(['control','shift'],'Escape',lazy.group['scratchpad'].dropdown_toggle('htop'),
desc="open the dropdown terminal"),
Key(['mod1','control'],'a',lazy.group['scratchpad'].dropdown_toggle('sound'),
desc="open the dropdown pavucontrol"),
Key(['mod1','control'],'e',lazy.group['scratchpad'].dropdown_toggle('filemanager'),
desc="open the dropdown filemanager"),
Key(['mod1','control'],'b',lazy.group['scratchpad'].dropdown_toggle('bitwarden'),
desc="open the dropdown password manager KeePassXC"),
Key(['mod1','control'],'w',lazy.group['scratchpad'].dropdown_toggle('WhatsApp'),
desc="open the dropdown for WhatsApp"),
Key(['mod1','control'],'i',lazy.group['scratchpad'].dropdown_toggle('Signal'),
desc="open the dropdown for Signal"),
Key(['mod1','control'],'q',lazy.group['scratchpad'].dropdown_toggle('Qalculate!'),
desc="open the dropdown for Qalculate!"),
])