-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.xprofile
85 lines (68 loc) · 2.08 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
# Variables
CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}"
LIBEXEC="$HOME/.local/libexec"
# Screen, wallpaper {{{
# Monitors
if ! set-monitor 2> /dev/null
then
mainMonitor=$(xrandr | grep -P ' connected .*primary.*' | awk '{print $1}')
params=""
while IFS= read -r line
do
monitorName="$(echo $line | awk '{print $1}')"
params="$params --output $monitorName --auto --left-of $mainMonitor"
done < <(xrandr | grep 'connected' | grep -v "$mainMonitor")
xrandr --output $mainMonitor --primary --auto $params
fi
# Compositor
which picom && pgrep picom || picom & disown
# Wallpaper
which feh && {
wallpaper="$CONFIG/wallpaper/wallpaper";
[ -f "$wallpaper" ] || wallpaper="$CONFIG/wallpaper/fallback.png";
feh --no-fehbg --bg-scale "$wallpaper";
}
# }}}
# Input {{{
# Keyboard layout
setxkbmap es
# To alternate between spanish (es) and english (us) layout by pressing
# <Meta>(Win) and <Space> simultaneously
# setxkbmap -layout es,us -option grp:win_space_toggle
# Mouse
mouseName="Logitech"
mouseId=$(xinput list | grep -P "$mouseName\s+.*pointer" |
sed -n -E 's/.*id=([0-9]+).*/\1/p')
if [ "$mouseId" != "" ]
then
xinput set-prop $mouseId \
'Coordinate Transformation Matrix' 0.43 0 0 0 0.43 0 0 0 1
fi
# Touchpad
touchpad="$(xinput list | grep -P 'Touchpad.*pointer')"
if [ $(xinput list | grep 'Touchpad' | wc -l) -eq 1 ]
then
touchpad_id=$(awk '{match($0, /id=([0-9]+)/, m); print m[1]}' <<< "$touchpad")
xinput set-prop $touchpad_id \
'libinput Tapping Enabled' 1
xinput set-prop $touchpad_id \
'libinput Natural Scrolling Enabled' 1
xinput set-prop $touchpad_id \
'Coordinate Transformation Matrix'\
0.75 0 0 0 0.75 0 0 0 1
fi
# }}}
# Xresources {{{
xrdb -load "$CONFIG/X11/Xresources"
# }}}
# Programs {{{
# Uptime session
echo $(date +"%s") > /tmp/start_session.tmp
# Safe Eyes
$LIBEXEC/safeeyes.sh & disown
# Break
$LIBEXEC/break.sh & disown
# Activity
$LIBEXEC/activity.py & disown
# }}}