about summary refs log tree commit diff
path: root/sx/.local
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>1970-01-01 03:00:00 +0300
committerAzat Bahawi <azat@bahawi.net>2022-09-20 11:51:54 +0300
commit38bab29776950ac2364ed64195b89887717c33de (patch)
treeedaaf366a55dbe96d268019124536bc504c64e87 /sx/.local
chore: init HEAD master
Diffstat (limited to 'sx/.local')
-rwxr-xr-xsx/.local/etc/sx/sxrc74
1 files changed, 74 insertions, 0 deletions
diff --git a/sx/.local/etc/sx/sxrc b/sx/.local/etc/sx/sxrc
new file mode 100755
index 0000000..8e65f35
--- /dev/null
+++ b/sx/.local/etc/sx/sxrc
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+if [ -f "${HOME}/.profile" ]; then
+    # shellcheck disable=SC1090
+    . "${HOME}/.profile"
+fi
+
+(
+    if command -v xrdb >/dev/null 2>&1 &&
+        [ -f "${HOME}/.Xresources" ]; then
+        xrdb "${HOME}/.Xresources"
+    fi
+
+    if command -v xset >/dev/null 2>&1; then
+        xset s off
+        xset -dpms
+        xset m 3/2 3
+        xset r rate 200 50
+    fi
+
+    if command -v setxkbmap >/dev/null 2>&1; then
+        setxkbmap \
+            -layout "us,ru" \
+            -variant ",phonetic" \
+            -option terminate:ctrl_alt_bksp \
+            -option caps:escape \
+            -option compose:menu \
+            -option grp:win_space_toggle
+    fi
+
+    if command -v xbindkeys >/dev/null 2>&1 &&
+        [ -f "${HOME}/.xbindkeysrc" ]; then
+        xbindkeys &
+    fi
+
+    if command -v xbanish >/dev/null 2>&1; then
+        xbanish &
+    fi
+
+    if command -v autocutsel >/dev/null 2>&1; then
+        autocutsel -fork -selection CLIPBOARD
+        autocutsel -fork -selection PRIMARY
+    fi
+
+    if command -v xgetres >/dev/null 2>&1; then
+        if command -v hsetroot >/dev/null 2>&1; then
+            hsetroot -solid "$(xgetres background)"
+        elif command -v xsetroot >/dev/null 2>&1; then
+            xsetroot -solid "$(xgetres background)"
+        fi
+    fi
+
+    if command -v picom >/dev/null 2>&1; then
+        picom --daemon
+    fi
+) &
+
+if command -v dbus-launch >/dev/null 2>&1 &&
+    [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
+    eval "$(dbus-launch --sh-syntax --exit-with-x11)"
+fi
+
+WM="dwm"
+if command -v "${WM}" >/dev/null 2>&1; then
+    if command -v wmname >/dev/null 2>&1; then
+        wmname "LG3D"
+    fi
+
+    if command -v dwm-status >/dev/null 2>&1; then
+        dwm-status &
+    fi
+
+    exec "${WM}"
+fi

Consider giving Nix/NixOS a try! <3