-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.xprofile
executable file
·100 lines (83 loc) · 3.27 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env bash
# ----| Vars | ----
# -- Laptop --
export LAPTOP='eDP'
# -- Monitor --
export HDMI='HDMI-A-0'
export DISPLAY_PORT='DisplayPort-0'
export DISPLAY_PORT_1='DisplayPort-1'
HDMI_CONNECTED=$(xrandr | grep "$HDMI connected" | awk '{print $1}')
DISPLAY_PORT_CONNECTED=$(xrandr | grep "$DISPLAY_PORT connected" | awk '{print $1}')
DISPLAY_PORT_1_CONNECTED=$(xrandr | grep "$DISPLAY_PORT_1 connected" | awk '{print $1}')
export HDMI_CONNECTED
export DISPLAY_PORT_CONNECTED
export DISPLAY_PORT_1_CONNECTED
export PATH=$HOME/.nimble/bin:$HOME/bin:/usr/local/bin:$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.spicetify:$HOME/.local/share/coursier/bin:$HOME/.local/bin/:$PATH
export QT_STYLE_OVERRIDE=kvantum
export DENO_INSTALL="$HOME/.deno"
export STARSHIP_CONFIG="$HOME/.config/fish/starship.toml"
export EDITOR="nvim"
function set_hdmi_monitor() {
xrandr --addmode $HDMI 1920x1080R
if [[ $DISPLAY_PORT_CONNECTED ]]; then
xrandr --output "$HDMI" -r 60.0 --mode 1920x1080R --rotate normal --right-of "$DISPLAY_PORT" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
else
xrandr --output "$HDMI" -r 60.0 --mode 1920x1080R --rotate normal --right-of "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
fi
}
function set_display_port_1_monitor() {
xrandr --addmode $DISPLAY_PORT_1 1920x1080R
if [[ $HDMI_CONNECTED ]]; then
xrandr --output "$DISPLAY_PORT_1" -r 75.0 --mode 1920x1080R --rotate normal --below "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
elif [[ $DISPLAY_PORT_CONNECTED ]]; then
xrandr --output "$DISPLAY_PORT_1" -r 75.0 --mode 1920x1080R --rotate normal --below "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
else
xrandr --output "$DISPLAY_PORT_1" -r 75.0 --mode 1920x1080R --rotate normal --right-of "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
fi
}
function set_display_port_monitor() {
xrandr --addmode $DISPLAY_PORT 1920x1080R
if [[ $HDMI_CONNECTED ]]; then
xrandr --output "$DISPLAY_PORT" -r 75.0 --mode 1920x1080R --rotate normal --left-of "$HDMI" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
elif [[ $DISPLAY_PORT_1_CONNECTED ]]; then
xrandr --output "$DISPLAY_PORT" -r 75.0 --mode 1920x1080R --rotate normal --left-of "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
else
xrandr --output "$DISPLAY_PORT" -r 75.0 --mode 1920x1080R --rotate normal --right-of "$LAPTOP" \
--output "$LAPTOP" --mode 1920x1080 --rotate normal
fi
}
function set_dual_monitor() {
xrandr --newmode "1920x1080R" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
set_display_port_1_monitor
set_display_port_monitor
}
if [[ $HDMI_CONNECTED && $DISPLAY_PORT_CONNECTED ]]; then
set_dual_monitor
elif [[ $HDMI_CONNECTED ]]; then
set_hdmi_monitor
elif [[ $DISPLAY_PORT_CONNECTED ]]; then
set_display_port_monitor
else
xrandr --output "$LAPTOP" --primary --mode 1920x1080 --rotate normal
fi
xinput set-prop "TPPS/2 Elan TrackPoint" "libinput Accel Speed" -0.6
xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "keycode 66 = Control_L"
xmodmap -e "add Control = Control_L"
lxsession &
nitrogen --restore &
udiskie -t &
nm-applet &
blueman-adapters &
picom &
battery &
volumeicon &
redshift -O 4000 &
solaar -b regular -w hide &