qtile 的配置文件管理器
项目描述
qtile 配置文件
我将笔记本电脑用于工作和私人物品,并想使用某种配置文件。
安装
您可以使用 pip 安装软件包
pip install qtile-profiles
用法
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)),
])
项目详情
关
qtile_profiles -0.1.2-py2.py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | dc486ce9ba3759ca8a48f74d19583274f07ea1a9e4677b904ef84543f7daa535 |
|
| MD5 | a0c9b76a190aeb6c5efd34e5b15bd7d1 |
|
| 布莱克2-256 | 157fc61d3fa2b62a91dd99e233b88e1ec9b98107cbf8a0fab82609091f8cdae9 |