From abce78df8dab077d2296c0ee32e9610cd2d896d2 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Wed, 3 Feb 2021 11:55:00 +0100 Subject: [PATCH] added ability to move to next screen --- qtile/.config/qtile/Keys.py | 1 + qtile/.config/qtile/screenshot.sh | 2 ++ qtile/.config/qtile/test.py | 27 +-------------------------- 3 files changed, 4 insertions(+), 26 deletions(-) create mode 100755 qtile/.config/qtile/screenshot.sh diff --git a/qtile/.config/qtile/Keys.py b/qtile/.config/qtile/Keys.py index d783bd1..704dd42 100644 --- a/qtile/.config/qtile/Keys.py +++ b/qtile/.config/qtile/Keys.py @@ -13,6 +13,7 @@ keys = [ Key([mod,"mod1"], "j", lazy.to_screen(2),desc="move focus to main screen"), Key([mod,"mod1"], "l", lazy.to_screen(2),desc="move focus to main screen"), Key([mod,"mod1"], "h", lazy.to_screen(1),desc="move focus to left screen"), + Key([mod,"mod1"], "n", lazy.next_screen(),desc="move focus to left screen"), # moving windows around Key([mod, "shift"], "h", lazy.layout.swap_left(),desc="move focused window left"), diff --git a/qtile/.config/qtile/screenshot.sh b/qtile/.config/qtile/screenshot.sh new file mode 100755 index 0000000..d43848b --- /dev/null +++ b/qtile/.config/qtile/screenshot.sh @@ -0,0 +1,2 @@ +#!/bin/bash +scrot -s '/tmp/screenshots/%F_%T_$wx$h.png' -e 'echo $f | xclip -selection clipboard -target text/uri-list -i' \ No newline at end of file diff --git a/qtile/.config/qtile/test.py b/qtile/.config/qtile/test.py index 3b05375..bb60967 100644 --- a/qtile/.config/qtile/test.py +++ b/qtile/.config/qtile/test.py @@ -1,29 +1,4 @@ # This is a test file for anything. -screens = [] -main_screen_res = [3840,1440] -top_screen_res = [1440,780] - import subprocess -import re -import numpy as np -cmd = ['xrandr'] -p = subprocess.Popen(cmd, stdout=subprocess.PIPE) -resolution_string, junk = p.communicate() -p.stdout.close() -screen_resolutions = [np.array(screen_res.split('x')).astype(np.int) for screen_res in re.findall('[0-9]+x[0-9]+(?=[^\\\\n]*\*)',str(resolution_string))] -number_of_screens = len(screen_resolutions) -max_width = max(screen_resolutions, key=lambda res: res[0])[0] -defined_main_window = False -for width, height in screen_resolutions: - if width == main_screen_res[0] and height == main_screen_res[1]: - screens+=['main_screen'] - defined_main_window = True - elif width == top_screen_res[0] and height == top_screen_res[1]: - screens+=['top_screen'] - elif width == max_width and not defined_main_window: - screens+=['laptop_screen'] - defined_main_window = True - else: - screens+=['peripheral_screen'] -print(screens) \ No newline at end of file +p = subprocess.run(["bash","/home/paul/.config/qtile/screenshot.sh"]) \ No newline at end of file