USB connection notifications added.
This commit is contained in:
1 parent
4f4c397970
commit
c4e572b857
5 files changed
+297
No files matched your search
@@ -260,6 +260,7 @@ set_default_configuration() {
|
||||
brlapi=0
|
||||
fi
|
||||
sounds=0
|
||||
usbNotifications=0
|
||||
screenlockMethod="none"
|
||||
screenlockPinHash=""
|
||||
screenlockAutolockSeconds=0
|
||||
@@ -536,6 +537,7 @@ dex="$dex"
|
||||
batteryAlert="${batteryAlert:-1}"
|
||||
brlapi="$brlapi"
|
||||
sounds="$sounds"
|
||||
usbNotifications="${usbNotifications:-1}"
|
||||
|
||||
# Screen lock
|
||||
screenlockMethod="${screenlockMethod:-none}"
|
||||
@@ -1066,6 +1068,14 @@ if [[ -z "$sounds" ]]; then
|
||||
sounds=1
|
||||
fi
|
||||
fi
|
||||
if [[ -z "$usbNotifications" ]]; then
|
||||
configChanged=1
|
||||
if yesno "Do you want USB connection sounds and spoken device names? Requires python-pyudev, sox for sounds, and speech-dispatcher for announcements."; then
|
||||
usbNotifications=0
|
||||
else
|
||||
usbNotifications=1
|
||||
fi
|
||||
fi
|
||||
if [[ $defaultConfig -eq 0 && -z "$screenlockPinHash" ]]; then
|
||||
screenlockPinFile="${i3Path}/.screenpin"
|
||||
if [[ -f "$screenlockPinFile" ]]; then
|
||||
@@ -1575,6 +1585,9 @@ cat << EOF >> "${i3Path}/config"
|
||||
$(if [[ $sounds -eq 0 ]]; then
|
||||
echo "exec_always --no-startup-id ${i3Path}/scripts/sound.py"
|
||||
fi
|
||||
if [[ ${usbNotifications:-1} -eq 0 ]]; then
|
||||
echo "exec_always --no-startup-id python3 \"${i3Path}/scripts/usb_notifications.py\""
|
||||
fi
|
||||
if command -v xrdb &> /dev/null; then
|
||||
echo "exec --no-startup-id xrdb -merge ${i3Path}/I38.Xresources"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user