Call common script, moved icons to common script, removed unnecessary aliases from common (let's add them only when there are conflicts), made sure plays along with shellcheck

master
Maarten van Gompel 4 years ago
parent 32c4cb6682
commit f4ba3978c9
  1. 10
      scripts/core/sxmo_appmenu.sh
  2. 495
      scripts/core/sxmo_common.sh
  3. 96
      scripts/core/sxmo_icons.sh
  4. 9
      scripts/modem/sxmo_modemcall.sh
  5. 6
      scripts/modem/sxmo_modemlog.sh
  6. 7
      scripts/modem/sxmo_modemmonitor.sh
  7. 5
      scripts/modem/sxmo_modemmonitortoggle.sh
  8. 5
      scripts/modem/sxmo_modemsendsms.sh
  9. 12
      scripts/modem/sxmo_modemtext.sh
  10. 5
      scripts/notifications/sxmo_notificationmonitor.sh
  11. 7
      scripts/notifications/sxmo_notificationsmenu.sh
  12. 5
      scripts/notifications/sxmo_notificationwrite.sh

@ -1,11 +1,11 @@
#!/usr/bin/env sh #!/usr/bin/env sh
trap gracefulexit INT TERM trap gracefulexit INT TERM
WIN=$(xdotool getwindowfocus)
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
DIR=$(dirname "$0") # include common definitions
# shellcheck source=./sxmo_icons.sh # shellcheck source=scripts/core/sxmo_common.sh
. "$DIR/sxmo_icons.sh" . "$(dirname "$0")/sxmo_common.sh"
WIN=$(xdotool getwindowfocus)
gracefulexit() { gracefulexit() {
echo "Gracefully exiting $0">&2 echo "Gracefully exiting $0">&2

@ -1,303 +1,206 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# This script is meant to be sourced by various sxmo scripts
# and defines some common settings
# we disable shellcheck SC2034 (variable not used)
# for all the variables we define here
# shellcheck disable=SC2034
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
# shellcheck disable=SC2034
CACHEDIR="$XDG_CACHE_HOME"/sxmo
# shellcheck disable=SC2034
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
# This script ensures all sxmo scripts are using the busybox version of # This script ensures all sxmo scripts are using the busybox version of
# coreutils rather than any other version that may be installed on the # certain coreutils rather than any other version that may be installed on the
# user's computer # user's computer
alias acpid="busybox acpid"
alias add-shell="busybox shell"
alias addgroup="busybox addgroup"
alias adduser="busybox adduser"
alias adjtimex="busybox adjtimex"
alias arch="busybox arch"
alias arp="busybox arp"
alias arping="busybox arping"
alias ash="busybox ash"
alias awk="busybox awk"
alias base64="busybox base64"
alias basename="busybox basename"
alias bbconfig="busybox bbconfig"
alias bc="busybox bc"
alias beep="busybox beep"
alias blkdiscard="busybox blkdiscard"
alias blkid="busybox blkid"
alias blockdev="busybox blockdev"
alias brctl="busybox brctl"
alias bunzip2="busybox bunzip2"
alias bzcat="busybox bzcat"
alias bzip2="busybox bzip2"
alias cal="busybox cal"
alias cat="busybox cat"
alias chgrp="busybox chgrp"
alias chmod="busybox chmod"
alias chown="busybox chown"
alias chpasswd="busybox chpasswd"
alias chroot="busybox chroot"
alias chvt="busybox chvt"
alias cksum="busybox cksum"
alias clear="busybox clear"
alias cmp="busybox cmp"
alias comm="busybox comm"
alias cp="busybox cp"
alias cpio="busybox cpio"
alias crond="busybox crond"
alias crontab="busybox crontab"
alias cryptpw="busybox cryptpw"
alias cut="busybox cut"
alias date="busybox date"
alias dc="busybox dc"
alias dd="busybox dd"
alias deallocvt="busybox deallocvt"
alias delgroup="busybox delgroup"
alias deluser="busybox deluser"
alias depmod="busybox depmod"
alias df="busybox df"
alias diff="busybox diff"
alias dirname="busybox dirname"
alias dmesg="busybox dmesg"
alias dnsdomainname="busybox dnsdomainname"
alias dos2unix="busybox dos2unix"
alias du="busybox du"
alias dumpkmap="busybox dumpkmap"
alias echo="busybox echo"
alias ed="busybox ed"
alias egrep="busybox egrep"
alias eject="busybox eject"
alias env="busybox env"
alias ether-wake="busybox wake"
alias expand="busybox expand"
alias expr="busybox expr"
alias factor="busybox factor"
alias fallocate="busybox fallocate"
alias false="busybox false"
alias fatattr="busybox fatattr"
alias fbset="busybox fbset"
alias fbsplash="busybox fbsplash"
alias fdflush="busybox fdflush"
alias fdisk="busybox fdisk"
alias fgrep="busybox fgrep"
alias find="busybox find" alias find="busybox find"
alias findfs="busybox findfs"
alias flock="busybox flock"
alias fold="busybox fold"
alias free="busybox free"
alias fsck="busybox fsck"
alias fstrim="busybox fstrim"
alias fsync="busybox fsync"
alias fuser="busybox fuser"
alias getopt="busybox getopt"
alias getty="busybox getty"
alias grep="busybox grep"
alias groups="busybox groups"
alias gunzip="busybox gunzip"
alias gzip="busybox gzip"
alias halt="busybox halt"
alias hd="busybox hd"
alias head="busybox head"
alias hexdump="busybox hexdump"
alias hostid="busybox hostid"
alias hostname="busybox hostname"
alias hwclock="busybox hwclock"
alias id="busybox id"
alias ifconfig="busybox ifconfig"
alias ifdown="busybox ifdown"
alias ifenslave="busybox ifenslave"
alias ifup="busybox ifup"
alias init="busybox init"
alias inotifyd="busybox inotifyd"
alias insmod="busybox insmod"
alias install="busybox install"
alias ionice="busybox ionice"
alias iostat="busybox iostat"
alias ip="busybox ip"
alias ipaddr="busybox ipaddr"
alias ipcalc="busybox ipcalc"
alias ipcrm="busybox ipcrm"
alias ipcs="busybox ipcs"
alias iplink="busybox iplink"
alias ipneigh="busybox ipneigh"
alias iproute="busybox iproute"
alias iprule="busybox iprule"
alias iptunnel="busybox iptunnel"
alias kbd_mode="busybox mode"
alias kill="busybox kill"
alias killall, killall5="busybox killall5"
alias klogd="busybox klogd"
alias less="busybox less"
alias link="busybox link"
alias linux32="busybox linux32"
alias linux64="busybox linux64"
alias ln="busybox ln"
alias loadfont="busybox loadfont"
alias loadkmap="busybox loadkmap"
alias logger="busybox logger"
alias login="busybox login"
alias logread="busybox logread"
alias losetup="busybox losetup"
alias ls="busybox ls"
alias lsmod="busybox lsmod"
alias lsof="busybox lsof"
alias lsusb="busybox lsusb"
alias lzcat="busybox lzcat"
alias lzma="busybox lzma"
alias lzop="busybox lzop"
alias lzopcat="busybox lzopcat"
alias makemime="busybox makemime"
alias md5sum="busybox md5sum"
alias mdev="busybox mdev"
alias mesg="busybox mesg"
alias microcom="busybox microcom"
alias mkdir="busybox mkdir"
alias mkdosfs="busybox mkdosfs"
alias mkfifo="busybox mkfifo"
alias mkfs.vfat="busybox mkfs.vfat"
alias mknod="busybox mknod"
alias mkpasswd="busybox mkpasswd"
alias mkswap="busybox mkswap"
alias mktemp="busybox mktemp"
alias modinfo="busybox modinfo"
alias modprobe="busybox modprobe"
alias more="busybox more"
alias mount="busybox mount"
alias mountpoint="busybox mountpoint"
alias mpstat="busybox mpstat"
alias mv="busybox mv"
alias nameif="busybox nameif"
alias nanddump="busybox nanddump"
alias nandwrite="busybox nandwrite"
alias nbd-client="busybox nbd"
alias nc="busybox nc"
alias netstat="busybox netstat"
alias nice="busybox nice"
alias nl="busybox nl"
alias nmeter="busybox nmeter"
alias nohup="busybox nohup"
alias nologin="busybox nologin"
alias nproc="busybox nproc"
alias nsenter="busybox nsenter"
alias nslookup="busybox nslookup"
alias ntpd="busybox ntpd"
alias od="busybox od"
alias openvt="busybox openvt"
alias partprobe="busybox partprobe"
alias passwd="busybox passwd"
alias paste="busybox paste"
alias pgrep="busybox pgrep"
alias pidof="busybox pidof"
alias ping="busybox ping"
alias ping6="busybox ping6"
alias pipe_progress="busybox pipe"
alias pivot_root="busybox pivot"
alias pkill="busybox pkill" alias pkill="busybox pkill"
alias pmap="busybox pmap" alias pgrep="busybox pgrep"
alias poweroff="busybox poweroff"
alias printenv="busybox printenv" #this script is meant to be sourced
alias printf="busybox printf" #the glyphs are often in the private use area and
alias ps="busybox ps" #therefore require a font like those in https://github.com/ryanoasis/nerd-fonts/ for proper display
alias pscan="busybox pscan"
alias pstree="busybox pstree" # shellcheck disable=SC2034
alias pwd="busybox pwd" icon_itm="" #item (default)
alias pwdx="busybox pwdx" # shellcheck disable=SC2034
alias raidautorun="busybox raidautorun" icon_trm='' #terminal
alias rdate="busybox rdate" # shellcheck disable=SC2034
alias rdev="busybox rdev" icon_vim=''
alias readahead="busybox readahead" # shellcheck disable=SC2034
alias readlink="busybox readlink" icon_tgm='' #telegram
alias realpath="busybox realpath" # shellcheck disable=SC2034
alias reboot="busybox reboot" icon_gps='' #gps
alias reformime="busybox reformime" # shellcheck disable=SC2034
alias remove-shell="busybox remove-shell" icon_msg="" #text
alias renice="busybox renice" # shellcheck disable=SC2034
alias reset="busybox reset" icon_pwr="⏻" #power
alias resize="busybox resize" # shellcheck disable=SC2034
alias rev="busybox rev" icon_cfg="" #configuration cog
alias rfkill="busybox rfkill" # shellcheck disable=SC2034
alias rm="busybox rm" icon_cls="" #close
alias rmdir="busybox rmdir" # shellcheck disable=SC2034
alias rmmod="busybox rmmod" icon_phn="" #phone
alias route="busybox route" # shellcheck disable=SC2034
alias run-parts="busybox run" icon_dir="" #directory folder
alias sed="busybox sed" # shellcheck disable=SC2034
alias sendmail="busybox sendmail" icon_fil="" #file
alias seq="busybox seq" # shellcheck disable=SC2034
alias setconsole="busybox setconsole" icon_grd=""
alias setfont="busybox setfont" # shellcheck disable=SC2034
alias setkeycodes="busybox setkeycodes" icon_mnu=""
alias setlogcons="busybox setlogcons" # shellcheck disable=SC2034
alias setpriv="busybox setpriv" icon_cam=""
alias setserial="busybox setserial" # shellcheck disable=SC2034
alias setsid="busybox setsid" icon_net=""
alias sh="busybox sh" # shellcheck disable=SC2034
alias sha1sum="busybox sha1sum" icon_bel=""
alias sha256sum="busybox sha256sum" # shellcheck disable=SC2034
alias sha3sum="busybox sha3sum" icon_mic=""
alias sha512sum="busybox sha512sum" # shellcheck disable=SC2034
alias showkey="busybox showkey" icon_mmc=""
alias shred="busybox shred" # shellcheck disable=SC2034
alias shuf="busybox shuf" icon_mus=""
alias slattach="busybox slattach" # shellcheck disable=SC2034
alias sleep="busybox sleep" icon_mut="" #mute
alias sort="busybox sort" # shellcheck disable=SC2034
alias split="busybox split" icon_spk="" #speaker
alias stat="busybox stat" # shellcheck disable=SC2034
alias strings="busybox strings" icon_img=""
alias stty="busybox stty" # shellcheck disable=SC2034
alias su="busybox su" icon_usr=""
alias sum="busybox sum" # shellcheck disable=SC2034
alias swapoff="busybox swapoff" icon_tmr="" #timer
alias swapon="busybox swapon" # shellcheck disable=SC2034
alias switch_root="busybox switch" icon_arl=""
alias sync="busybox sync" # shellcheck disable=SC2034
alias sysctl="busybox sysctl" icon_arr=""
alias syslogd="busybox syslogd" # shellcheck disable=SC2034
alias tac="busybox tac" icon_aru=""
alias tail="busybox tail" # shellcheck disable=SC2034
alias tar="busybox tar" icon_ard=""
alias tee="busybox tee" # shellcheck disable=SC2034
alias test="busybox test" icon_ac1=""
alias time="busybox time" # shellcheck disable=SC2034
alias timeout="busybox timeout" icon_ac2=""
alias top="busybox top" # shellcheck disable=SC2034
alias touch="busybox touch" icon_ac3=""
alias tr="busybox tr" # shellcheck disable=SC2034
alias traceroute="busybox traceroute" icon_ac4=""
alias traceroute6="busybox traceroute6" # shellcheck disable=SC2034
alias true="busybox true" icon_mov=""
alias truncate="busybox truncate" # shellcheck disable=SC2034
alias tty="busybox tty" icon_shr="" #shrink
alias ttysize="busybox ttysize" # shellcheck disable=SC2034
alias tunctl="busybox tunctl" icon_exp="" #expand
alias udhcpc="busybox udhcpc" # shellcheck disable=SC2034
alias udhcpc6="busybox udhcpc6" icon_zmi=""
alias umount="busybox umount" # shellcheck disable=SC2034
alias uname="busybox uname" icon_zmo=""
alias unexpand="busybox unexpand" # shellcheck disable=SC2034
alias uniq="busybox uniq" icon_hom=""
alias unix2dos="busybox unix2dos" # shellcheck disable=SC2034
alias unlink="busybox unlink" icon_rld=""
alias unlzma="busybox unlzma" # shellcheck disable=SC2034
alias unlzop="busybox unlzop" icon_hdp="" #headphones
alias unshare="busybox unshare" # shellcheck disable=SC2034
alias unxz="busybox unxz" icon_lck=""
alias unzip="busybox unzip" # shellcheck disable=SC2034
alias uptime="busybox uptime" icon_rss=""
alias usleep="busybox usleep" # shellcheck disable=SC2034
alias uudecode="busybox uudecode" icon_lnk=""
alias uuencode="busybox uuencode" # shellcheck disable=SC2034
alias vconfig="busybox vconfig" icon_cpy=""
alias vi="busybox vi" # shellcheck disable=SC2034
alias vlock="busybox vlock" icon_pst=""
alias volname="busybox volname" # shellcheck disable=SC2034
alias watch="busybox watch" icon_fnd="" #search/find
alias watchdog="busybox watchdog" # shellcheck disable=SC2034
alias wc="busybox wc" icon_win="" #window
alias wget="busybox wget" # shellcheck disable=SC2034
alias which="busybox which" icon_tab=""
alias whoami="busybox whoami" # shellcheck disable=SC2034
alias whois="busybox whois" icon_flt="" #filter/pipe
alias xargs="busybox xargs" # shellcheck disable=SC2034
alias xxd="busybox xxd" icon_glb="" #globe
alias xzcat="busybox xzcat" # shellcheck disable=SC2034
alias yes="busybox yes" icon_phl="'" #phonelog
alias zca="busybox zca" # shellcheck disable=SC2034
icon_inf="" #info
# shellcheck disable=SC2034
icon_fll="" #flashlight
# shellcheck disable=SC2034
icon_clk=""
# shellcheck disable=SC2034
icon_rol="" #rotate left
# shellcheck disable=SC2034
icon_ror="" #rotate right
# shellcheck disable=SC2034
icon_upc="" #up in circle
# shellcheck disable=SC2034
icon_zzz="" #sleep/suspend/crust
# shellcheck disable=SC2034
icon_out="" #logout
# shellcheck disable=SC2034
icon_ytb="" #youtube
# shellcheck disable=SC2034
icon_wtr="" #weather
# shellcheck disable=SC2034
icon_red="" #reddit
# shellcheck disable=SC2034
icon_vid="" #video
# shellcheck disable=SC2034
icon_mvi="" #movie
# shellcheck disable=SC2034
icon_clc="" #calculator
# shellcheck disable=SC2034
icon_eml="" #email
# shellcheck disable=SC2034
icon_edt="" #editor
# shellcheck disable=SC2034
icon_ffx="" #firefox
# shellcheck disable=SC2034
icon_ffw="'" #fast forward
# shellcheck disable=SC2034
icon_fbw=""
# shellcheck disable=SC2034
icon_pau=""
# shellcheck disable=SC2034
icon_a2y="⇅"
# shellcheck disable=SC2034
icon_a2x="⇄"
# shellcheck disable=SC2034
icon_sav="" #save
# shellcheck disable=SC2034
icon_ret="" #return
# shellcheck disable=SC2034
icon_nxt="" #next
# shellcheck disable=SC2034
icon_prv="" #previous
# shellcheck disable=SC2034
icon_stp="" #stop
# shellcheck disable=SC2034
icon_sfl="" #shuffle, random
# shellcheck disable=SC2034
icon_lst="" #list
# shellcheck disable=SC2034
icon_kbd="" #keyboard
# shellcheck disable=SC2034
icon_del="﫧" #delete
# shellcheck disable=SC2034
icon_grp="" #group
# shellcheck disable=SC2034
icon_snd="" #send
# shellcheck disable=SC2034
icon_phx="" #hangup
# shellcheck disable=SC2034
icon_wn2=""
#allow the user to override icons
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/icons" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/icons"
fi

@ -1,96 +0,0 @@
#this script is meant to be sourced
#the glyphs are often in the private use area and
#therefore require a font like those in https://github.com/ryanoasis/nerd-fonts/ for proper display
if [ -z "$SXMO_NO_ICONS" ] || [ "$SXMO_NO_ICONS" -eq 0 ]; then
icon_itm="" #item (default)
icon_trm='' #terminal
icon_vim=''
icon_tgm='' #telegram
icon_gps='' #gps
icon_msg="" #text
icon_pwr="⏻" #power
icon_cfg="" #configuration cog
icon_cls="" #close
icon_phn="" #phone
icon_dir="" #directory folder
icon_fil="" #file
icon_grd=""
icon_mnu=""
icon_cam=""
icon_net=""
icon_bel=""
icon_mic=""
icon_mmc=""
icon_mus=""
icon_mut="" #mute
icon_spk="" #speaker
icon_img=""
icon_usr=""
icon_tmr="" #timer
icon_arl=""
icon_arr=""
icon_aru=""
icon_ard=""
icon_ac1=""
icon_ac2=""
icon_ac3=""
icon_ac4=""
icon_mov=""
icon_shr="" #shrink
icon_exp="" #expand
icon_zmi=""
icon_zmo=""
icon_hom=""
icon_rld=""
icon_hdp="" #headphones
icon_lck=""
icon_rss=""
icon_lnk=""
icon_cpy=""
icon_pst=""
icon_fnd="" #search/find
icon_win="" #window
icon_tab=""
icon_flt="" #filter/pipe
icon_glb="" #globe
icon_phl="'" #phonelog
icon_inf="" #info
icon_fll="" #flashlight
icon_clk=""
icon_rol="" #rotate left
icon_ror="" #rotate right
icon_upc="" #up in circle
icon_zzz="" #sleep/suspend/crust
icon_out="" #logout
icon_ytb="" #youtube
icon_wtr="" #weather
icon_red="" #reddit
icon_vid="" #video
icon_mvi="" #movie
icon_clc="" #calculator
icon_eml="" #email
icon_edt="" #editor
icon_ffx="" #firefox
icon_ffw="'" #fast forward
icon_fbw=""
icon_pau=""
icon_a2y="⇅"
icon_a2x="⇄"
icon_sav="" #save
icon_ret="" #return
icon_nxt="" #next
icon_prv="" #previous
icon_stp="" #stop
icon_sfl="" #shuffle, random
icon_lst="" #list
icon_kbd="" #keyboard
icon_del="﫧" #delete
icon_grp="" #group
icon_snd="" #send
icon_phx="" #hangup
icon_wn2=""
fi
#allow the user to override icons
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/icons" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/icons"
fi

@ -1,13 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
ALSASTATEFILE="$XDG_CACHE_HOME"/precall.alsa.state ALSASTATEFILE="$XDG_CACHE_HOME"/precall.alsa.state
CACHEDIR="$XDG_CACHE_HOME"/sxmo
trap "gracefulexit" INT TERM trap "gracefulexit" INT TERM
DIR=$(dirname "$0") # include common definitions
# shellcheck source=./sxmo_icons.sh # shellcheck source=scripts/core/sxmo_common.sh
. "$DIR/sxmo_icons.sh" . "$(dirname "$0")/sxmo_common.sh"
modem_n() { modem_n() {
MODEMS="$(mmcli -L)" MODEMS="$(mmcli -L)"

@ -1,3 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
st -f "Terminus-14" -e tail -n9999 -f "$LOGDIR"/modemlog.tsv st -f "Terminus-14" -e tail -n9999 -f "$LOGDIR"/modemlog.tsv

@ -1,9 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
CACHEDIR="$XDG_CACHE_HOME"/sxmo
trap "gracefulexit" INT TERM trap "gracefulexit" INT TERM
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
err() { err() {
echo "sxmo_modemmonitor: Error: $1">&2 echo "sxmo_modemmonitor: Error: $1">&2
notify-send "$1" notify-send "$1"

@ -4,13 +4,16 @@
# It optionally takes a parameter "on" or "off" # It optionally takes a parameter "on" or "off"
# forcing it to toggle only to that desired state if applicable. # forcing it to toggle only to that desired state if applicable.
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then
pgrep -f sxmo_modemmonitor.sh | grep -Ev "^${$}$" | xargs -IP kill -TERM P pgrep -f sxmo_modemmonitor.sh | grep -Ev "^${$}$" | xargs -IP kill -TERM P
elif [ "$1" != "off" ]; then elif [ "$1" != "off" ]; then
setsid -f sxmo_modemmonitor.sh & setsid -f sxmo_modemmonitor.sh &
fi fi
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
rm "$NOTIFDIR"/incomingcall* rm "$NOTIFDIR"/incomingcall*
# E.g. wait until process killed or started -- maybe there's a better way.. # E.g. wait until process killed or started -- maybe there's a better way..

@ -1,5 +1,8 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
info() { info() {
echo "$1" > /dev/stderr echo "$1" > /dev/stderr

@ -1,12 +1,12 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LOGDIR="$XDG_DATA_HOME"/sxmo/modem
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true") TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true")
DRAFT_DIR="$XDG_DATA_HOME/sxmo/modem/draft" DRAFT_DIR="$XDG_DATA_HOME/sxmo/modem/draft"
DIR=$(dirname "$0")
# shellcheck source=./sxmo_icons.sh
. "$DIR/sxmo_icons.sh"
menu() { menu() {
if [ "$TERMMODE" != "true" ]; then if [ "$TERMMODE" != "true" ]; then
"$@" "$@"
@ -17,7 +17,7 @@ menu() {
err() { err() {
echo "$1">&2 echo "$1">&2
echo "$1" | menu dmenu -fn Terminus-20 -c -l 10 echo "$1" | menu dmenu -c -l 10
kill $$ kill $$
} }

@ -1,6 +1,9 @@
#!/usr/bin/env sh #!/usr/bin/env sh
trap gracefulexit INT TERM trap gracefulexit INT TERM
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
gracefulexit() { gracefulexit() {
echo "Gracefully exiting $0" echo "Gracefully exiting $0"

@ -1,9 +1,8 @@
#!/usr/bin/env sh #!/usr/bin/env sh
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
DIR=$(dirname "$0") # include common definitions
# shellcheck source=./sxmo_icons.sh # shellcheck source=scripts/core/sxmo_common.sh
. "$DIR/sxmo_icons.sh" . "$(dirname "$0")/sxmo_common.sh"
notificationmenu() { notificationmenu() {
CHOICES="$icon_cls Close Menu\n$icon_del Clear Notifications" CHOICES="$icon_cls Close Menu\n$icon_del Clear Notifications"

@ -1,5 +1,8 @@
#!/usr/bin/env sh #!/usr/bin/env sh
NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
# Takes 4 args: # Takes 4 args:
# (1) the filepath of the notification to write (or random to generate a random id) # (1) the filepath of the notification to write (or random to generate a random id)

Loading…
Cancel
Save