From 4e4c9f4b488ab6acf250c8351587b1efe4e72e1c Mon Sep 17 00:00:00 2001 From: David Runge Date: Tue, 23 Jan 2018 00:26:14 +0100 Subject: .config/qtile/config.py: Adding conky to the startup_once hook, compton to the startup_complete hook and adding kill_compton command to the screen_change hook, before restarting qtile. Moving hooks to the bottom of the configuration. --- .config/qtile/config.py | 79 +++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 3479fff..55bebbf 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -12,14 +12,15 @@ mod = "mod4" alt = "mod1" home = os.path.expanduser("~") +hostname = os.uname().nodename +display = os.environ['DISPLAY'] terminal = "termite" drun_launcher = "rofi -show drun" run_launcher = "rofi -show run" -lock = "/usr/bin/i3lock -f -c 000000" +lock = home+"/bin/xorg_lock" brightness_step = "5" brightness_up = "xbacklight -inc "+brightness_step brightness_down = "xbacklight -dec "+brightness_step - volume_up = home+"/bin/set_volume increase" volume_down = home+"/bin/set_volume decrease" volume_toggle = home+"/bin/set_volume toggle" @@ -27,18 +28,26 @@ audio_prev = home+"/bin/notify_mpd prev" audio_next = home+"/bin/notify_mpd next" audio_toggle = home+"/bin/notify_mpd toggle" audio_stop = home+"/bin/notify_mpd stop" - - -# startup -@hook.subscribe.startup -def autostart(): - background = ['feh', - '--randomize', - '--recursive', - '--bg-fill', - home+'/cloud/photos/desktop/'] - subprocess.call(background) - +conky_network = ['/usr/bin/conky', + '-X', + display, + '-c', + home+'/.config/conky/'+hostname+'-network.conf'] +conky_general = ['/usr/bin/conky', + '-X', + display, + '-c', + home+'/.config/conky/'+hostname+'-general.conf'] +background = ['feh', + '--randomize', + '--recursive', + '--bg-fill', + home+'/cloud/photos/desktop/'] +kill_compton = "killall compton" +compton = ['/usr/bin/compton', + '-CGb', + '-d', + display] colors = { "grey": "#555555", @@ -425,26 +434,40 @@ wmname = "LG3D" def main(qtile): - qtile.cmd_warning() + qtile.cmd_warning() @hook.subscribe.screen_change def restart_on_randr(qtile, ev): - qtile.cmd_restart() + kill_compton + qtile.cmd_restart() @hook.subscribe.client_new def floating_dialogs(client): - wm_class = client.window.get_wm_class() - logger.setLevel(logging.INFO) - logger.info('New client window name: %s' % client.name) -# logger.info('New client window class: %c' % wm_class) - logger.setLevel(logging.WARNING) - for client_regex in floating_clients: - match = client_regex.match(client.name) - if match: - client.floating = True - transient = client.window.get_wm_transient_for() - if transient: - client.floating = True + wm_class = client.window.get_wm_class() + logger.setLevel(logging.INFO) +# logger.info('New client window name: %s' % client.name) +# logger.info('New client window class: %c' % wm_class) + logger.setLevel(logging.WARNING) + for client_regex in floating_clients: + match = client_regex.match(client.name) + if match: + client.floating = True + transient = client.window.get_wm_transient_for() + if transient: + client.floating = True + +@hook.subscribe.startup +def autostart(): + subprocess.call(background) + +@hook.subscribe.startup_once +def autostart(): + subprocess.call(conky_network) + subprocess.call(conky_general) + +@hook.subscribe.startup_complete +def autostart(): + subprocess.call(compton) -- cgit v1.2.3-70-g09d2