From ca69a254f8351e0a23c86ee8075a33ec8c7e7503 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Fri, 17 Jul 2020 11:30:31 +0200
Subject: Update X configs
---
.config/xinit.d/awesome.rc | 6 ------
.config/xinit.d/ob.rc | 8 --------
.local/bin/chwp | 16 +++-------------
.local/bin/x | 19 +++++++++++++------
.local/etc/x/xinit.d/awesome.rc | 5 +++++
.local/etc/x/xinit.d/ob.rc | 8 ++++++++
.local/etc/x/xinitrc | 42 +++++++++++++++++++++++++++++++++++++++++
7 files changed, 71 insertions(+), 33 deletions(-)
delete mode 100644 .config/xinit.d/awesome.rc
delete mode 100644 .config/xinit.d/ob.rc
create mode 100644 .local/etc/x/xinit.d/awesome.rc
create mode 100644 .local/etc/x/xinit.d/ob.rc
create mode 100644 .local/etc/x/xinitrc
diff --git a/.config/xinit.d/awesome.rc b/.config/xinit.d/awesome.rc
deleted file mode 100644
index e3723db..0000000
--- a/.config/xinit.d/awesome.rc
+++ /dev/null
@@ -1,6 +0,0 @@
-sxhkd &
-chwp &
-
-xcompmgr &
-
-exec dbus-launch --exit-with-session awesome
diff --git a/.config/xinit.d/ob.rc b/.config/xinit.d/ob.rc
deleted file mode 100644
index 36c86d7..0000000
--- a/.config/xinit.d/ob.rc
+++ /dev/null
@@ -1,8 +0,0 @@
-sxhkd &
-chwp &
-
-xcompmgr &
-
-tint2 &
-
-exec dbus-launch --exit-with-session openbox-session
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
diff --git a/.local/etc/x/xinit.d/awesome.rc b/.local/etc/x/xinit.d/awesome.rc
new file mode 100644
index 0000000..96a165c
--- /dev/null
+++ b/.local/etc/x/xinit.d/awesome.rc
@@ -0,0 +1,5 @@
+sxhkd &
+chwp &
+xcompmgr &
+
+exec dbus-launch --exit-with-session awesome
diff --git a/.local/etc/x/xinit.d/ob.rc b/.local/etc/x/xinit.d/ob.rc
new file mode 100644
index 0000000..36c86d7
--- /dev/null
+++ b/.local/etc/x/xinit.d/ob.rc
@@ -0,0 +1,8 @@
+sxhkd &
+chwp &
+
+xcompmgr &
+
+tint2 &
+
+exec dbus-launch --exit-with-session openbox-session
diff --git a/.local/etc/x/xinitrc b/.local/etc/x/xinitrc
new file mode 100644
index 0000000..77edd40
--- /dev/null
+++ b/.local/etc/x/xinitrc
@@ -0,0 +1,42 @@
+# start dbus if necessary
+[ -f "/etc/X11/xinit/xinitrc.d/80-dbus" ] && source /etc/X11/xinit/xinitrc.d/80-dbus
+
+# start polkit auth agent
+eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg)
+export GNOME_KEYRING_PID
+export GNOME_KEYRING_SOCKET
+export SSH_AUTH_SOCK
+
+# extend the fontpath
+xset +fp ~/.fonts/Terminus/BDF
+#xset +fp /usr/share/fonts/local
+
+# set the default mousepointer
+xsetroot -cursor_name left_ptr
+
+# load the .Xresources
+xrdb -merge ~/.Xresources
+
+# xkbmap options
+setxkbmap \
+ -layout us \
+ \
+ -option compose:menu \
+ -option caps:escape
+
+# add altgr
+xmodmap -e "keycode 108 = ISO_Level3_Shift"
+
+# Enable sound through PulseAudio
+pulseaudio --start
+
+# set a wallpaper
+chwp &
+
+# start background processes
+redshift -l 51.50:4.59 &
+dunst &
+sxhkd &
+
+# Start x11vnc
+x11vnc -display "$DISPLAY" &
--
cgit v1.1