Remove screencfg
This commit is contained in:
@@ -54,8 +54,6 @@ screen:
|
||||
9: DisplayPort-0
|
||||
0: DisplayPort-0
|
||||
|
||||
screencfgs: []
|
||||
|
||||
workspace:
|
||||
1: ""
|
||||
9: ""
|
||||
|
||||
@@ -80,10 +80,6 @@ workspace:
|
||||
9: ""
|
||||
10: ""
|
||||
|
||||
screencfgs:
|
||||
- name: three-screens
|
||||
key: F3
|
||||
|
||||
environment:
|
||||
MACHINE_TYPE: "laptop"
|
||||
MACHINE_RESOLUTION_X: "1920"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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'])
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
reset: true
|
||||
outputs:
|
||||
- name: DisplayPort-0
|
||||
opts:
|
||||
mode: 2560x1440
|
||||
rate: "144.00"
|
||||
set:
|
||||
TearFree: "on"
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user