-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsemplice-openbox-autostart
executable file
·174 lines (139 loc) · 6.12 KB
/
semplice-openbox-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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/bin/sh
#
# Openbox autostart script for Semplice Linux.
# (C) 2009-2013 The Semplice Linux Team. All rights reserved.
# Released under the terms of the GNU GPL v3 license (or later). See /usr/share/common-licenses/GPL.
#
### Set variables, if they are blank...
[ -z "$icons" ] && icons="n"
if [ "$icons" = "y" ]; then
pcmanfm_args="$pcmanfm_args --desktop"
else
pcmanfm_args="$pcmanfm_args"
fi
[ -z "$disablewallpaper" ] && disablewallpaper="n"
# Workaround to get 'Applications' bookmark work in pcmanfm
export XDG_MENU_PREFIX="semplice-"
# File Manager
pcmanfm -d $pcmanfm_args &
[ "$icons" = "n" ] && [ "$disablewallpaper" != "y" ] && nitrogen --restore # If no icons, set wallpaper ourselves.
# Who needs volti? (volume control on Semplice 3.x or lower)
# (if someone really needs it, just use the full executable path)
[ -z "$volcontrol" ] || [ "$volcontrol" = "volti" ] && volcontrol="volumeicon"
[ -z "$conkyconf" ] && conkyconf="/etc/conky/semplice.conf"
[ -z "$snap" ] && snap="y"
[ -z "$panel" ] && panel="tint2"
# $panel_config can be blank.
[ -z "$checktouchpad" ] && checktouchpad="y"
[ -z "$fixtouchpad" ] && fixtouchpad="n"
[ -z "$interval" ] && interval="2"
if [ -e "/etc/semplice-live-mode" ]; then
export LIVEMODE="`cat /etc/semplice-live-mode`"
fi
### LIVE SYSTEM
# Fix keyboard, not useful in "yeahh", needed to fix layout in "install" (and, of course, needed by "nolock")
if [ "$LIVEMODE" ]; then # The code below permits to resolve a "bug" in the live session in build 40 and higher.
. /etc/default/keyboard
if [ "$XKBMODEL" ]; then
setxkbmap $XKBLAYOUT -model $XKBMODEL
else
setxkbmap $XKBLAYOUT
fi
if [ "$LIVEMODE" = "yeahh" ]; then
nitrogen --set-zoom-fill /usr/share/images/desktop-base/semplice_gdm_background.png
sudo /usr/bin/keeptalking_gtk.py
#sudo invoke-rc.d hal restart
sudo screen -A -m -d -S gdm3 nice /usr/share/keeptalking/restartgdm lightdm
exit 0
elif [ "$LIVEMODE" = "install" ]; then
nitrogen --set-zoom-fill /usr/share/images/desktop-base/semplice_gdm_background.png
#roxterm --hide-menubar -f -T "Install Semplice" -n "Semplice Live System Installer" -e /usr/bin/linstaller_wrapper.sh start
/usr/bin/linstaller_crash_wrapper.sh start -f=glade # use GUI
# If install fails, let the user choose: Or reboot or continue to boot the live system
semplice-logout --reboot-install
echo "nolock" | sudo tee /etc/semplice-live-mode
elif [ "$LIVEMODE" = "install-raspberrypi" ]; then
nitrogen --set-zoom-fill /usr/share/images/desktop-base/semplice_gdm_background.png
#roxterm --hide-menubar -f -T "Install Semplice" -n "Semplice Live System Installer" -e /usr/bin/linstaller_wrapper.sh start -c=semplice-raspberrypi
/usr/bin/linstaller_crash_wrapper.sh start -c=semplice-raspberrypi -f=glade # use GUI
sudo reboot
fi
fi
### Ok, begin... ;-)
## OLD WORKAROUND TO GET NOTIFICATIONS WORKING:
# An update to notification-daemon dropped the old way to launch it (via dbus) in favour of a XDG .desktop autostart way.
# This forces semplice (openbox-xdg-autostart in fact, which is started before this script and it's not controlled by us) to launch notification-daemon.
# This means that the fancy notifications (notify-osd) are not started.
# Boxes who have xfce4-notify will not get it started starting from semplice-utilities 2.10.4.
#
# We should *KILL* (yeah, kill) the notification-daemon.
#kill -9 `pidof /usr/lib/notification-daemon/notification-daemon`
# And then start notify-osd.
#/usr/lib/notify-osd/notify-osd &
## END OF WORKAROUND
## NEW WORKAROUND TO GET NOTIFICATIONS WORKING:
# As of Semplice 3.0 RC1, we are now using xfce4-notifyd. It should be launched automatically via dbus, but we need
# before to kill notification-daemon if it is runnng.
#
NOTIPID="`pidof /usr/lib/notification-daemon/notification-daemon`"
if [ $NOTIPID ]; then
kill -9 $NOTIPID
fi
#
## END OF WORKAROUND
# Check if a touchpad is connected... checktouchpad="n" and fixtouchpad="y" forces this.
if [ "$checktouchpad" = "y" ] && [ "`grep -i touchpad /proc/bus/input/devices`" ]; then
fixtouchpad="y"
elif [ "$checktouchpad" = "y" ]; then
fixtouchpad="n"
fi
# Enable tap-to-click, many thanks to Carmine Sorrentino <http://debianaro.posterous.com> for that!
if [ "$fixtouchpad" = "y" ]; then
synclient TapButton1=1
synclient TapButton2=2
synclient TapButton3=2
synclient VertTwoFingerScroll=1
synclient HorizTwoFingerScroll=1
synclient VertEdgeScroll=1
fi
# (Semplice 6): Ensure we properly configure snapping in openbox
if [ ! -e "~/.config/openbox/.snapupgrade" ]; then
/usr/share/semplice-default-settings/fix_snapping.py
openbox --reconfigure
fi
# Window Snap
if [ "$snap" = "y" ] && [ -e "/usr/bin/opensnap" ]; then
/usr/bin/opensnap --daemon -c /etc/opensnap
fi
# Set nitrogen config...
if [ -e "$HOME/.config/nitrogen/nitrogen.cfg.firststart" ]; then
echo "dirs=$HOME/.config/nitrogen/add-wallpaper;/usr/share/backgrounds;" >> $HOME/.config/nitrogen/nitrogen.cfg.firststart
mv $HOME/.config/nitrogen/nitrogen.cfg.firststart $HOME/.config/nitrogen/nitrogen.cfg
xrdb -merge ~/.Xresources # xscreensaver style
# FIXME FIXME FIXME FIXME FIXME (should handle first start better)
# Set localized clock for those using the AM/PM format.
_ampm="`date +%p`"
if [ "$_ampm" = "PM" ] || [ "$_ampm" = "AM" ]; then
mkdir -p ~/.config/tint2
cat >> ~/.config/tint2/secondary_config <<EOF
time1_format = %I:%M %p
panel_items = TSBC
EOF
fi
fi
# Start panel, conky, volume control and composite manager
(sleep $interval
$panel $panel_config &
[ "$conkyconf" != "disabled" ] && conky --config $conkyconf &
[ "$volcontrol" != "disabled" ] && $volcontrol &
[ -e ~/.config/.composite_enabled ] && [ -x /usr/bin/compton ] && /usr/bin/compton -b
) &
xscreensaver &
# Autostaring applications in /etc/xdg/autostart and ~/.config/autostart:
xdg-autostart GNOME XFCE LXDE # XFCE is needed for xfce4-power manager, LXDE for lxrandr.
# And tell the user that all is OK! ;)
#notify-send -i config-users "Successfully logged in" "Welcome to your Semplice desktop, $USER!"
# Show legacy dialog if we should
if [ -x /usr/bin/vera-session ] && [ ! -e ~/.config/.semplice-legacy-dialog-shown ]; then
/usr/share/semplice-default-settings/semplice-legacy-dialog.py
fi