-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathetc##minos##autostart
executable file
·60 lines (51 loc) · 2.4 KB
/
etc##minos##autostart
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
#!/bin/sh
#This file is part of the minos-desktop-settings package
_exec() {
[ -z "${1}" ] && return 1
if command -v "${1%% *}" >/dev/null; then
if ! pgrep -f "${1%% *}" >/dev/null; then
#(eval "${@}") &
("${@}") &
fi
else
printf "%s\\n" "${1} was not found!" >&2
fi
}
_execm() {
_execm__tool="$(minos-config "${1}" 2>/dev/null)"
if [ -z "${_execm__tool}" ]; then
shift && _exec "${@}"
else
_exec "${_execm__tool}"; unset _execm__tool
fi
}
#force to start in the 1st virtual workspace
w1="$(cat /etc/i3/config ~/.i3/config 2>/dev/null | \
awk '/set \$w1 / {$1=""; $2=""; sub(/^[ \t]+/, ""); print; exit}' | tail -1)"
[ -n "${w1}" ] && _exec i3-msg workspace "${w1}"
#_exec mplayer -loop 0 -rootwin -ao null -noconsolecontrols video.mp4 #video background
wallpaper="$(minos-config wallpaper 2>/dev/null)"
#if no wallpaper, set background to black; otherwise apply wallpaper
[ -z "${wallpaper}" ] && _exec xsetroot -solid "#000000" || _exec feh --bg-scale "${wallpaper}"
terminal_emulator="$(minos-config terminal 2>/dev/null)"
terminal_emulator="${terminal_emulator:-x-terminal-emulator}"
#_exec "${terminal_emulator}" -name scratchpad -e "${SHELL}"
_exec "${terminal_emulator}" -name scratchpad -e "${SHELL}" -c "tmux attach -t scratchpad || tmux new -s scratchpad"
_execm clipboard autocutsel #sync X/Gnome clipboards
_execm eyesaver redshift #save your eyes
_execm handsaver workrave #save your hands
(sleep 2 && _execm composition compton)& #eyecandy + fix for general tearing
#(sleep 2 && _execm composition 'xcompmgr -cCFf -l2 -t1 -r3 -o.20 -D3')&
#mplayer fifo controller
mplayer__fifo="$(cat etc/mplayer/mplayer.conf ~/.mplayer/config 2>/dev/null | \
awk '/^input=file=/ {sub(/^input=file=/, ""); print}' | tail -1)"
[ -n "${mplayer__fifo}" ] && [ ! -e "${mplayer__fifo}" ] && mkfifo "${mplayer__fifo}"
_exec minos-welcome
#_exec urxvtd -q -f -o #urxvt server, improves performance but breaks often
#_exec xbanish #hide mouse coursor when it isn't used, broken
#_exec unclutter -root -visible #hide mouse coursor when it isn't used, broken
#_exec numlockx on #numlock on
#_exec setxkbmap -option terminate:ctrl_alt_bksp #Ctrl-Alt-Backspace to kill X
if [ -x "${HOME}"/.minos/autostart ] && [ X"${0}" != X"${HOME}"/.minos/autostart ]; then
exec "${HOME}"/.minos/autostart
fi