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/vimrc
|
||||
tailscale/
|
||||
X11/xinit/xinitrc.d/
|
||||
!X11/xinit/xinitrc.d/default.sh
|
||||
!X11/xinit/xinitrc.d/example.sh
|
||||
X11/xinit/xinitrc.d/*local.sh
|
||||
*.bak
|
||||
lazydocker/
|
||||
sunshine/
|
||||
|
|
|
|||
|
|
@ -8,41 +8,50 @@
|
|||
# . /etc/X11/Xsession
|
||||
# fi
|
||||
|
||||
userresources=$XDG_CONFIG_HOME/X11/Xresources
|
||||
ERRFILE=$XDG_CACHE_HOME/X11/xsession-errors
|
||||
usermodmap=$XDG_CONFIG_HOME/X11/Xmodmap
|
||||
sysresources=/etc/X11/xinit/.Xresources
|
||||
sysmodmap=/etc/X11/xinit/.Xmodmap
|
||||
OPTIONFILE=/etc/X11/Xsession.options
|
||||
|
||||
if [ -f $sysresources ] ; then
|
||||
xrdb -merge $sysresources
|
||||
SYSRESOURCES=/etc/X11/Xresources
|
||||
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
|
||||
|
||||
if [ -f $sysmodmap ] ; then
|
||||
xmodmap $sysmodmap
|
||||
fi
|
||||
exec >>"$ERRFILE" 2>&1
|
||||
|
||||
if [ -f "$userresources" ] ; then
|
||||
xrdb -merge "$userresources"
|
||||
for res in "$SYSRESOURCES" "$USRRESOURCES"; do
|
||||
if [ -f "$res" ]; then
|
||||
xrdb -merge "$res"
|
||||
fi
|
||||
done
|
||||
unset res
|
||||
|
||||
if [ -f "$usermodmap" ] ; then
|
||||
xmodmap "$usermodmap"
|
||||
sys_xinit_d="/etc/X11/xinit/xinitrc.d"
|
||||
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
|
||||
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
|
||||
if [ -d ~/.config/X11/xinit/xinitrc.d ] ; then
|
||||
for f in ~/.config/X11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
unset dir
|
||||
|
||||
while true; do
|
||||
i3 >/dev/null 2>&1
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@
|
|||
# Example initialization script.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Keyboard configuration
|
||||
#xset r rate 300 70
|
||||
# English keymap
|
||||
#setxkbmap en
|
||||
|
||||
# Monitors
|
||||
|
|
@ -20,5 +19,4 @@
|
|||
# Startup programs
|
||||
#STATUS_BLOCKS="tray vol mic net bat kbd time date" dwmstatus & # Status bar
|
||||
#emacs --daemon &
|
||||
#clipse -listen &
|
||||
#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