Commit ba3541f7 authored by Martin's avatar Martin

add autorandr

parent fb2ad65c
#!/bin/sh
# https://github.com/phillipberndt/autorandr/issues/97
# This script relies on the fact that the autorandr config files are touch'ed
# when activated. So by repeatedly activating the least recently used profile,
# we can cycle through them
CURRENT_POSSIBLE_PROFILES=$(autorandr 2>&1 | grep "(detected)" | cut -d " " -f 1)
# ls -t -1 = sort by modification time, newest first, output one entry per line
# this will look like `$HOME/.config/autorandr/<name>/config`
# dirname gives: `$HOME/.config/autorandr/<name>`
# basename gives: `<name>`
LEAST_RECENTLY_USED=$(\
echo "${CURRENT_POSSIBLE_PROFILES}"| \
xargs -I "%" echo "$HOME/.config/autorandr/%/config" | \
xargs ls -t -1 | tail -1 | \
xargs dirname | xargs basename
)
echo "autorandr --load ${LEAST_RECENTLY_USED}"
autorandr --load "${LEAST_RECENTLY_USED}"
---
- name: Setup sitecheck script
copy:
mode: 0755
......@@ -27,3 +26,10 @@
group: root
src: ./corn-info.sh
dest: /usr/local/bin/corn-info
- name: Make sure cloudsend exists and is executable
copy:
mode: 0755
owner: root
group: root
src: ./autorandr-cycle
dest: /usr/local/bin/autorandr-cycle
output DVI-D-0
off
output HDMI-1
off
output DP-1
off
output DP-3
off
output DP-0
crtc 1
mode 2560x1440
pos 0x0
rate 143.86
output DP-2
crtc 2
mode 1920x1080
pos 2560x0
rate 144.00
rotate left
output HDMI-0
crtc 0
mode 3840x2160
pos 3639x0
rate 60.00
DP-0 00ffffffffffff000469a7273a990100291a0104a53c22783ac8c5a8554ea2260d5054b7ef00d1c095008180714f0101010101010101e8e40050a0a067500820980455502100001e565e00a0a0a029503020350055502100001e000000fd00329018de3c000a202020202020000000fc0041535553204d473237390a2020014f02031cf1491213041f900e0f1d1e230917078301000065030c001000e8e40050a0a067500820980455502100001e011d007251d01e206e28550055502100001e011d00bc52d01e20b828554055502100001e565e00a0a0a029503020350055502100001e87bc0050a0a055500820780055502100001e000000000000000000a5
DP-2 00ffffffffffff0004720604ffffffffff170104a53c227806ee91a3544c99260f505400000001010101010101010101010101010101023a801871382d40582c450056502100001e000000ff002341534d716865686f784d5064000000fd001e961ea021010a202020202020000000fc004163657220584232373048204101b202030a01654b040001018a4d80a070382c403020350056502100001afe5b80a0703835403020350056502100001a866f80a0703840403020350056502100001afc7e8088703812401820350056502100001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c
HDMI-0 00ffffffffffff001e6d010001010101011c010380a05a780aee91a3544c99260f5054a108003140454061407140818001010101010108e80030f2705a80b0588a0040846300001e023a801871382d40582c450040846300001e000000fd003a791e883c000a202020202020000000fc004c472054560a20202020202020016202034bf1565d101f0413051403021220212215015e5f6263643f402f0957071507505507013d1ec05f7e016e030c002000b83c20008001020304e200cfe305c000e50e60616566e3060d01662150b051001b304070360040846300001e0000000000000000000000000000000000000000000000000000000000000000000008
output DVI-D-0
off
output HDMI-1
off
output DP-1
off
output DP-3
off
output HDMI-0
off
output DP-0
crtc 1
mode 2560x1440
pos 0x0
rate 143.86
output DP-2
crtc 2
mode 1920x1080
pos 2560x0
rate 144.00
rotate left
DP-0 00ffffffffffff000469a7273a990100291a0104a53c22783ac8c5a8554ea2260d5054b7ef00d1c095008180714f0101010101010101e8e40050a0a067500820980455502100001e565e00a0a0a029503020350055502100001e000000fd00329018de3c000a202020202020000000fc0041535553204d473237390a2020014f02031cf1491213041f900e0f1d1e230917078301000065030c001000e8e40050a0a067500820980455502100001e011d007251d01e206e28550055502100001e011d00bc52d01e20b828554055502100001e565e00a0a0a029503020350055502100001e87bc0050a0a055500820780055502100001e000000000000000000a5
DP-2 00ffffffffffff0004720604ffffffffff170104a53c227806ee91a3544c99260f505400000001010101010101010101010101010101023a801871382d40582c450056502100001e000000ff002341534d716865686f784d5064000000fd001e961ea021010a202020202020000000fc004163657220584232373048204101b202030a01654b040001018a4d80a070382c403020350056502100001afe5b80a0703835403020350056502100001a866f80a0703840403020350056502100001afc7e8088703812401820350056502100001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c
HDMI-0 00ffffffffffff001e6d010001010101011c010380a05a780aee91a3544c99260f5054a108003140454061407140818001010101010108e80030f2705a80b0588a0040846300001e023a801871382d40582c450040846300001e000000fd003a791e883c000a202020202020000000fc004c472054560a20202020202020016202034bf1565d101f0413051403021220212215015e5f6263643f402f0957071507505507013d1ec05f7e016e030c002000b83c20008001020304e200cfe305c000e50e60616566e3060d01662150b051001b304070360040846300001e0000000000000000000000000000000000000000000000000000000000000000000008
output DVI-D-0
off
output HDMI-1
off
output DP-1
off
output DP-3
off
output DP-0
off
output DP-2
off
output HDMI-0
crtc 0
mode 3840x2160
pos 0x0
primary
rate 60.00
DP-0 00ffffffffffff000469a7273a990100291a0104a53c22783ac8c5a8554ea2260d5054b7ef00d1c095008180714f0101010101010101e8e40050a0a067500820980455502100001e565e00a0a0a029503020350055502100001e000000fd00329018de3c000a202020202020000000fc0041535553204d473237390a2020014f02031cf1491213041f900e0f1d1e230917078301000065030c001000e8e40050a0a067500820980455502100001e011d007251d01e206e28550055502100001e011d00bc52d01e20b828554055502100001e565e00a0a0a029503020350055502100001e87bc0050a0a055500820780055502100001e000000000000000000a5
DP-2 00ffffffffffff0004720604ffffffffff170104a53c227806ee91a3544c99260f505400000001010101010101010101010101010101023a801871382d40582c450056502100001e000000ff002341534d716865686f784d5064000000fd001e961ea021010a202020202020000000fc004163657220584232373048204101b202030a01654b040001018a4d80a070382c403020350056502100001afe5b80a0703835403020350056502100001a866f80a0703840403020350056502100001afc7e8088703812401820350056502100001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c
HDMI-0 00ffffffffffff001e6d010001010101011c010380a05a780aee91a3544c99260f5054a108003140454061407140818001010101010108e80030f2705a80b0588a0040846300001e023a801871382d40582c450040846300001e000000fd003a791e883c000a202020202020000000fc004c472054560a20202020202020016202034bf1565d101f0413051403021220212215015e5f6263643f402f0957071507505507013d1ec05f7e016e030c002000b83c20008001020304e200cfe305c000e50e60616566e3060d01662150b051001b304070360040846300001e0000000000000000000000000000000000000000000000000000000000000000000008
......@@ -6,6 +6,13 @@
group: 'c0rn3j'
src: ./toggleAudio.sh
dest: /home/c0rn3j/toggleAudio.sh
- name: Upload autorandr config
copy:
mode: '0755'
owner: 'c0rn3j'
group: 'c0rn3j'
src: ./autorandr
dest: /home/c0rn3j/.config/
- name: Upload network config
copy:
mode: '0644'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment