-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.xprofile
56 lines (45 loc) · 2.3 KB
/
.xprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Means already in desktop files, either /etx/xdg/autostart or ~/.config/autostart
# Go to home
cd ~
# Execute global scripts
for file in /etc/X11/xinit/xinitrc.d/?*.sh; do
if [ -x "$file" ]; then
name=$(basename -s .sh $file)
logfile="$MDIR_LOGS/startx/etc_$name.log$DISPLAY"
($file >"$logfile" 2>&1 & )
fi
done
unset file
# Load X resources, never background them
[ -f ~/.Xdefaults ] && xrdb -merge ~/.Xdefaults > "$MDIR_LOGS/startx/xrdb_defaults.log$DISPLAY" 2>&1
[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources > "$MDIR_LOGS/startx/xrdb_resources.log$DISPLAY" 2>&1
# Source my files with environment variables used by all applications...
# [ -f ~/.env_global ] && . ~/.env_global > "$MDIR_LOGS/startx/env_global.log$DISPLAY" 2>&1
# actually they are sourced via bashrc
# ... and GUI applications
[ -f ~/.env_gui ] && . ~/.env_gui > "$MDIR_LOGS/startx/env_gui.log$DISPLAY" 2>&1
# To avoid terminal bell
xset -b
# Start the OpenSSH agent, evaluating the environment variables. It exports SSH_AUTH_SOCK
eval $(ssh-agent -s &) >"$MDIR_LOGS/startx/ssh_agent.log$DISPLAY" 2>&1
# Gnome key ring, with ssh agent disabled bcz using ssh-agent and gpg disabled bcz gpg-agent started by systemctl --user
## eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets) >"$MDIR_LOGS/startx/gnome_keyring.log$DISPLAY" 2>&1
#export SSH_AUTH_SOCK
# Change the screen settings
# xrandr --output "Screen 0" --brightness 0.5 --gamma 1:1:0.5
xrandr --output $(xrandr | grep -E " connected (primary )?[1-9]+" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/") --brightness 0.5 --gamma 1:1:0.5 > "$MDIR_LOGS/startx/xrandr.log$DISPLAY" 2>&1
# Activate bloc num
numlockx &
# Set us layout for keyboard
setxkbmap -layout us,it > "$MDIR_LOGS/startx/setxkbmap.log$DISPLAY" 2>&1
# To remap keys, see http://www.economyofeffort.com/2014/08/11/beyond-ctrl-remap-make-that-caps-lock-key-useful/
setxkbmap -option 'caps:ctrl_modifier' >> "$MDIR_LOGS/startx/setxkbmap.log$DISPLAY" 2>&1
xcape -e 'Caps_Lock=Escape;Control_L=Escape' > "$MDIR_LOGS/startx/xcape.log$DISPLAY" 2>&1
# Alternative method to swap CapsLock and Ctrl key
# xmodmap ~/.config/xmodmap/speedswapper
# Repeat delay (100-1000) and repeat interval (10-200) of keyboard
xset r rate 250 60
# Disable slow-keys
xkbset -sl
# Disable accessibility so slow-keys won't turn back on
xkbset -a