about summary refs log tree commit diff
path: root/sx
diff options
context:
space:
mode:
Diffstat (limited to 'sx')
-rwxr-xr-xsx/.local/etc/sx/sxrc74
-rwxr-xr-xsx/@install10
2 files changed, 84 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
diff --git a/sx/@install b/sx/@install
new file mode 100755
index 0000000..32da1b7
--- /dev/null
+++ b/sx/@install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ ! -d "${XDG_CONFIG_HOME}/sx" ] && \
+    mkdir -p "${XDG_CONFIG_HOME}/sx"
+
+stow \
+    --target="${HOME}" \
+    --ignore="^@.*" \
+    --verbose \
+    sx

Consider giving Nix/NixOS a try! <3