~mil/sxmo-utils

ref: c7c9233be89c58e5f33991ed3358f1e9bd1a7df2 sxmo-utils/configs/default_hooks/start -rw-r--r-- 2.7 KiB
c7c9233bnoneofyourbusiness remove uncompliant -h from sort 6 months ago
                                                                                
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
#!/bin/sh

# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(which sxmo_common.sh)"

# in case of weird crash
echo "unlock" > "$SXMO_LASTSTATE"
[ -f "$SXMO_UNSUSPENDREASONFILE" ] && rm -f "$SXMO_UNSUSPENDREASONFILE"

# Force audio over the main speaker
# and set a sane default volume
sxmo_audio.sh device set Speaker
amixer sset 'Line Out Source' 'Mono Differential','Mono Differential' >/dev/null
amixer set "Line Out" 75% >/dev/null

# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &

case "$SXMO_WM" in
	sway)
		sxmo_daemons.sh start desktop_notifier mako
		sxmo_daemons.sh start wob sxmo_wob.sh
		sxmo_daemons.sh start menu_mode_toggler sxmo_menumode_toggler.sh
		;;
	dwm)
		sxmo_daemons.sh start desktop_notifier dunst

		# Auto hide cursor with touchscreen, Show it with a mouse
		if command -v "unclutter-xfixes" > /dev/null; then
			set -- unclutter-xfixes
		else
			set -- unclutter
		fi
		sxmo_daemons.sh start unclutter_xfixes "$1" --hide-on-touch --start-hidden

		# Set a pretty wallpaper
		feh --bg-fill /usr/share/sxmo/background.jpg

		sxmo_daemons.sh start autocutsel_1 autocutsel
		sxmo_daemons.sh start autocutsel_2 autocutsel -selection PRIMARY
		sxmo_daemons.sh start statusbar_xsetroot sxmo_status_xsetroot.sh
		;;
esac

if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
	sxmo_daemons.sh start mmsd mmsdtng "$SXMO_MMSD_ARGS"
fi

if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
	sxmo_daemons.sh start vvmd vvmd "$SXMO_VVMD_ARGS"
fi

# Start the desktop widget (e.g. clock)
sxmo_daemons.sh start desktop_widget sxmo_hooks.sh desktop_widget

# Periodically update some status bar components
sxmo_daemons.sh start statusbar_periodics sxmo_hooks.sh statusbar_periodics

# It watch network changes and update the status bar icon by example
sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh

# The daemon that display notifications popup messages
sxmo_daemons.sh start notification_monitor sxmo_notificationmonitor.sh

# To setup initial lock state
sxmo_screenlock.sh unlock

# Verify modemmanager and eg25-manager are running
if ! sxmo_modemdaemons.sh status; then
	sxmo_notify_user.sh --urgency=critical "Warning! Modem daemons are not running."
else
	# Turn on the dbus-monitors for modem-related tasks
	sxmo_daemons.sh start modem_monitor sxmo_modemmonitor.sh

	# Prevent crust for 120s if this is a reboot (uptime < 3mins)
	if [ "$(cut -d '.' -f1 < /proc/uptime)" -lt 180 ]; then
		sxmo_daemons.sh start modem_nocrust sleep 120
	fi
fi

if ls "$XDG_CONFIG_HOME"/sxmo.old-* 1> /dev/null 2>&1; then
	sxmo_notify_user.sh --urgency=critical "Config has been migrated" "Your configs are out of date - using defaults."
fi