better xinit
This commit is contained in:
parent
af42c0cde9
commit
21d5f4ed4f
9 changed files with 67 additions and 51 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -276,9 +276,7 @@ nvim/lua/plugins/example.lua
|
||||||
cvim/
|
cvim/
|
||||||
!cvim/vimrc
|
!cvim/vimrc
|
||||||
tailscale/
|
tailscale/
|
||||||
X11/xinit/xinitrc.d/
|
X11/xinit/xinitrc.d/*local.sh
|
||||||
!X11/xinit/xinitrc.d/default.sh
|
|
||||||
!X11/xinit/xinitrc.d/example.sh
|
|
||||||
*.bak
|
*.bak
|
||||||
lazydocker/
|
lazydocker/
|
||||||
sunshine/
|
sunshine/
|
||||||
|
|
|
||||||
|
|
@ -8,41 +8,50 @@
|
||||||
# . /etc/X11/Xsession
|
# . /etc/X11/Xsession
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
userresources=$XDG_CONFIG_HOME/X11/Xresources
|
OPTIONFILE=/etc/X11/Xsession.options
|
||||||
ERRFILE=$XDG_CACHE_HOME/X11/xsession-errors
|
|
||||||
usermodmap=$XDG_CONFIG_HOME/X11/Xmodmap
|
|
||||||
sysresources=/etc/X11/xinit/.Xresources
|
|
||||||
sysmodmap=/etc/X11/xinit/.Xmodmap
|
|
||||||
|
|
||||||
if [ -f $sysresources ] ; then
|
SYSRESOURCES=/etc/X11/Xresources
|
||||||
xrdb -merge $sysresources
|
USRRESOURCES="$XDG_CONFIG_HOME"/X11/Xresources
|
||||||
|
|
||||||
|
SYSSESSIONDIR=/etc/X11/Xsession.d
|
||||||
|
USERXSESSION="$XDG_DATA_HOME"/xsession
|
||||||
|
USERXSESSIONRC="$XDG_CONFIG_HOME"/xsessionrc
|
||||||
|
ALTUSERXSESSION="$XDG_DATA_HOME"/Xsession
|
||||||
|
ERRFILE="$XDG_CACHE_HOME"/X11/xsession-errors
|
||||||
|
|
||||||
|
if ! [ -d "${ERRFILE%/*}" ] || ! touch "$ERRFILE"; then
|
||||||
|
if mkdir -p "${ERRFILE%/*}"; then
|
||||||
|
if ! touch "$ERRFILE"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $sysmodmap ] ; then
|
exec >>"$ERRFILE" 2>&1
|
||||||
xmodmap $sysmodmap
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$userresources" ] ; then
|
for res in "$SYSRESOURCES" "$USRRESOURCES"; do
|
||||||
xrdb -merge "$userresources"
|
if [ -f "$res" ]; then
|
||||||
|
xrdb -merge "$res"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
unset res
|
||||||
|
|
||||||
if [ -f "$usermodmap" ] ; then
|
sys_xinit_d="/etc/X11/xinit/xinitrc.d"
|
||||||
xmodmap "$usermodmap"
|
usr_xinit_d="$XDG_CONFIG_HOME/X11/xinit/xinitrc.d"
|
||||||
|
|
||||||
|
for dir in "$sys_xinit_d" "$usr_xinit_d"; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
for f in "$dir"/?*.sh; do
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
. "$f"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
|
||||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
|
||||||
[ -x "$f" ] && . "$f"
|
|
||||||
done
|
done
|
||||||
unset f
|
unset f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d ~/.config/X11/xinit/xinitrc.d ] ; then
|
|
||||||
for f in ~/.config/X11/xinit/xinitrc.d/?*.sh ; do
|
|
||||||
[ -x "$f" ] && . "$f"
|
|
||||||
done
|
done
|
||||||
unset f
|
unset dir
|
||||||
fi
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
i3 >/dev/null 2>&1
|
i3 >/dev/null 2>&1
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
# Example initialization script.
|
# Example initialization script.
|
||||||
#
|
#
|
||||||
# In order to run commands on start, create scripts such
|
# In order to run commands on start, create scripts such
|
||||||
# as this one in the .config/X11/init.d directory and make
|
# as this one in the .config/X11/xinit/xinitrc.d directory and make
|
||||||
# them executable.
|
# them executable.
|
||||||
|
|
||||||
# Keyboard configuration
|
# English keymap
|
||||||
#xset r rate 300 70
|
|
||||||
#setxkbmap en
|
#setxkbmap en
|
||||||
|
|
||||||
# Monitors
|
# Monitors
|
||||||
|
|
@ -20,5 +19,4 @@
|
||||||
# Startup programs
|
# Startup programs
|
||||||
#STATUS_BLOCKS="tray vol mic net bat kbd time date" dwmstatus & # Status bar
|
#STATUS_BLOCKS="tray vol mic net bat kbd time date" dwmstatus & # Status bar
|
||||||
#emacs --daemon &
|
#emacs --daemon &
|
||||||
#clipse -listen &
|
|
||||||
#dunst
|
#dunst
|
||||||
5
X11/xinit/xinitrc.d/01-dbus.sh
Executable file
5
X11/xinit/xinitrc.d/01-dbus.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# updates the list of environment variables used by dbus
|
||||||
|
|
||||||
|
dbus-update-activation-environment --systemd --all
|
||||||
|
systemctl --user import-environment DISPLAY
|
||||||
7
X11/xinit/xinitrc.d/02-policy-kit.sh
Executable file
7
X11/xinit/xinitrc.d/02-policy-kit.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if command -v lxpolkit >/dev/null; then
|
||||||
|
lxpolkit &
|
||||||
|
else
|
||||||
|
echo "error: lxpolkit not found"
|
||||||
|
fi
|
||||||
3
X11/xinit/xinitrc.d/50-repeat-rate.sh
Executable file
3
X11/xinit/xinitrc.d/50-repeat-rate.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
xset r rate 300 70
|
||||||
7
X11/xinit/xinitrc.d/51-clipboard.sh
Executable file
7
X11/xinit/xinitrc.d/51-clipboard.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if command -v clipse >/dev/null; then
|
||||||
|
clipse -listen-shell &
|
||||||
|
else
|
||||||
|
echo "error: clipse not found"
|
||||||
|
fi
|
||||||
5
X11/xinit/xinitrc.d/99-grace-time.sh
Executable file
5
X11/xinit/xinitrc.d/99-grace-time.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# A bit of grace time to press Ctrl+C if needed
|
||||||
|
# after startx
|
||||||
|
sleep 0.2
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Default initialization script
|
|
||||||
#
|
|
||||||
# These commands are required at startup,
|
|
||||||
# If removed, you might run into errors.
|
|
||||||
|
|
||||||
# Environment for dbus and xdg-desktop-portal
|
|
||||||
dbus-update-activation-environment --systemd --all
|
|
||||||
systemctl --user import-environment DISPLAY
|
|
||||||
|
|
||||||
# Policy kit
|
|
||||||
lxpolkit &
|
|
||||||
|
|
||||||
# A bit of grace time to press Ctrl+C if needed
|
|
||||||
sleep 0.2
|
|
||||||
Loading…
Reference in a new issue