summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2025-02-08 17:46:01 +0100
committerMike Vink <mike@pionative.com>2025-02-08 17:46:01 +0100
commit38e8703d988dd5f42adf2444ac70d9124f8a5d84 (patch)
tree76ddca2310b7e0ae857d982ea93ca88ea900d145
parent98a58406586de68e7e6b7777ef1612f9655fd952 (diff)
add xinit
-rw-r--r--.config/x11/xinitrc18
-rw-r--r--.config/x11/xprofile17
2 files changed, 35 insertions, 0 deletions
diff --git a/.config/x11/xinitrc b/.config/x11/xinitrc
new file mode 100644
index 0000000..b183f25
--- /dev/null
+++ b/.config/x11/xinitrc
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# xinitrc runs automatically when you run startx.
+
+# There are some small but important commands that need to be run when we start
+# the graphical environment. There is a link to this file in ~/.xprofile
+# because that file is run automatically if someone uses a display manager
+# (login screen) and so they are needed there. To prevent doubling up commands,
+# I source them here with the line below.
+
+if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
+ . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
+else
+ . "$HOME/.xprofile"
+fi
+# Activate dbus variables
+dbus-update-activation-environment --all
+dbus-launch ssh-agent dwm
diff --git a/.config/x11/xprofile b/.config/x11/xprofile
new file mode 100644
index 0000000..02e5664
--- /dev/null
+++ b/.config/x11/xprofile
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# This file runs when a DM logs you into a graphical session.
+# If you use startx/xinit like a Chad, this file will also be sourced.
+
+xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger screens.
+# setbg & # set the background with the `setbg` script
+#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup
+
+autostart="mpd xcompmgr dunst unclutter pipewire remapd"
+
+for program in $autostart; do
+ pidof -sx "$program" || "$program" &
+done >/dev/null 2>&1
+
+# Ensure that xrdb has finished running before moving on to start the WM/DE.
+[ -n "$xrdbpid" ] && wait "$xrdbpid"