Move from os.environ to os.getenv for getting variables.

This commit is contained in:
Bartek Stalewski 2023-11-15 15:43:27 +01:00
parent 58cab7f3a0
commit 41d357206a

View File

@ -13,7 +13,7 @@ widget_defaults = dict(
extension_defaults = widget_defaults.copy() extension_defaults = widget_defaults.copy()
# see examples/custom.py for example custom file # see examples/custom.py for example custom file
custom_file=os.environ['XDG_CONFIG_HOME'] + '/qtile/custom.py' custom_file=os.getenv('XDG_CONFIG_HOME') + '/qtile/custom.py'
if os.path.exists(custom_file): if os.path.exists(custom_file):
from custom import groups, keys, screens, wl_input_rules from custom import groups, keys, screens, wl_input_rules
else: else:
@ -106,7 +106,7 @@ else:
24, 24,
margin=[5, 5, 0, 5] margin=[5, 5, 0, 5]
), ),
wallpaper=os.environ['XDG_CONFIG_HOME'] + '/qtile/wallpaper.img', wallpaper=os.getenv('XDG_CONFIG_HOME') + '/qtile/wallpaper.img',
wallpaper_mode='fill', wallpaper_mode='fill',
), ),
] ]
@ -114,12 +114,12 @@ else:
@hook.subscribe.startup_once @hook.subscribe.startup_once
def autostart(): def autostart():
autostart=os.environ['XDG_CONFIG_HOME'] + '/qtile/autostart.sh' autostart=os.getenv('XDG_CONFIG_HOME') + '/qtile/autostart.sh'
subprocess.run([autostart]) subprocess.run([autostart])
@hook.subscribe.shutdown @hook.subscribe.shutdown
def autostop(): def autostop():
autostop=os.environ['XDG_CONFIG_HOME'] + '/qtile/autostop.sh' autostop=os.getenv('XDG_CONFIG_HOME') + '/qtile/autostop.sh'
subprocess.run([autostop]) subprocess.run([autostop])
keys.extend([ keys.extend([