diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-07-17 11:30:31 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2021-08-14 11:59:40 +0200 |
commit | ca69a254f8351e0a23c86ee8075a33ec8c7e7503 (patch) | |
tree | e21013d177be70c254211c92fc95bd9ecebdb671 /.local/bin | |
parent | 9f6c0fbbdbd0d60ac629f0c38effd97a3ff48b6b (diff) |
Update X configs
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/chwp | 16 | ||||
-rwxr-xr-x | .local/bin/x | 19 |
2 files changed, 16 insertions, 19 deletions
diff --git a/.local/bin/chwp b/.local/bin/chwp index c25078a..0bec61b 100755 --- a/.local/bin/chwp +++ b/.local/bin/chwp @@ -1,4 +1,4 @@ -#! /usr/bin/env sh +#!/bin/sh main() { @@ -55,18 +55,8 @@ make_pape() xrandr -q | grep -F ' connected ' > "$monitorlist" - while read -r monitor + for resolution in $CHWP_MONITORS do - if [ -f "$HOME/.local/etc/x/chwp-filter" ] - then - if printf "%s" "$monitor" | grep -qf "$HOME/.local/etc/x/chwp-filter" - then - printf "Filtering %s\n" "$monitor" >&2 - continue - fi - fi - - resolution="$(printf "%s" "$monitor" | grep -Eo '\b[[:digit:]]+x[[:digit:]]+')" current_pape=$(get_pape "$resolution") if [ "$current_pape" = "" ] @@ -81,7 +71,7 @@ make_pape() unset resolution unset current_pape - done < "$monitorlist" + done # shellcheck disable=SC2046 # shellcheck disable=SC2086 diff --git a/.local/bin/x b/.local/bin/x index 9c6e9f6..653cfb0 100755 --- a/.local/bin/x +++ b/.local/bin/x @@ -1,11 +1,12 @@ -#! /usr/bin/env sh +#!/bin/sh +# Return to homedir cd || exit 3 # If an argument is given, check if we have an xinitrc for that if [ -n "$1" ] then - if [ ! -f "$HOME/.config/xinit.d/$1.rc" ] + if [ ! -f "$HOME/.local/etc/x/xinit.d/$1.rc" ] then printf "%s\n" "no valid config for $1" >&2 exit 1 @@ -14,9 +15,15 @@ then # Remove the old config rm -f -- "$HOME/.xinitrc" - # Create the new config - cat -- "$HOME/.config/xinit.d/xinitrc" "$HOME/.config/xinit.d/$1.rc" \ - > "$HOME/.xinitrc" + # Add layout script, if one exists + if [ -f "$HOME/.local/etc/x/layout.sh" ] + then + cat "$HOME/.local/etc/x/layout.sh" >> "$HOME/.xinitrc" + fi + + # Add the base configuration + cat -- "$HOME/.local/etc/x/xinitrc" "$HOME/.local/etc/x/xinit.d/$1.rc" \ + >> "$HOME/.xinitrc" fi # Make sure the xinitrc exists, just in case @@ -27,4 +34,4 @@ then fi # start the X session -startx +exec startx |