From aaedb9a654f63d7fe9997a2d59573515383fc16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 14 Apr 2024 02:46:55 +0200 Subject: [PATCH] Remove screencfg --- _machines/ares.yml | 2 - _machines/neptune.yml | 4 -- autostart/autostart.target.j2 | 1 - autostart/services/screencfg.service | 13 ---- bin/screencfg | 62 ------------------- dotfiles.yml | 3 +- i3/config.j2 | 4 -- screencfg/ares/default.yml | 8 --- screencfg/mars/default.yml | 14 ----- screencfg/mars/three-screens.yml | 18 ------ screencfg/neptune/default.yml | 18 ------ .../neptune/three-screens-laptop-left.yml | 18 ------ .../neptune/three-screens-laptop-right.yml | 21 ------- 13 files changed, 1 insertion(+), 185 deletions(-) delete mode 100644 autostart/services/screencfg.service delete mode 100755 bin/screencfg delete mode 100644 screencfg/ares/default.yml delete mode 100644 screencfg/mars/default.yml delete mode 100644 screencfg/mars/three-screens.yml delete mode 100644 screencfg/neptune/default.yml delete mode 100644 screencfg/neptune/three-screens-laptop-left.yml delete mode 100644 screencfg/neptune/three-screens-laptop-right.yml diff --git a/_machines/ares.yml b/_machines/ares.yml index b9abfb2..7fe8530 100644 --- a/_machines/ares.yml +++ b/_machines/ares.yml @@ -54,8 +54,6 @@ screen: 9: DisplayPort-0 0: DisplayPort-0 -screencfgs: [] - workspace: 1: "" 9: "" diff --git a/_machines/neptune.yml b/_machines/neptune.yml index 60782e8..5ccbed3 100644 --- a/_machines/neptune.yml +++ b/_machines/neptune.yml @@ -80,10 +80,6 @@ workspace: 9: "" 10: "" -screencfgs: - - name: three-screens - key: F3 - environment: MACHINE_TYPE: "laptop" MACHINE_RESOLUTION_X: "1920" diff --git a/autostart/autostart.target.j2 b/autostart/autostart.target.j2 index f3b09a9..176c8c4 100644 --- a/autostart/autostart.target.j2 +++ b/autostart/autostart.target.j2 @@ -25,7 +25,6 @@ Wants=nm-applet.service Wants=pasystray.service Wants=redshift.service Wants=restic.timer -Wants=screencfg.service Wants=spotify.service Wants=steam.service Wants=touchpad.service diff --git a/autostart/services/screencfg.service b/autostart/services/screencfg.service deleted file mode 100644 index 362749f..0000000 --- a/autostart/services/screencfg.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -BindsTo=autostart.target -After=windowmanager.target - -[Service] -Type=oneshot -# systemd.service(5): - -# > The command to execute may contain spaces, but control characters are not -# > allowed. -ExecStart=/usr/bin/env screencfg "%h/.screencfg/%H/default.yml" -RemainAfterExit=true -PassEnvironment=DISPLAY diff --git a/bin/screencfg b/bin/screencfg deleted file mode 100755 index f133b57..0000000 --- a/bin/screencfg +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import subprocess -import time -import argparse - -import yaml - -XRANDR = 'xrandr' - -def run(cmd): - print('>>> ' + ' '.join(cmd)) - start = time.time() - ret = subprocess.run( - cmd, - stdout=sys.stdout, - stderr=sys.stderr) - end = time.time() - print("exit code: {}".format(ret.returncode)) - print("exec time: {}".format(end - start)) - -def fail(msg, code=1): - print(msg) - sys.exit(code) - -parser = argparse.ArgumentParser() -parser.add_argument('config') - -args = parser.parse_args() -config_path = args.config - -try: - config = yaml.safe_load(open(config_path)) -except FileNotFoundError: - fail("File {0} not found".format(config_path)) - -# reset -for output in config['outputs']: - if config.get('reset') and output.get('reset'): - run([XRANDR, '--output', output['name'], '--off']) - run([XRANDR, '--delmode', output['name'], output['opts']['mode']]) - run([XRANDR, '--addmode', output['name'], output['opts']['mode']]) - run([XRANDR, '--output', output['name'], '--mode', output['opts']['mode']]) - -cmd = [XRANDR] -for output in config['outputs']: - cmd.extend(['--output', output['name']]) - if output.get('disable'): - cmd.append('--off') - else: - if output.get('primary', False): - cmd.append("--primary") - # cmd.append('--auto') - for k, v in output['opts'].items(): - cmd.extend(['--{}'.format(k), str(v)]) - for k,v in output.get('set', {}).items(): - cmd.extend(['--set', k, v]) - -run(cmd) -run(['i3-msg', 'restart']) -run(['systemctl', '--user', 'restart', 'keyboard']) diff --git a/dotfiles.yml b/dotfiles.yml index e3ca351..060fd98 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -81,8 +81,6 @@ dotfiles: template: true - from: qt/qt5ct.conf to: .config/qt5ct/qt5ct.conf - - from: screencfg - to: .screencfg - from: scripts to: scripts - from: helix/config.toml @@ -93,3 +91,4 @@ dotfiles_remove: - .tmux.conf - .i3 - .gtkrc-2.0 + - .screencfg diff --git a/i3/config.j2 b/i3/config.j2 index 198aa69..46a773b 100644 --- a/i3/config.j2 +++ b/i3/config.j2 @@ -214,10 +214,6 @@ assign [class="^Wine$"] $workspace10 bindsym F2 exec --no-startup-id $scriptdir/screenmenu bindsym $mod+F1 exec --no-startup-id $scriptdir/i3exit lock - bindsym $mod+F2 exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/default.yml ; exec systemctl --user restart keyboard.service - {% for screencfg in machine.screencfgs -%} - bindsym $mod+{{ screencfg.key }} exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/{{ screencfg.name }}.yml ; exec systemctl --user restart keyboard.service - {% endfor -%} bindsym $mod+F4 exec --no-startup-id $scriptdir/i3exit suspend bindsym $mod+Home exec --no-startup-id $scriptdir/shutdown-menu diff --git a/screencfg/ares/default.yml b/screencfg/ares/default.yml deleted file mode 100644 index 475939e..0000000 --- a/screencfg/ares/default.yml +++ /dev/null @@ -1,8 +0,0 @@ -reset: true -outputs: - - name: DisplayPort-0 - opts: - mode: 2560x1440 - rate: "144.00" - set: - TearFree: "on" diff --git a/screencfg/mars/default.yml b/screencfg/mars/default.yml deleted file mode 100644 index 91d3674..0000000 --- a/screencfg/mars/default.yml +++ /dev/null @@ -1,14 +0,0 @@ -reset: false -outputs: - - name: eDP-1 - primary: True - opts: - mode: 1920x1080 - scale: 1x1 - pos: "0x0" # beware of hex - - name: DP-1-1 - disable: true - - name: DP-1-2 - disable: true - - name: DP-1-3 - disable: true diff --git a/screencfg/mars/three-screens.yml b/screencfg/mars/three-screens.yml deleted file mode 100644 index f5c8266..0000000 --- a/screencfg/mars/three-screens.yml +++ /dev/null @@ -1,18 +0,0 @@ -reset: true -outputs: - - name: eDP-1 - opts: - mode: 1920x1080 - scale: 0.7x0.7 - pos: "0x0" # beware of hex - - name: DP-3 - primary: True - opts: - mode: 1920x1080 - right-of: eDP-1 - reset: true - - name: DP-4 - opts: - mode: 1920x1080 - right-of: DP-3 - reset: true diff --git a/screencfg/neptune/default.yml b/screencfg/neptune/default.yml deleted file mode 100644 index 5e9fd8f..0000000 --- a/screencfg/neptune/default.yml +++ /dev/null @@ -1,18 +0,0 @@ -reset: false -outputs: - - name: eDP-1 - primary: True - opts: - mode: 1920x1080 - scale: 1x1 - pos: "0x0" # beware of hex - - name: DP-1 - disable: true - - name: DP-2 - disable: true - - name: DP-3 - disable: true - - name: DP-4 - disable: true - - name: DP-5 - disable: true diff --git a/screencfg/neptune/three-screens-laptop-left.yml b/screencfg/neptune/three-screens-laptop-left.yml deleted file mode 100644 index f5c8266..0000000 --- a/screencfg/neptune/three-screens-laptop-left.yml +++ /dev/null @@ -1,18 +0,0 @@ -reset: true -outputs: - - name: eDP-1 - opts: - mode: 1920x1080 - scale: 0.7x0.7 - pos: "0x0" # beware of hex - - name: DP-3 - primary: True - opts: - mode: 1920x1080 - right-of: eDP-1 - reset: true - - name: DP-4 - opts: - mode: 1920x1080 - right-of: DP-3 - reset: true diff --git a/screencfg/neptune/three-screens-laptop-right.yml b/screencfg/neptune/three-screens-laptop-right.yml deleted file mode 100644 index 849bcae..0000000 --- a/screencfg/neptune/three-screens-laptop-right.yml +++ /dev/null @@ -1,21 +0,0 @@ -reset: true -outputs: - - name: eDP-1 - opts: - mode: 1920x1080 - scale: 0.7x0.7 - # x: 2*1920 - # y: 1080-(0.7*1080) - pos: "3840x324" # beware of hex - - name: DP-4 - opts: - mode: 1920x1080 - pos: "1920x0" # beware of hex - reset: true - - name: DP-3 - primary: True - opts: - mode: 1920x1080 - left-of: DP-4 - pos: "0x0" # beware of hex - reset: true