Compare commits

...

3 Commits

Author SHA1 Message Date
Fierelier 0a23d4cca3 Initialize xsessionrc later 2023-11-18 17:03:45 +01:00
Fierelier 44c5bc0c63 Replace autorandr calls with screensetup-* 2023-11-18 17:03:00 +01:00
Fierelier e1a4c03f5a Add screensetup-* applets 2023-11-18 17:00:49 +01:00
11 changed files with 57 additions and 16 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash
set +e
xrandr --auto
"$de_distro" screensetup-load
if ! [ "$?" = "0" ]; then
xrandr --auto
fi
lxrandr
"$de_distro" screensetup-save
"$de_distro" module-run wallpaper

35
user/applets.d/screensetup-id Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
export LANG="C"
export LC_ALL="C"
function xOutputGetList() {
local OUTPUTS="$(xrandr | grep " connected" | awk '{print $1}')"
local OUTPUTS="$(sort <<< "$OUTPUTS")"
echo "$OUTPUTS"
}
function xOutputGetEDID() {
local OUTPUT="$1"
local EDID="$(xrandr --props | awk -v OUTPUT="$OUTPUT" '/^'$OUTPUT' connected/ {flag=1; next} /EDID:/ && flag {for(i = 0; i < 8; i++) {getline; print}; flag=0}')"
local EDID="${EDID//[$'\t\r\n ']}"
echo "$EDID"
}
function xOutputGetUUID() {
local EDID="$1"
echo "${EDID:16:20}" # https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#Structure,_version_1.4
}
function md5() {
local HASH=($(echo "$1" | md5sum))
echo $HASH
}
output_list="$(xOutputGetList)"
setup=""
for output in $output_list; do
EDID="$(xOutputGetEDID "$output")"
UUID="$(xOutputGetUUID "$EDID")"
setup="$setup;$output:$UUID"
done
echo "$(md5 "$setup")"

View File

@ -0,0 +1,8 @@
#!/bin/bash
SSETUP="$de_distro.$("$de_distro" screensetup-id)"
set +e
autorandr --load "$SSETUP"
if ! [ "$?" = "0" ]; then
set -e
xrandr --auto
fi

View File

@ -0,0 +1,3 @@
#!/bin/bash
SSETUP="$de_distro.$("$de_distro" screensetup-id)"
autorandr --save "$SSETUP" --force

View File

@ -1,6 +1,6 @@
debian_keyboard
xsessionrc
autorandr
screensetup
wallpaper
xsessionrc
lxpanel
openbox

View File

@ -1,6 +0,0 @@
output Virtual-1
crtc 0
mode 1024x768
pos 0x0
primary
rate 74.99

View File

@ -1 +0,0 @@
Virtual-1 00ffffffffffff0049143412000000002a180104a51a137806ee91a3544c99260f5054210800e1c0d1c00101010101010101010101012520006641001a30001e334004c310000018000000fd00327d1ea078010a202020202020000000fc0051454d55204d6f6e69746f720a000000f7000a004aa2242920000000000000012d02030a00457d6560591f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
export HOME="$1/modules.d/autorandr"
autorandr --save default --force

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
export HOME="$1/modules.d/autorandr"
autorandr --load default

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
"$de_distro" screensetup-save

2
user/modules.d/screensetup/run Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
"$de_distro" screensetup-load