A profile manger for qtile
Project description
qtile-profiles
Im using my laptop for work and private stuff and wanted to use some kind of profiles.
Installation
You can install the package using pip
pip install qtile-profiles
Usage
from qtile_profiles import Profile, ProfileManager
def set_browser(browser: str):
subprocess.run(
f"xdg-mime default {browser} x-scheme-handler/http",
shell=True,
)
subprocess.run(
f"xdg-mime default {browser} x-scheme-handler/https",
shell=True,
)
work = Profile(
programs={ # define some aliases for shorter commands later
"firefox": "firefox",
"thunderbird": "flatpak run org.mozilla.Thunderbird", # see 6 lines down
"teams": "chromium --app=https://teams.office.com",
},
init=[ # spawn these program when calling initialize
("web", ["firefox"]),
("chat", ["mattermost-desktop", "teams"]),
("mail", ["tunderbird"]), # here we can use thunderbird insead of calling flatpak
("kp", ["keepassxc"]),
],
on_load=lambda qtile: set_browser("firefox.desktop") # callback, call when profile is selected
)
privat = Profile(
programs={
"firefox": "firefox -P privat",
"thunderbird": "thunderbird",
"discord": "discord",
},
init=[
("web", ["firefox"]),
("chat", ["signal-desktop", "discord"]),
("mail", ["thunderbird"]),
("kp", ["keepassxc"]),
],
on_load=lambda qtile: set_browser("firefox-privat.desktop")
)
profiles = ProfileManager([work, privat])
keys.extend([
Key([super], "p", lazy.function(profiles.next_profile)),
Key([super], "f", lazy.function(profiles.spawn, "firefox")),
Key([super], "i", lazy.function(profiles.current_profile.spawn_init)),
])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qtile-profiles-0.1.1.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for qtile_profiles-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5c2e84480935e8343dc7e32e72e062d537c7f0db658c6dff56c103fd8fd45f |
|
MD5 | 658a2b47139e44cab2f2611ebe7d2852 |
|
BLAKE2b-256 | 41933f3fd7faa47c0f2da4dfc663c2ae47265640bd3993615753f762bb5305f3 |