summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2025-02-09 14:58:37 +0100
committerMike Vink <ivi@vinkies.net>2025-02-09 14:58:37 +0100
commitd6ebffc7f8f9e094c277c39433e6f68fa5b6ac47 (patch)
tree77de197a1a69793143a2bc4a2e84b07889990b83
parentbc8f28fcc41e329b5c662c5bad8c7ac7891d7dc0 (diff)
putdotfiles
-rw-r--r--.config/x11/xprofile4
-rwxr-xr-x.local/bin/putdotfiles13
-rwxr-xr-x.local/bin/remapd8
-rwxr-xr-x.local/bin/remaps11
4 files changed, 32 insertions, 4 deletions
diff --git a/.config/x11/xprofile b/.config/x11/xprofile
index ab70bbf..b9d27fa 100644
--- a/.config/x11/xprofile
+++ b/.config/x11/xprofile
@@ -7,12 +7,14 @@ xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger scre
# 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"
+autostart="mpd xcompmgr dunst pipewire remapd"
for program in $autostart; do
pidof -sx "$program" || "$program" &
done >/dev/null 2>&1
+pidof -sx "unclutter" || unclutter -noevents &
+
# Starts a gpg-agents and configures it as ssh-agent.
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
diff --git a/.local/bin/putdotfiles b/.local/bin/putdotfiles
index f8d4d3e..195770c 100755
--- a/.local/bin/putdotfiles
+++ b/.local/bin/putdotfiles
@@ -1,4 +1,11 @@
#!/bin/sh
-putgitrepo \
- https://github.com/ivi-vink/dotfiles.git \
- /home/$USER
+if [ -d "$HOME/.local/src/dotfiles/.git" ]; then
+ cp -rfT \
+ "$HOME/.local/src/dotfiles" \
+ "/home/$USER"
+else
+ putgitrepo \
+ https://github.com/ivi-vink/dotfiles.git \
+ /home/$USER
+fi
+rm -rf "/home/$USER/.git"
diff --git a/.local/bin/remapd b/.local/bin/remapd
new file mode 100755
index 0000000..ee4cf39
--- /dev/null
+++ b/.local/bin/remapd
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Rerun the remaps script whenever a new input device is added.
+
+while :; do
+ remaps
+ grep -qP -m1 '[^un]bind.+\/[^:]+\(usb\)' <(udevadm monitor -u -t seat -s input -s usb)
+done
diff --git a/.local/bin/remaps b/.local/bin/remaps
new file mode 100755
index 0000000..6d7d54e
--- /dev/null
+++ b/.local/bin/remaps
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# This script is called on startup to remap keys.
+# Decrease key repeat delay to 300ms and increase key repeat rate to 50 per second.
+xset r rate 300 50
+# Map the caps lock key to super, and map the menu key to right super.
+setxkbmap -option caps:super,altwin:menu_win
+# When caps lock is pressed only once, treat it as escape.
+killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
+# Turn off caps lock if on since there is no longer a key for it.
+xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock