init commit

This commit is contained in:
Luxferre
2026-10-19 09:23:54 +03:00
commit 6942acf5cf
307 changed files with 35003 additions and 0 deletions
@@ -0,0 +1,6 @@
#!/bin/sh
# configversion: 77910b44307f185952a7db643cc56d36
# This script is executed after the last call finished
sxmo_playerctl.sh resume_all
@@ -0,0 +1,234 @@
#!/bin/sh
# configversion: f1282bb39c782471bb788ccf8df0bb76
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck disable=SC2154
# include common definitions \
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
write_line() {
printf "%s ^ 0 ^ %s\n" "$1" "$2"
}
write_line_app() {
executable="$1"
label="$2"
command="$3"
if command -v "$executable" >/dev/null; then
write_line "$label" "$command"
fi
}
[ -n "$PLAN9" ] && write_line_app acme "$icon_edt Acme" "acme -c 1 -f $PLAN9/font/pelm/ascii.16.font"
write_line_app adventure "$icon_trm Adventure" "sxmo_terminal.sh adventure"
write_line_app aerc "$icon_eml Aerc" "sxmo_terminal.sh aerc"
write_line_app alacritty "$icon_trm Alacritty" "alacritty"
write_line_app amberol "$icon_mus Amberol" "amberol $XDG_MUSIC_DIR"
write_line_app harbour-amazfish-ui "$icon_wat Amazfish" "harbour-amazfish-ui"
write_line_app amfora "$icon_glb Amfora" "sxmo_terminal.sh amfora"
write_line_app angelfish "$icon_glb Angelfish" "angelfish"
write_line_app animatch "$icon_gam Animatch" "animatch"
write_line_app alpine "$icon_eml Alpine" "sxmo_terminal.sh alpine"
write_line_app anbox-launch "$icon_and Anbox" "anbox"
write_line_app anki "$icon_str Anki" "anki"
write_line_app audacity "$icon_mic Audacity" "audacity"
write_line_app badwolf "$icon_glb Badwolf" "badwolf"
write_line_app baobab "$icon_pie Baobab" "baobab"
write_line_app bluetuith "$icon_bth Bluetuith" "sxmo_terminal.sh bluetuith"
write_line_app calcurse "$icon_clk Calcurse" "sxmo_terminal.sh calcurse"
write_line_app celluloid "$icon_mvi Celluloid" "celluloid"
write_line_app chatty "$icon_msg Chatty" "chatty"
([ -z "$WAYLAND_DISPLAY" ] && command -v clipmenu >/dev/null) && \
write_line_app clipmenu "$icon_bok Clipmenu" "clipmenu"
write_line_app cmus "$icon_mus Cmus" "sxmo_terminal.sh cmus"
write_line_app com.github.geigi.cozy "$icon_mus Cozy" "com.github.geigi.cozy"
write_line_app cpupower-gui "$icon_cfg Cpupower-gui" "cpupower-gui"
write_line_app deja-dup "$icon_bkp Déjà Dup" "deja-dup"
write_line_app dialect "$icon_tsl Dialect" "dialect"
write_line_app dino "$icon_msg Dino" "GDK_SCALE=1 dino"
write_line_app dissent "$icon_dis Dissent" "dissent"
write_line_app dolphin "$icon_dir Dolphin" "dolphin"
write_line_app drawing "$icon_drw Drawing" "drawing"
write_line_app eartag "$icon_mus Ear Tag" "eartag"
write_line_app elinks "$icon_glb ELinks" "sxmo_terminal.sh elinks"
write_line_app emacs "$icon_ema Emacs (Terminal)" "sxmo_terminal.sh emacs -nw"
write_line_app emacs "$icon_ema Emacs (X)" "emacs"
write_line_app eog "$icon_img Eye of Gnome" "eog"
write_line_app epiphany "$icon_glb Epiphany" "epiphany"
write_line_app epy "$icon_bok Epy" "sxmo_terminal.sh epy"
write_line_app epr "$icon_bok Epr" "sxmo_terminal.sh epr"
write_line_app errands "$icon_lst Errands" "errands"
write_line_app evince "$icon_bok Evince" "evince"
write_line_app falkon "$icon_flk Falkon" "falkon"
write_line_app file-roller "$icon_zip File Roller" "file-roller"
write_line_app firefox "$icon_ffx Firefox" "firefox"
write_line_app firefox-esr "$icon_ffx Firefox ESR" "firefox-esr"
write_line_app flare "$icon_msg Flare" "flare"
write_line_app flowtime "$icon_hrg Flowtime" "flowtime"
write_line_app foliate "$icon_bok Foliate" "foliate"
( [ -n "$WAYLAND_DISPLAY" ] && command -v foot >/dev/null) && \
write_line "$icon_trm Foot" "foot $SHELL"
write_line_app foxtrotgps "$icon_gps Foxtrotgps" "foxtrotgps"
write_line_app fractal "$icon_msg Fractal" "fractal"
write_line_app fragments "$icon_rld Fragments" "fragments"
write_line_app g4music "$icon_mus G4Music" "g4music"
write_line_app geany "$icon_edt Geany" "geany"
write_line_app geary "$icon_eml Geary" "geary"
write_line_app gedit "$icon_edt Gedit" "gedit"
write_line_app geeqie "$icon_img Geeqie" "geeqie"
write_line_app geopard "$icon_glb Geopard" "geopard"
write_line_app gerbil "$icon_glb Gerbil" "gerbil"
write_line_app giara "$icon_red Giara" "giara"
write_line_app gnome-2048 "$icon_gam Gnome 2048" "gnome-2048"
write_line_app authenticator "$icon_2fa Gnome Authenticator" "authenticator"
write_line_app gnome-calculator "$icon_clc Gnome Calculator" "gnome-calculator"
write_line_app gnome-calendar "$icon_cal Gnome Calendar" "gnome-calendar"
write_line_app gnome-calls "$icon_phn Gnome Calls" "gnome-calls"
write_line_app gnome-characters "$icon_emj Gnome Characters" "gnome-characters"
write_line_app gnome-chess "$icon_chs Gnome Chess" "gnome-chess"
write_line_app gnome-clocks "$icon_clk Gnome Clocks" "gnome-clocks"
write_line_app kgx "$icon_trm Gnome Console" "kgx"
write_line_app gnome-contacts "$icon_usr Gnome Contacts" "gnome-contacts"
write_line_app gnome-disks "$icon_dsk Gnome Disks" "gnome-disks"
write_line_app gnome-firmware "$icon_cfg Gnome Firmware" "gnome-firmware"
write_line_app gnome-font-viewer "$icon_ltr Gnome Fonts" "gnome-font-viewer"
write_line_app gnome-maps "$icon_map Gnome Maps" "gnome-maps"
write_line_app metronome "$icon_mtr Gnome Metronome" "metronome"
write_line_app gnome-podcasts "$icon_pod Gnome Podcasts" "gnome-podcasts"
write_line_app gnome-software "$icon_bag Gnome Software" "gnome-software"
write_line_app gnome-sound-recorder "$icon_mic Gnome Sound Recorder" "gnome-sound-recorder"
write_line_app gnome-sudoku "$icon_num Gnome Sudoku" "gnome-sudoku"
write_line_app gnome-taquin "$icon_pzl Gnome Taquin" "gnome-taquin"
write_line_app gnome-text-editor "$icon_edt Gnome Text Editor" "gnome-text-editor"
write_line_app gnome-weather "$icon_wtr Gnome Weather" "gnome-weather"
write_line_app gomuks "$icon_msg Gomuks" "sxmo_terminal.sh gomuks"
write_line_app gpodder "$icon_pod gPodder" "gpodder"
write_line_app gucharmap "$icon_inf Gucharmap" "gucharmap"
write_line_app hexchat "$icon_msg Hexchat" "hexchat"
write_line_app htop "$icon_spd Htop" "sxmo_terminal.sh htop"
write_line_app iamb "$icon_msg Iamb" "sxmo_terminal.sh iamb"
write_line_app irssi "$icon_msg Irssi" "sxmo_terminal.sh irssi"
write_line_app ii "$icon_msg Ii" "sxmo_terminal.sh ii"
write_line_app ipython "$icon_trm IPython" "sxmo_terminal.sh ipython"
write_line_app index "$icon_dir Index" "index"
write_line_app itinerary "$icon_map Itinerary" "itinerary"
write_line_app jami-qt "$icon_msg Jami" "jami-qt"
write_line_app kasts "$icon_pod Kasts" "kasts"
write_line_app kcalc "$icon_clc KCalc" "kcalc"
write_line_app kid3-cli "$icon_mus Kid3 Cli" "sxmo_terminal.sh kid3-cli"
write_line_app kid3-qml "$icon_mus Kid3 QML" "kid3-qml"
write_line_app kmail "$icon_eml KMail" "kmail"
write_line_app komikku "$icon_bok Komikku" "komikku"
write_line_app kontact "$icon_msg Kontact" "kontact"
write_line_app konversation "$icon_msg Konversation" "konversation"
write_line_app koreader "$icon_bok KOReader" "koreader"
write_line_app krita "$icon_img Krita" "krita --nosplash"
write_line_app kwrite "$icon_edt Kwrite" "kwrite"
write_line_app lagrange "$icon_glb Lagrange" "lagrange"
write_line_app lf "$icon_dir Lf" "sxmo_terminal.sh lf"
write_line_app librewolf "$icon_glb LibreWolf" "librewolf"
write_line_app links "$icon_glb Links" "sxmo_terminal.sh links"
write_line_app links "$icon_glb Links (GUI)" "links -g"
write_line_app org.localsend.localsend_app "$icon_fsn LocalSend" "org.localsend.localsend_app"
write_line_app lollypop "$icon_mus Lollypop" "lollypop"
write_line_app loupe "$icon_img Loupe" "loupe"
write_line_app lpa-gtk "$icon_sim Lpa Gtk" "lpa-gtk"
write_line_app luakit "$icon_glb Luakit" "luakit"
write_line_app luanti "$icon_gam Luanti" "luanti"
write_line_app marble "$icon_map Marble" "marble"
write_line_app megapixels "$icon_cam Megapixels" "megapixels"
write_line_app mepo "$icon_map Mepo" "mepo"
write_line_app micro "$icon_edt Micro" "sxmo_terminal.sh micro"
write_line_app midori "$icon_glb Midori" "midori"
write_line_app moment "$icon_msg Moment" "moment"
write_line_app mupdf "$icon_bok Mupdf" "mupdf"
write_line_app mupdf-gl "$icon_bok Mupdf-gl" "mupdf-gl"
write_line_app mutt "$icon_eml Mutt" "sxmo_terminal.sh mutt"
write_line_app mumble "$icon_grp Mumble" mumble
write_line_app nano "$icon_edt Nano" "sxmo_terminal.sh nano"
write_line_app nautilus "$icon_dir Nautilus" "nautilus"
write_line_app navit "$icon_gps Navit" "navit"
write_line_app ncmpcpp "$icon_mus Ncmpcpp" "sxmo_terminal.sh ncmpcpp"
write_line_app neomutt "$icon_eml Neomutt" "sxmo_terminal.sh neomutt"
write_line_app nethack "$icon_trm Nethack" "sxmo_terminal.sh nethack"
write_line_app nheko "$icon_msg Nheko" "nheko"
write_line_app nvim "$icon_nvi Neovim" "sxmo_terminal.sh nvim"
write_line_app netsurf "$icon_glb Netsurf" "netsurf"
write_line_app newsboat "$icon_rss Newsboat" "sxmo_terminal.sh newsboat"
write_line_app com.gitlab.newsflash "$icon_rss Newsflash" com.gitlab.newsflash
write_line_app newsraft "$icon_rss Newsraft" "sxmo_terminal.sh newsraft"
write_line_app nnn "$icon_dir Nnn" "sxmo_terminal.sh nnn"
write_line_app numberstation "$icon_2fa Numberstation" "numberstation"
write_line_app nyxt "$icon_glb Nyxt" "nyxt"
write_line_app offpunk "$icon_glb Offpunk" "sxmo_terminal.sh offpunk"
write_line_app onboard-settings "$icon_cfg Onboard Settings" onboard-settings
write_line_app osmin "$icon_map Osmin" "osmin"
write_line_app papers "$icon_bok Papers" "papers"
write_line_app passes "$icon_psp Passes" "passes"
write_line_app pavucontrol "$icon_mus Pavucontrol" "pavucontrol"
write_line_app pidgin "$icon_msg Pidgin" "pidgin"
write_line_app tubefeeder "$icon_mvi Pipeline" "tubefeeder"
write_line_app podboat "$icon_pod Podboat" "sxmo_terminal.sh podboat"
write_line_app polari "$icon_msg Polari" "polari"
write_line_app dev.tchx84.Portfolio "$icon_dir Portfolio" "dev.tchx84.Portfolio"
write_line_app profanity "$icon_msg Profanity" "sxmo_terminal.sh profanity"
write_line_app ptyxis "$icon_trm Ptyxis" "ptyxis"
write_line_app pulsemixer "$icon_mus Pulsemixer" "sxmo_terminal.sh pulsemixer"
write_line_app pure-maps "$icon_map Pure Maps" "pure-maps"
write_line_app qalc "$icon_clc Qalc" "sxmo_terminal.sh qalc"
write_line_app qutebrowser "$icon_glb Qutebrowser" "qutebrowser"
write_line_app radio-cli "$icon_rad Radio Cli" "sxmo_terminal.sh radio-cli"
write_line_app railway "$icon_trn Railway" "railway"
write_line_app ranger "$icon_dir Ranger" "sxmo_terminal.sh ranger"
write_line_app resources "$icon_spd Resources" "resources"
write_line_app sacc "$icon_glb Sacc" "sxmo_terminal.sh sacc i-logout.cz/1/bongusta"
write_line_app secrets "$icon_lck Secrets" "secrets"
write_line_app screen "$icon_msg Screen" "sxmo_terminal.sh screen"
write_line_app seahorse "$icon_key Seahorse" "seahorse"
write_line_app senpai "$icon_msg Senpai" "sxmo_terminal.sh senpai"
write_line_app shortwave "$icon_rad Shortwave" "shortwave"
write_line_app sic "$icon_msg Sic" "sxmo_terminal.sh sic"
write_line_app siglo "$icon_clk Siglo" "siglo"
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
write_line_app solanum "$icon_pom Solanum" "solanum"
([ -z "$WAYLAND_DISPLAY" ] && command -v st >/dev/null) && \
write_line "$icon_trm St" "st -e $SHELL"
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
write_line_app surf "$icon_glb Surf" "surf"
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
write_line_app syncthing-gtk "$icon_rld Syncthing GTK" "syncthing-gtk"
([ -z "$WAYLAND_DISPLAY" ] && command -v tabbed >/dev/null) && \
write_line_app tabbed "$icon_grd Tabbed" "sxmo_tabbed.sh"
write_line_app telegram-desktop "$icon_tgm Telegram" "telegram-desktop"
write_line_app termite "$icon_trm Termite" "termite -e $SHELL"
write_line_app thunar "$icon_dir Thunar" "sxmo_terminal.sh thunar"
write_line_app thunderbird "$icon_thu Thunderbird" "thunderbird"
write_line_app tilix "$icon_trm Tilix" "tilix"
write_line_app com.github.bleakgrey.tootle "$icon_msg Tootle" "com.github.bleakgrey.tootle"
write_line_app re.sonny.Tangram "$icon_glb Tangram" "re.sonny.Tangram"
write_line_app totem "$icon_mvi Totem" "totem"
write_line_app dev.geopjr.Tuba "$icon_msg Tuba" "dev.geopjr.Tuba"
write_line_app tuir "$icon_red Tuir" "sxmo_terminal.sh tuir"
write_line_app tut "$icon_msg Tut" "sxmo_terminal.sh tut"
write_line_app warp "$icon_fsn Warp" "warp"
write_line_app waydroid "$icon_and Waydroid" "waydroid show-full-ui"
write_line_app weechat "$icon_msg Weechat" "sxmo_terminal.sh weechat"
write_line_app wike "$icon_bok Wike" "wike"
write_line_app w3m "$icon_glb W3m" "sxmo_terminal.sh w3m duck.com"
write_line_app vim "$icon_vim Vim" "sxmo_terminal.sh vim"
write_line_app vimb "$icon_glb Vimb" "vimb"
write_line_app vimb "$icon_glb Vimb (Incognito)" "vimb -i"
write_line_app vis "$icon_vim Vis" "sxmo_terminal.sh vis"
write_line_app vlc "$icon_vlc Vlc" "vlc"
write_line_app vte-2.91 "$icon_trm VTE 3" "vte-2.91"
write_line_app vte-2.91-gtk4 "$icon_trm VTE 3 (GTK-4)" "vte-2.91-gtk4"
([ -z "$WAYLAND_DISPLAY" ] && command -v xcalc >/dev/null) && \
write_line "$icon_clc Xcalc" "xcalc"
write_line_app xfce4-terminal "$icon_trm XFCE4 Terminal" "xfce4-terminal"
write_line_app xournal "$icon_bok Xournal" "xournal"
write_line_app xournalpp "$icon_bok Xournalpp" "xournalpp"
write_line_app zapzap "$icon_wap ZapZap" "zapzap"
write_line_app zathura "$icon_bok Zathura" "zathura"
@@ -0,0 +1,52 @@
#!/bin/sh
# configversion: d031535bc22ba19d69704317b8d50560
load_data() {
data="$(upower -i "$1" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
}
data_get() {
printf "%b" "$data" | grep "^$1:" | cut -d: -f2
}
SET_LED_PATH="$XDG_RUNTIME_DIR/sxmo_hook_battery_set_led"
device_changed() {
name="$(data_get "native-path")"
state="$(data_get "state")"
percentage="$(data_get "percentage" | cut -d% -f1)"
if [ -z "$name" ] || [ -z "$state" ]; then
return
fi
if [ "$state" = unknown ]; then
return
fi
if [ "$percentage" -lt 25 ] && [ ! -f "$SET_LED_PATH" ]; then
touch "$SET_LED_PATH"
sxmo_led.sh set red 100
elif [ -f "$SET_LED_PATH" ]; then
rm "$SET_LED_PATH"
sxmo_led.sh set red 0
fi
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
}
object="$1"
event="$2"
load_data "$object"
if [ "$type" != "battery" ]; then
exit
fi
case "$event" in
"device changed")
device_changed "$object"
;;
esac
@@ -0,0 +1,9 @@
#!/bin/sh
# configversion: 4408f29a464ab22d7c978fa0475cf80e
# This hook is executed to check if a call should be blocked
# If the hook return 0 the call will be blocked
INCOMINGNUMBER="$1"
cut -f1 "$SXMO_BLOCKFILE" 2>/dev/null | grep -q "^$INCOMINGNUMBER$"
@@ -0,0 +1,102 @@
#!/bin/sh
# configversion: 44e4686f5216b279ed5ec39f70e270c7
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This hook checks for tasks that should block suspend, but don't report it to
# the wakelock system we use. When it exits it means the system can suspend.
#
# A check consists of two components:
# - How to check if it is active (blocking suspend)
# - Optionally, how to wait for the next check. Currently the only implemented
# method is exponential backoff (called delay) which is the default if none
# is provided.
#
# NOTE: If you're trying to extend this hook, skip to the while loop at the bottom
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Basic exponential backoff, this should save some resources if we're blocked by
# the same thing for a while
delay() {
sleep "$delay_time"
delay_time="$((delay_time*2))"
if [ "$delay_time" -gt 45 ]; then
delay_time=45
fi
}
wait_item() {
delay_time=1
while $1 > /dev/null 2>&1; do
sxmo_log "Blocking suspend for $1"
waited=1
${2:-delay}
done
}
#
# helper functions for checking blockers
#
suspend_disabled() {
test -e "$XDG_CACHE_HOME/sxmo/sxmo.nosuspend"
}
in_call() {
pgrep -f sxmo_modemcall.sh
}
in_call_dino() {
command -v pw-link && [ -n "$(pw-link -o Dino)" ]
}
hotspot_active() {
nmcli -t c show --active | grep -q ^Hotspot
}
ssh_connected() {
netstat -tn | awk '
BEGIN { status = 1 }
$4 ~ /:22$/ { status = 0; exit }
END { exit status }
'
}
active_mosh() {
command -v mosh-server && pgrep -f mosh-server
}
active_mpc() {
if ! command -v mpc; then
return 1
fi
mpc status | grep -q '\[playing\]\|Updating'
}
playing_mpris() {
command -v playerctl && playerctl -a status | grep -q "Playing"
}
photos_processing() {
pgrep -f postprocess
}
#
# Wait for all blockers
#
while [ "$waited" != "0" ]; do
waited=0
wait_item suspend_disabled
wait_item in_call
wait_item in_call_dino
wait_item hotspot_active
wait_item ssh_connected
wait_item active_mosh
wait_item active_mpc
wait_item playing_mpris
wait_item photos_processing
done
@@ -0,0 +1,843 @@
#!/bin/sh
# configversion: 8ab90a06ea6971affb4f1854b3361e09
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script will output the content of the contextual menu
# It should stdout the title as the first line followed by the entries
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
WMCLASS="$1"
WMNAME="$2"
superd_service_isrunning() {
superctl status "$1" | grep -q started
}
sxmo_service_isrunning() {
sxmo_jobs.sh running "$1" -q
}
case "$WMCLASS" in
scripts)
# Scripts menu
CHOICES="$(sxmo_hook_scripts.sh)"
WINNAME=Scripts
;;
applications)
# Apps menu
CHOICES="$(sxmo_hook_apps.sh)"
WINNAME=Apps
;;
modem)
# modem related
CHOICES="
$icon_plk Modem PIN ^ 0 ^ sxmo_unlocksim.sh
$icon_phn Modem Monitor $(
superd_service_isrunning sxmo_modemmonitor &&
printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
) && sxmo_hook_statusbar.sh modem
$icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem
$icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh
$icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh
$icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh
$icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh
"
WINNAME=Modem
;;
config)
# System Control menu
CHOICES="
$icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up
$icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down
$icon_cfg Touch $(
sxmo_wm.sh inputevent touchscreen | grep -q on && \
printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
)
$icon_cfg Stylus $(
sxmo_wm.sh inputevent stylus | grep -q on && \
printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
)
$icon_cfg Gestures $(
superd_service_isrunning "sxmo_hook_lisgd" &&
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
$icon_bth Bluetooth $(
rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
printf %b "$icon_ton" || printf %b "$icon_tof";
printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
)
$(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
$icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh
$icon_zzz Auto-suspend $(
[ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)
$icon_zzz Auto-screen-off $(
[ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_state.sh set unlock
$icon_ror Autorotate $(
sxmo_jobs.sh running autorotate -q &&
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh
$([ -n "$SXMO_KEYBOARD_SLIDER_EVENT_DEVICE" ] && echo "$icon_ror Autorotate on Keyboard Open/Close $(
sxmo_jobs.sh running kb_autorotate -q &&
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
) ^ 1 ^ toggle_daemon 'Keyboard Autorotate' kb_autorotate sxmo_keyboard_autorotate.sh")
$icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate
$icon_brightness Adaptive Brightness $(
superd_service_isrunning sxmo_adaptivebrightness &&
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
) ^ 1 ^ supertoggle_daemon sxmo_adaptivebrightness
$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
$icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh
$icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh
$(sxmo_wm.sh configmenuentry)
$(command -v pmos-tweaks >/dev/null && echo "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_debug_suspend.sh
$icon_inf Log ^ 0 ^ sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
"
WINNAME=Config
;;
power)
# Power menu
CHOICES="
$icon_lck Lock ^ 0 ^ sxmo_state.sh set lock
$icon_lck Lock (Screen off) ^ 0 ^ sxmo_state.sh set screenoff
$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
$icon_rol Switch WM ^ 0 ^ sxmo_power.sh togglewm
$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
"
WINNAME=Power
;;
*mpv*)
# MPV
CHOICES="
$icon_pau Pause ^ 0 ^ sxmo_type -k Space
$icon_fbw Seek ^ 1 ^ sxmo_type -k Left
$icon_ffw Seek ^ 1 ^ sxmo_type -k Right
$icon_aru App Volume Up ^ 1 ^ sxmo_type 0
$icon_ard App Volume Down ^ 1 ^ sxmo_type 9
$icon_aru Speed up ^ 1 ^ sxmo_type -k bracketRight
$icon_ard Speed down ^ 1 ^ sxmo_type -k bracketLeft
$icon_cam Screenshot ^ 1 ^ sxmo_type s
$icon_itm Loopmark ^ 1 ^ sxmo_type l
$icon_inf Info ^ 1 ^ sxmo_type i
$icon_inf Seek Info ^ 1 ^ sxmo_type o
"
WINNAME=Mpv
;;
io.bassi.amberol)
CHOICES="
$icon_pau Play/Pause ^ 0 ^ playerctl play-pause
$icon_prv Previous Track ^ 1 ^ playerctl previous
$icon_nxt Next Track ^ 1 ^ playerctl next
"
WINNAME=Amberol
;;
*feh*)
# Feh
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Space
$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k up
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k down
$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash
$icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'
$icon_rol Rotate ^ 1 ^ sxmo_type -k less
$icon_ror Rotate ^ 1 ^ sxmo_type -k greater
$icon_a2y Flip ^ 1 ^ sxmo_type -k underscore
$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
$icon_inf Toggle filename ^ 1 ^ sxmo_type d
"
WINNAME=Feh
;;
*sxiv*)
# Sxiv
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Space
$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
$icon_rol Rotate ^ 1 ^ sxmo_type -k less
$icon_ror Rotate ^ 1 ^ sxmo_type -k greater
$icon_a2y Flip ^ 1 ^ sxmo_type -k question
$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
$icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return
"
WINNAME=Sxiv
;;
*imv*)
# imv
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Right
$icon_arl Previous ^ 1 ^ sxmo_type -k Left
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k i
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r
$icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r
$icon_inf Toggle filename ^ 1 ^ sxmo_type -k d
"
WINNAME=Imv
;;
*kasts*)
CHOICES="
$icon_mus Audio ^ 0 ^ sxmo_audio.sh
$icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh
"
WINNAME="Kasts"
;;
*sthotkeys*)
# St hotkeys
CHOICES="
Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c
Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z
Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l
Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d
Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a
Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b
Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return
Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return
Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return
"
WINNAME=St
;;
*foot*|st|st-*|*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4|*alacritty*)
# These git commands only launch the editor.
case "$WMNAME" in
*"git add"*|*"git bugreport"*|*"git commit"*|*"git merge"*|*"git notes"*|*"git rebase"*|*"git replace"*|*"git send-email"*|*"git svn"*)
WMNAME="$WMCLASS $EDITOR"
;;
esac
# First we try to handle the app running inside the terminal:
case " $WMNAME " in
*" vi "*|*" vim "*|*" vis "*|*" nvim "*|*neovim*|*kakoune*)
#Vim in foot
CHOICES="
$icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return
$icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return
$icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d
$icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'
$icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p
$icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p
$icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /
$icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return
$icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Vim
;;
*nano*)
#Nano in foot
CHOICES="
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o
$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u
$icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Nano
;;
*micro*)
#Micro
CHOICES="
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt
$icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt
$icon_sav Save ^ 1 ^ sxmo_type -M Ctrl s -m Ctrl
$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl q -m Ctrl
$icon_fnd Find ^ 0 ^ sxmo_type -M Ctrl f -m Ctrl
$icon_fnd Find Previous ^ 1 ^ sxmo_type -M Ctrl p -m Ctrl
$icon_fnd Find Next ^ 1 ^ sxmo_type -M Ctrl n -m Ctrl
$icon_trm Command Bar ^ 0 ^ sxmo_type -M Ctrl e -m Ctrl
$icon_cpy Copy ^ 0 ^ sxmo_type -M Ctrl c -m Ctrl
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v -m Ctrl
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Micro
;;
*tuir*)
#tuir (reddit client) in foot
CHOICES="
$icon_aru Previous ^ 1 ^ sxmo_type k
$icon_ard Next ^ 1 ^ sxmo_type j
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_ret Open ^ 0 ^ sxmo_type o
$icon_arl Back ^ 0 ^ sxmo_type h
$icon_arr Comments ^ 0 ^ sxmo_type l
$icon_edt Post ^ 0 ^ sxmo_type c
$icon_rld Refresh ^ 0 ^ sxmo_type r
$icon_cls Quit ^ 0 ^ sxmo_type q
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=tuir
;;
*w3m*)
#w3m
CHOICES="
$icon_arl Back ^ 1 ^ sxmo_type b
$icon_glb Goto URL ^ 1 ^ sxmo_type u
$icon_arr Next Link ^ 1 ^ sxmo_type -k Tab
$icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab
$icon_tab Open tab ^ 0 ^ sxmo_type t
$icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q
$icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight
$icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=w3m
;;
*ncmpcpp*)
#ncmpcpp
CHOICES="
$icon_lst Playlist ^ 0 ^ sxmo_type 1
$icon_fnd Browser ^ 0 ^ sxmo_type 2
$icon_fnd Search ^ 0 ^ sxmo_type 3
$icon_nxt Next track ^ 0 ^ sxmo_type -k greater
$icon_prv Previous track ^ 0 ^ sxmo_type -k less
$icon_pau Pause ^ 0 ^ sxmo_type p
$icon_stp Stop ^ 0 ^ sxmo_type s
$icon_rld Toggle repeat ^ 0 ^ sxmo_type r
$icon_sfl Toggle random ^ 0 ^ sxmo_type z
$icon_itm Toggle consume ^ 0 ^ sxmo_type R
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=ncmpcpp
;;
*aerc*)
#aerc
CHOICES="
$icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return
$icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return
$icon_prv Previous Tab ^ 0 ^ sxmo_type ':prev-tab' -k Return
$icon_cls Close Tab ^ 0 ^ sxmo_type ':close' -k Return
$icon_itm Next Part ^ 1 ^ sxmo_type ':next-part' -k Return
$icon_trm xdg-open Part ^ 0 ^ sxmo_type ':open' -k Return
"
WINNAME=aerc
;;
*less*|*"git blame"*|*"git diff"*|*"git grep"*|*"git help"*|*"git log"*|*"git stash"*|*"git tag"*|*"git var"*)
#less
CHOICES="
$icon_arr Page next ^ 1 ^ sxmo_type ':n' -k Return
$icon_arl Page previous ^ 1 ^ sxmo_type ':p' -k Return
$icon_cls Quit ^ 0 ^ sxmo_type q
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=less
;;
*git*)
# git am, branch, config, tag (and other commands which launch both).
CHOICES="
$icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS '${PAGER:-less}'
$icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS '$EDITOR'
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=git
;;
*senpai*)
CHOICES="
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_ac1 Previous Buffer ^ 1 ^ sxmo_type -M Alt -k Left
$icon_ac4 Next Buffer ^ 1 ^ sxmo_type -M Alt -k Right
$icon_lst Toggle Channels ^ 0 ^ sxmo_type -k F7
$icon_usr Toggle Members ^ 0 ^ sxmo_type -k F8
"
WINNAME=senpai
;;
*weechat*)
#weechat
CHOICES="
$icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a
$icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less
$icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater
$icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=weechat
;;
*" sms "*|*"missed call"*)
number="$(printf "%s\n" "$WMNAME" | xargs -0 pnc find | tr -d '\n')"
#sms
CHOICES="
$icon_msg Conversation ^ 0 ^ sxmo_terminal.sh sxmo_modemtext.sh conversationloop $number
$icon_msg Reply ^ 0 ^ sxmo_modemtext.sh sendtextmenu $number
$icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number
$([ -d "$SXMO_LOGDIR/$number/attachments" ] && echo "$icon_att View Attachments ^ 1 ^ sxmo_files.sh $SXMO_LOGDIR/$number/attachments --date-sort")
$(
found_numbers="$(printf %s "$number" | xargs -I{} pnc find "{}")"
printf "%s\n" "$found_numbers" | while read -r line; do
sxmo_contacts.sh --name "$line" | grep -q '???' && echo "$icon_usr Add $line ^ 1 ^ sxmo_contactmenu.sh newcontact $line"
done
# if this is a group chain, then allow to add entire chain as a contact too
if [ "$(printf "%s\n" "$found_numbers" | wc -l)" -gt 1 ]; then
sxmo_contacts.sh --name "$number" | grep -q '???' && echo "$icon_usr Add $number ^ 1 ^ sxmo_contactmenu.sh newcontact $number"
fi
)
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -M Ctrl b
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -M Ctrl f
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=phone
;;
*cmus*)
# cmus
# requires `:set set_term_title=false` in cmus to match the application
CHOICES="
$icon_itm Play ^ 0 ^ cmus-remote -p
$icon_pau Pause ^ 0 ^ cmus-remote -u
$icon_stp Stop ^ 0 ^ cmus-remote -s
$icon_nxt Next track ^ 0 ^ cmus-remote -n
$icon_prv Previous track ^ 0 ^ cmus-remote -r
$icon_rld Toggle repeat ^ 0 ^ cmus-remote -R
$icon_sfl Toggle random ^ 0 ^ cmus-remote -S
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=cmus
;;
*iamb*)
CHOICES="
$icon_aru Page Up ^ 1 ^ sxmo_type.sh -k Escape -M Ctrl -k b
$icon_tab Toggle Selection ^ 0 ^ sxmo_type.sh -k Escape -M Ctrl -k W m
$icon_ard Page Down ^ 1 ^ sxmo_type.sh -k Escape -M Ctrl -k f
$icon_ret Reply To Message ^ 0 ^ sxmo_type.sh -k Escape :reply -k Return
$icon_tab New Tab ^ 0 ^ sxmo_type.sh -k Escape :tab rooms -k Return
$icon_arl Previous Tab ^ 0 ^ sxmo_type.sh -k Escape :tabp -k Return
$icon_arr Next Tab ^ 0 ^ sxmo_type.sh -k Escape :tabn -k Return
$icon_cls Close Tab ^ 0 ^ sxmo_type.sh -k Escape :tabclose -k Return
$icon_win Split View ^ 0 ^ sxmo_type.sh -k Escape :split -k Return
$icon_win Split View Vertical ^ 0 ^ sxmo_type.sh -k Escape :vsplit -k Return
$icon_msg All Chats ^ 0 ^ sxmo_type.sh -k Escape :chats -k Return
$icon_msg Direct Messages ^ 0 ^ sxmo_type.sh -k Escape :dms -k Return
$icon_grp Rooms ^ 0 ^ sxmo_type.sh -k Escape :rooms -k Return
$icon_glb Spaces ^ 0 ^ sxmo_type.sh -k Escape :spaces -k Return
$icon_sav Download ^ 0 ^ sxmo_type.sh -k Escape :download -k Return
$icon_cls Close View/Quit ^ 0 ^ sxmo_type.sh -k Escape :quit -k Return
"
WINNAME=iamb
;;
*)
# Now we fallback to the default terminal menu
case "$WMCLASS" in
st|st-*)
CHOICES="
$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
$icon_itm Toggle Selmode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k s
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
$icon_cpy Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f
$icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x
$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
"
WINNAME=St
;;
*foot*)
CHOICES="
$icon_win Next Window ^ 0 ^ swaymsg focus next
$icon_rld Toggle Layout ^ 0 ^ sxmo_wm.sh togglelayout
$icon_mnu Tile Vertical ^ 0 ^ swaymsg layout splitv && swaymsg splitv
$icon_grd Tile Horizontal ^ 0 ^ swaymsg layout splith && swaymsg splith
$icon_trm New Terminal ^ 0 ^ sxmo_terminal.sh
$icon_cls Close Terminal ^ 0 ^ sxmo_killwindow.sh
$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
$icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
$icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
$icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
$icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
$icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
"
WINNAME=Foot
;;
*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4)
CHOICES="$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
WINNAME=Terminal
;;
*alacritty*)
CHOICES="
$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
$icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space
$icon_fnd Search Forward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k f
$icon_fnd Search Backward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k b
$icon_aru Search Previous ^ 0 ^ sxmo_type -k Enter
$icon_ard Search Next ^ 0 ^ sxmo_type -M Shift -k Enter
$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
"
WINNAME=Alacritty
;;
esac
esac
;;
*okular*)
# Okular
CHOICES="
$icon_cfg Touch $(
sxmo_wm.sh inputevent touchscreen | grep -q on && \
printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
)
$icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F
$icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M
$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7
$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
"
WINNAME=Xournal
;;
*xournal*)
# Xournalpp
CHOICES="
$icon_cfg Touch $(
sxmo_wm.sh inputevent touchscreen | grep -q on && \
printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
)
$icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus
$icon_zmi Next Page ^ 1 ^ sxmo_type -k Next
$icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior
$icon_cfg Menubar ^ 0 ^ sxmo_type -k F10
$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9
$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
"
WINNAME=Xournal
;;
*zathura*)
# Zathura
CHOICES="
$icon_flt Open ^ 0 ^ sxmo_type -k o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i
$icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r
$icon_flt Index ^ 0 ^ sxmo_type -k Tab
$icon_cfg Fit ^ 0 ^ sxmo_type -k a
$icon_cfg Width mode ^ 0 ^ sxmo_type -k s
"
WINNAME=Zathura
;;
*netsurf*)
# Netsurf
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_lnk Enter URL ^ 0 ^ sxmo_type.sh -M Ctrl -k l
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
"
WINNAME=Netsurf
;;
*surf*)
# Surf
CHOICES="
$icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g
$icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f
$icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j
$icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space
$icon_ard Scroll ^ 1 ^ sxmo_type -k Space
$icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl h
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl l
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Surf
;;
*falkon*)
# Falkon
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Falkon
;;
*firefox*|*navigator*)
# Firefox
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Firefox
;;
*krita*)
# Krita
CHOICES="
$icon_fnd Open ^ 0 ^ sxmo_type -M Ctrl o
$icon_sav Save ^ 0 ^ sxmo_type -M Ctrl s
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v
$icon_del Delete ^ 0 ^ sxmo_type -k Delete
$icon_win Select ^ 0 ^ sxmo_type -M Ctrl r
$icon_modem_disabled Deselect ^ 0 ^ sxmo_type -M Ctrl -M Shift a
$icon_wn2 Crop ^ 0 ^ sxmo_type c
$icon_flt Fill ^ 0 ^ sxmo_type f
$icon_modem_connected Gradient ^ 0 ^ sxmo_type g
$icon_dof HSV Adjust ^ 0 ^ sxmo_type -M Ctrl u
$icon_cls Close Image ^ 0 ^ sxmo_type -M Ctrl w
"
WINNAME=Krita
;;
*vimb*)
CHOICES="
$icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi
$icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl o
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl i
$icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r
"
WINNAME=Vimb
;;
*geopard*)
# Geopard
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
$icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b
$icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d
$icon_edt Edit Bookmarks ^ 0 ^ sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini
$icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right
$icon_fnd URL Bar ^ 0 ^ sxmo_type -k F6
$icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return
"
WINNAME=Geopard
;;
*lagrange*)
# Lagrange
CHOICES="
$icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p
$icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return
$icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r
"
WINNAME=Lagrange
;;
org.gnome.maps)
CHOICES="
$icon_gps Toggle Geoclue ^ 0 ^ superctl status geoclue-agent |grep started >/dev/null && superctl stop geoclue-agent || superctl start geoclue-agent
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M ctrl =
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M ctrl -k minus
$icon_fnd Explore POI ^ 0 ^ sxmo_type -M ctrl -M Shift F
$icon_fnd Search ^ 0 ^ sxmo_type -M ctrl f
$icon_lst Show last results ^ 0 ^ sxmo_type -M ctrl r
$icon_map Toggle route planner ^ 0 ^ sxmo_type -M ctrl d
$icon_gps Show current location ^ 0 ^ sxmo_type -M ctrl l
"
WINNAME=Maps
;;
*mepo*)
# Mepo
# The choices / hotkeys for the contextmenu are generated through mepo's
# own scripting to be in congruence since the same menu can be launched
# via mepo's UI as well, this compatibility is available as of mepo 0.4
CHOICES="$(mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
WINNAME=Mepo
;;
*foxtrot*)
# Foxtrot GPS
CHOICES="
$icon_zmi Zoom ^ 1 ^ sxmo_type i
$icon_zmo Zoom ^ 1 ^ sxmo_type o
$icon_itm Panel Toggle ^ 1 ^ sxmo_type m
$icon_itm GPSD Toggle ^ 1 ^ sxmo_type a
"
WINNAME=Maps
;;
*badwolf*)
# Badwolf Browser
CHOICES="
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl -k t
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Alt -k d
$icon_fnd Reset Zoom ^ 0 ^ sxmo_type -M Ctrl -k 0
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl ]
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl [
$icon_arr Next Tab ^ 1 ^ sxmo_type -M Alt -k Right
$icon_arl Previous Tab ^ 1 ^ sxmo_type -M Alt -k Left
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl -k r
$icon_fnd Search ^ 0 ^ sxmo_type -M Shift -M Ctrl -k f
$icon_arr Next (Search) ^ 0 ^ sxmo_type -M Shift -M Ctrl -k g
$icon_arl Previous (Search) ^ 0 ^ sxmo_type -M Shift -M Ctrl -M Shift -k g
$icon_flt URL Bar ^ 0 ^ sxmo_type -M Shift -M Ctrl l
$icon_fnd Open Web Inspector ^ 0 ^ sxmo_type -k F12
"
WINNAME=Badwolf
;;
*acme*)
# Acme
CHOICES="
$icon_mse 2 (Right) [2s delay] ^ 0 ^ sleep 2 && xdotool click 3
$icon_mse 3 (Middle) [2s delay] ^ 0 ^ sleep 2 && xdotool click 2
$icon_itm Autocomplete ^ 0 ^ sxmo_type.sh -M Ctrl -k f
$icon_exp Select Last Typed Text ^ 0 ^ sxmo_type.sh -M Escape
$icon_del Delete To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k U
$icon_arl Move To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k A
$icon_arr Move To End Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k E
"
WINNAME=Acme
;;
*mupdf*)
# Mupdf
CHOICES="
$icon_nxt Next Page ^ 0 ^ sxmo_type -k Space
$icon_prv Previous Page ^ 0 ^ sxmo_type -k b
$icon_chk Mark Page ^ 0 ^ sxmo_type -k m
$icon_ret Pop To Last Mark ^ 0 ^ sxmo_type -k t
$icon_zmi Zoom In ^ 1 ^ sxmo_type -k +
$icon_zmo Zoom Out ^ 1 ^ sxmo_type -k -
$icon_fnd Fit Width ^ 0 ^ sxmo_type -k W
$icon_fnd Fit Height ^ 0 ^ sxmo_type -k H
$icon_fnd Zoom To Fit ^ 0 ^ sxmo_type -k Z
$icon_fnd Reset Zoom ^ 0 ^ sxmo_type -k z
$icon_rol Rotate Counterclockwise ^ 0 ^ sxmo_type -k [
$icon_ror Rotate Clockwise ^ 0 ^ sxmo_type -k ]
$icon_fnd Search ^ 0 ^ sxmo_type -k /
"
WINNAME=Mupdf
;;
*tabbed*)
# Tabbed
CHOICES="
$icon_tab New Tab ^ 0 ^ sxmo_type.sh -M Ctrl -M Shift -M Enter
$icon_arl Previous Tab ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k h
$icon_arr Next Tab ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k l
$icon_arl Move Tab Left ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k j
$icon_arr Move Tab Right ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k k
$icon_mnu Menu Prompt ^ 0 ^ sxmo_type.sh -M Ctrl -k U0060
$icon_cls Close Tab ^ 0 ^ sxmo_type.sh -M Ctrl -k q
"
WINNAME=Tabbed
;;
*links*)
# Links Browser
CHOICES="
$icon_mnu Menu ^ 0 ^ sxmo_type.sh -k Escape
$icon_ret Follow Link ^ 0 ^ sxmo_type.sh -k Enter
$icon_arl History ^ 1 ^ sxmo_type.sh -k z
$icon_arr History ^ 1 ^ sxmo_type.sh -k x
$icon_glb Enter URL ^ 0 ^ sxmo_type.sh -k g
$icon_glb Edit Current URL ^ 0 ^ sxmo_type.sh -k G
$icon_glb View Highlighted URL ^ 0 ^ sxmo_type.sh -M Ctrl -k g
$icon_cam Toggle Images ^ 0 ^ sxmo_type.sh -k U002A
$icon_aru Scroll Up ^ 1 ^ sxmo_type.sh -k p
$icon_ard Scroll Down ^ 1 ^ sxmo_type.sh -k l
$icon_arl Scroll Left ^ 1 ^ sxmo_type.sh -k U005B
$icon_arr Scroll Right ^ 1 ^ sxmo_type.sh -k U005D
"
WINNAME=Links
;;
*)
# Default system menu (no matches)
CHOICES="
$icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
$icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications
$([ "$SXMO_MENU" = "wofi" ] && echo "$icon_grd All Apps ^ 0 ^ wofi -O alphabetical -i --show drun")
$([ "$SXMO_MENU" != "wofi" ] && command -v j4-dmenu-desktop > /dev/null && echo "$icon_grd All Apps ^ 0 ^ j4-dmenu-desktop --dmenu=sxmo_dmenu.sh --term=sxmo_terminal.sh")
$icon_grd Binaries ^ 0 ^ sxmo_brun.sh
$icon_dir Files ^ 0 ^ sxmo_files.sh
$icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh
$icon_msg Texts ^ 0 ^ sxmo_modemtext.sh
$icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh
$(
rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
)
$(command -v megapixels >/dev/null && echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels")
$(
if brightness="$(brightnessctl -l -m | grep -e "white:torch" -e "white:flash" | cut -d ',' -f 3)" && [ -n "$brightness" ]; then
printf "%s Flashlight " "$icon_fll"
[ "$brightness" -gt 0 ] &&
printf %b "$icon_ton" || printf %b "$icon_tof";
printf %b "^ 1 ^ sxmo_flashtoggle.sh"
fi
)
$icon_net Networks ^ 0 ^ sxmo_networks.sh
$icon_mus Audio ^ 0 ^ sxmo_audio.sh
$icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem
$icon_win Windows ^ 0 ^ sxmo_wmmenu.sh
$icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config
$icon_inf Help ^ 0 ^ sxmo_terminal.sh man sxmo
$icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power
"
WINNAME=Sys
;;
esac
printf "%b\n" "$WINNAME"
printf "%b\n" "$CHOICES"
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: 723b508e3ab28c10933e4c7cc730fb76
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
WINNAME="$1"
CHOICE="$2"
sxmo_log "Unknown choice <$CHOICE> selected from contextmenu <$WINNAME>"
@@ -0,0 +1,39 @@
#!/bin/sh
# configversion: 010bc500cc208fefa91cc3c4f473f436
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This hook launches a desktop widget (e.g. a clock) (blocking)
# It could be used on Wayland
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
pangodraw() {
date +"<big><big><b>%H</b>:%M</big></big>" #date with some pango markup syntax (https://docs.gtk.org/Pango/pango_markup.html)
date +"<small><small>%a %d %b %Y</small></small>"
# here you can output whatever you want to end up in the widget
# make sure to use pango markup syntax if you want colours etc, ANSI is not supported by wayout
# for instance, you can show details about the activated network connections:
#nmcli -w 3 -c no -p -f DEVICE,STATE,NAME,TYPE con show | grep activated | sed 's/activated/ /' | sed '/^\s*$/d' 2> /dev/null
# make sure to end with an empty line, to denote the end of data for wayout
echo
}
trap 'kill -- $WAYOUT' TERM INT EXIT
# For wayland we use wayout:
(
sleep 1 # wayout misses output sent to it as it's starting
while : ; do
pangodraw
sxmo_aligned_sleep 60
done
) | wayout --font "Sxmo" \
--foreground-color "#ffffff" \
--fontsize "60" \
--height 500 \
--feed-par &
WAYOUT="$!"
wait
@@ -0,0 +1,9 @@
#!/bin/sh
# configversion: 70258557287cafa1a27fa6701c6583e6
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (synchronously) before you dial an outgoing call
# Pause all player automatically
sxmo_playerctl.sh pause_all
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: 01fd10d27b7d66531ea7ecb4f92ce00d
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (asynchronously) when you discard an incoming call
# i.e., click Hangup on Pickup menu when call is coming in (without picking
# up the call).
# kill existing ring playback
sxmo_jobs.sh stop ringing
sxmo_playerctl.sh resume_all
@@ -0,0 +1,4 @@
#!/bin/sh
# configversion: 226734e9b1dd5ffb1a8c45a6c88bd741
# This script is executed (asynchronously) when you hangup an incoming call
@@ -0,0 +1,254 @@
#!/bin/sh
# configversion: ab89c16587dedc087007d14790de9d5d
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# we disable shellcheck SC2034 (variable not used)
# for all the variables we define here
# shellcheck disable=SC2034
#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
# note that you should *not* use glyphs in range U+F500 - U+FD46 as these wont render.
# this is a known bug in nerdfonts: https://github.com/ryanoasis/nerd-fonts/issues/365
icon_2fa="󰦯" # authenticaton
icon_a2x="⇄"
icon_a2y="⇅"
icon_ac1="↖"
icon_ac2="↗"
icon_ac3="↘"
icon_ac4="↙"
icon_and=""
icon_ard="↓"
icon_arl="←"
icon_arr="→"
icon_aru="↑"
icon_att=""
icon_audio="♫"
icon_bag="" # shopping bag
icon_bel=""
icon_bkp="󰁯" # backup
icon_bok=""
icon_brightness="󰃝"
icon_bth="" # bluetooth
icon_cal=""
icon_cam=""
icon_cfg="" #configuration cog
icon_chk=""
icon_chs="♜" #chess
icon_clc="󰃬" #calculator
icon_clk="󰥔"
icon_cls="󰅖" #close
icon_com="" # (Laptop) Computer (💻)
icon_cpy=""
icon_del="" #delete
icon_dir="" #directory folder
icon_dis="󰙯" # discord
icon_dof="" # dot off
icon_don="" # dot on
icon_dop="" # dot point
icon_dot="󰇘" # searching, connecting, etc.
icon_drw="󰏬" # Drawing tablet
icon_dsk="󰋊" # hard disk
icon_ear="" # earpiece
icon_edt="󰎞" #editor
icon_ema="" # emacs
icon_emj="" # emoji, smiley
icon_eml="󰇮" #email
icon_exp="󰁌" #expand
icon_fbw=""
icon_ffw="" #fast forward
icon_ffx="󰈹" #firefox
icon_fil="" #file
icon_flk="" #falkon
icon_fll="󰉄" #flashlight
icon_flt="" #filter/pipe
icon_fnd="󰍉" #search/find
icon_fsn="󰈪" # file send
icon_gam="󰊴" # gaming controller (🎮)
icon_glb="" #globe
icon_gps='' #gps
icon_grd="󰀻"
icon_grp="" #group
icon_hdp="" #headphones
icon_hom=""
icon_hrg="" # hourglass
icon_hst="󰋎" #headset🗣️
icon_img="󰏜"
icon_inf="" #info
icon_itm="" #item (default)
icon_kbd="" #keyboard
icon_key=""
icon_krt="󰵹" # kart
icon_lck=""
icon_lnk=""
icon_lst="" #list
icon_ltr="󰬴" # letters
icon_map="󰍍"
icon_mdd="󰄢" # modem disabled state
icon_mic="󰍬"
icon_mmc="󰍭"
icon_mnu=""
icon_mod="" # modem
icon_mov="󰁁"
icon_mse="󰍽" # computer mouse (🖱️)
icon_msg="󰍦" #text
icon_mtr="󰟚" # metronome
icon_mus="󰎈"
icon_mut="" #mute
icon_mvi="󰎁" #movie
icon_net="󰀂"
icon_nto="" #no touch
icon_num="" # numbers
icon_nvi="" # neovim
icon_nxt="" #next
icon_out="󰍃" #logout
icon_pau=""
icon_phl="󰏹" #phonelog
icon_phn="󰏲" #phone
icon_phx="󰏵" #hangup
icon_pie="" # pie chart
icon_plk="󰏸" # phone locked
icon_pls=""
icon_pom="" # pomodoro timer
icon_pod="" # podcast
icon_prn="" # printer (🖨️)
icon_prv="" #previous
icon_psp="󰟣" # passport
icon_pst=""
icon_pwr="⏻" #power
icon_pzl="󰐱" # puzzle
icon_rad="󰐹" # radio
icon_red="" #reddit
icon_ret="󰌑" #return
icon_rld=""
icon_rol="" #rotate left
icon_ror="" #rotate right
icon_rss=""
icon_sav="󰆓" #save
icon_scn="󰚫" #scanner
icon_sfl="" #shuffle, random
icon_shr="󰁄" #shrink
icon_sim="󰒧" # sim card
icon_snd="" #send
icon_spd="󰓅" # speedometer
icon_spk="" #speaker
icon_spl=""
icon_spm=""
icon_stp="" #stop
icon_str="" #star
icon_tab=""
icon_tgm='' #telegram
icon_thu="" # thunderbird
icon_tmr="󰀠" #timer
icon_tof=""
icon_ton=""
icon_trh="" # trash
icon_trm='' #terminal
icon_trn="" # train
icon_tsl="󰗊" # translate
icon_upc="󰁠" #up in circle
icon_usb="" # usb
icon_usr="󰀄" # user, avatar
icon_vid="" #video
icon_vim=''
icon_vlc="󰕼"
icon_wap="" # whatsapp
icon_wif=""
icon_wfo="󰖪" # wifi off
icon_wfh="󰀂" # wifi hotspot
icon_win="" #window
icon_wat="" # watch (⌚)
icon_wn2=""
icon_wrh=""
icon_wtr="" #weather
icon_ytb="" #youtube
icon_zip="󰗄" # archive
icon_zmi="󰛭" # Zoom in/magnify
icon_zmo="󰛬" # Zoom out/demagnify
icon_zzz="" #sleep/suspend/crust
icon_nte=""
# modem states
icon_modem_nomodem="󰥍" # cell with x
icon_modem_locked="󰥏" # cell with lock
icon_modem_initializing="󰥑" # cell with gear
icon_modem_disabled="󰥐" # cell with slash
icon_modem_disabling="$icon_arr$icon_modem_disabled" # -> disabled
icon_modem_enabled="󱟽" # cell with check
icon_modem_enabling="$icon_arr$icon_modem_enabled" # -> enabled
icon_modem_registered="󱋘" # cell with wifi with slash
icon_modem_searching="$icon_arr$icon_modem_registered" # -> registered
icon_modem_connected="󰺐" # cell with wifi
icon_modem_connecting="$icon_aru$icon_modem_connected" # up arrow connected
icon_modem_disconnecting="$icon_ard$icon_modem_connected" # down arrow connected
icon_modem_failed="󰽁" # cell with !
# modem techs
icon_modem_fiveg="󰩯" # 5gnr
icon_modem_fourg="󰜔" # lte
icon_modem_threeg="󰜓" # a lot (see sxmo_hook_statusbar.sh)
icon_modem_hspa="󰜕" # hspa
icon_modem_hspa_plus="󰜖" # hspa plus
icon_modem_twog="󰜒" # edge, pots, gsm, gprs, etc.
icon_modem_notech="󰞃" # disabled cell bars
# modem signal strengths
icon_modem_signal_0="󰢿"
icon_modem_signal_1="󰢼"
icon_modem_signal_2="󰢽"
icon_modem_signal_3="󰢾"
# wifi signal strengths
icon_wifi_signal_exclam="󰤫"
icon_wifi_key_signal_0="󰤬"
icon_wifi_signal_0="󰤯"
icon_wifi_key_signal_1="󰤡"
icon_wifi_signal_1="󰤟"
icon_wifi_key_signal_2="󰤤"
icon_wifi_signal_2="󰤢"
icon_wifi_key_signal_3="󰤧"
icon_wifi_signal_3="󰤥"
icon_wifi_key_signal_4="󰤪"
icon_wifi_signal_4="󰤨"
icon_wifi_disconnected="󰤮"
# battery indicators
icon_bat_c_0="󰢟"
icon_bat_c_1="󱊤"
icon_bat_c_2="󱊥"
icon_bat_c_3="󰂅"
icon_bat_c_10="󰢜"
icon_bat_c_20="󰂆"
icon_bat_c_30="󰂇"
icon_bat_c_40="󰂈"
icon_bat_c_50="󰢝"
icon_bat_c_60="󰂉"
icon_bat_c_70="󰢞"
icon_bat_c_80="󰂊"
icon_bat_c_90="󰂋"
icon_bat_c_full="󰂅"
icon_bat_warning="󱃍"
icon_bat_0="󰂎"
icon_bat_1="󱊡"
icon_bat_2="󱊢"
icon_bat_3="󱊣"
icon_bat_10="󰁺"
icon_bat_20="󰁻"
icon_bat_30="󰁼"
icon_bat_40="󰁽"
icon_bat_50="󰁾"
icon_bat_60="󰁿"
icon_bat_70="󰂀"
icon_bat_80="󰂁"
icon_bat_90="󰂂"
icon_bat_full="󰁹"
# sxmo state indicators
icon_state_proximity=""
icon_state_screenoff=""
icon_state_lock=""
icon_state_unlock=""
@@ -0,0 +1,540 @@
#!/bin/sh
# configversion: 113bf453dd3310afff192d841089e5ac
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script handles input actions, it is called by lisgd for gestures
# and by dwm for button presses. Gestures are tied to actions in
# sxmo_hook_lisgdstart.sh .
ACTION="$1"
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
sxmo_debug "STATE: $(sxmo_state.sh get) ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
if sxmo_state.sh is_locked; then
case "$WMNAME" in # Handle programs
*"epy"*|*"epr"*)
case "$ACTION" in
"voldown_one")
sxmo_type.sh l
exit 0
;;
"volup_one")
sxmo_type.sh h
exit 0
;;
esac
;;
esac
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_state.sh set unlock
sxmo_wm.sh display on
;;
"voldown_one")
sxmo_audio.sh vol down 5
exit
;;
"voldown_two")
sxmo_audio.sh vol down 10
exit
;;
"voldown_three")
sxmo_audio.sh vol down 15
exit
;;
"volup_one")
sxmo_audio.sh vol up 5
exit
;;
"volup_two")
sxmo_audio.sh vol up 10
exit
;;
"volup_three")
sxmo_audio.sh vol up 15
exit
;;
esac
#we're locked, don't process the rest of the script
exit 0
fi
#special context-sensitive handling
case "$WMCLASS" in
*"mpv"*)
case "$ACTION" in
"oneright")
sxmo_type.sh -k Left
exit 0
;;
"oneleft")
sxmo_type.sh -k Right
exit 0
;;
"oneup")
sxmo_type.sh m
exit 0
;;
"onedown")
sxmo_type.sh p
exit 0
;;
esac
;;
*"acme"*)
case "$ACTION" in
"volup_one")
xdotool click 3
exit 0
;;
"voldown_one")
xdotool click 2
exit 0
;;
esac
;;
*"links"*)
case "$ACTION" in
# you're probably dragging the scrollbar
*"uprightedge") exit 0 ;;
*"downrightedge") exit 0 ;;
*"onedown")
sxmo_type.sh -M Ctrl -M Shift -k b
exit 0
;;
*"oneup")
sxmo_type.sh -M Ctrl -M Shift -k f
exit 0
;;
esac
;;
*"netsurf"*)
case "$ACTION" in
# you're probably dragging the scrollbar
*"uprightedge") exit 0 ;;
*"downrightedge") exit 0 ;;
*"onedown")
sxmo_type.sh -k Page_Up
exit 0
;;
*"oneup")
sxmo_type.sh -k Page_Down
exit 0
;;
esac
;;
*"firefox"*|*"librewolf"*)
case "$ACTION" in
# you're probably dragging the scrollbar
*"uprightedge") exit 0 ;;
*"downrightedge") exit 0 ;;
esac
;;
*"foot"*|*"st"*|*"vte"*|"terminal") # Terminals
case "$WMCLASS" in # Handle programs without touch support
*"st"*)
case "$WMNAME" in
*"weechat"*|*'gomuks'*)
case "$ACTION" in
*"onedown")
sxmo_type.sh -k Page_Up
exit 0
;;
*"oneup")
sxmo_type.sh -k Page_Down
exit 0
;;
esac
;;
*"less"*|*"amfora"*)
case "$ACTION" in
*"onedown")
sxmo_type.sh u
exit 0
;;
*"oneup")
sxmo_type.sh d
exit 0
;;
esac
;;
*'irssi'*)
case "$ACTION" in
"onedown")
sxmo_type.sh -M Alt p
exit 0
;;
"oneup")
sxmo_type.sh -M Alt n
exit 0
;;
esac
;;
*'epy'*|*'epr'*)
case "$ACTION" in
"onedown")
sxmo_type.sh h
exit 0
;;
"oneup")
sxmo_type.sh l
exit 0
;;
esac
;;
*'nnn'*|'lf')
case "$ACTION" in
"onedown")
sxmo_type.sh -k Down
exit 0
;;
"oneup")
sxmo_type.sh -k Up
exit 0
;;
esac
;;
esac
;;
esac
case "$WMNAME" in # Handle programs
*"weechat"*)
case "$ACTION" in
*"oneleft")
sxmo_type.sh -M Alt -k a
exit 0
;;
*"oneright")
sxmo_type.sh -M Alt -k less
exit 0
;;
esac
;;
*" sms")
case "$ACTION" in
*"upbottomedge")
number="$(printf %s "$WMNAME" | sed -e 's|^\"||' -e 's|\"$||' | cut -f1 -d' ')"
sxmo_terminal.sh sxmo_modemtext.sh conversationloop "$number"
exit 0
;;
esac
;;
*"tuir"*)
if [ "$ACTION" = "rightbottomedge" ]; then
sxmo_type.sh o
exit 0
elif [ "$ACTION" = "leftbottomedge" ]; then
sxmo_type.sh s
exit 0
fi
;;
*"less"*)
case "$ACTION" in
"leftbottomedge")
sxmo_type.sh q
exit 0
;;
"leftrightedge_short")
sxmo_type.sh q
exit 0
;;
*"oneleft")
sxmo_type.sh ":n" -k Return
exit 0
;;
*"oneright")
sxmo_type.sh ":p" -k Return
exit 0
;;
esac
;;
*"amfora"*)
case "$ACTION" in
"downright")
sxmo_type.sh -k Tab
exit 0
;;
"upleft")
sxmo_type.sh -M Shift -k Tab
exit 0
;;
*"oneright")
sxmo_type.sh -k Return
exit 0
;;
"upright")
sxmo_type.sh -M Ctrl t
exit 0
;;
*"oneleft")
sxmo_type.sh b
exit 0
;;
"downleft")
sxmo_type.sh -M Ctrl w
exit 0
;;
esac
;;
*"epy"*|*"epr"*)
case "$ACTION" in
*"left"|"voldown_one")
sxmo_type.sh l
exit 0
;;
*"right"|"volup_one")
sxmo_type.sh h
exit 0
;;
"voldown_three"|"twodownbottomedge")
sxmo_type.sh q
exit
;;
esac
;;
*'nnn'*|'lf')
case "$ACTION" in
*"left")
sxmo_type.sh -k Right
exit 0
;;
*"right")
sxmo_type.sh -k Left
exit 0
;;
esac
;;
esac
case "$WMCLASS" in # Handle general scrolling without touch support
*"st"*)
case "$ACTION" in
*"onedown")
sxmo_type.sh -M Ctrl -M Shift -k b
exit 0
;;
*"oneup")
sxmo_type.sh -M Ctrl -M Shift -k f
exit 0
;;
esac
;;
"org.gnome.vte.application"|"terminal")
case "$ACTION" in
# For VTE, fallback to doing nothing,
# you're probably dragging the scrollbar
*"uprightedge") exit 0 ;;
*"downrightedge") exit 0 ;;
esac
;;
esac
;;
esac
#standard handling
case "$ACTION" in
"menuright"*|"menuright_one")
if sxmo_dmenu.sh isopen; then
sxmo_dmenu.sh close
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
fi
exit 0
;;
"menuleft"*|"menuleft_one")
if sxmo_dmenu.sh isopen; then
sxmo_dmenu.sh close
else
sxmo_appmenu.sh sys
fi
exit 0
;;
"enter_one")
if pidof -q sxmo_RepeatRing.sh; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
fi
exit 0
;;
"enter_two")
swaymsg focus next >/dev/null 2>&1 || sxmo_wm.sh switchfocus
exit 0
;;
"enter_three")
sxmo_wm.sh togglelayout
exit 0
;;
"powerbutton_one")
if echo "$WMCLASS" | grep -i "megapixels"; then
sxmo_type.sh -k space
else
sxmo_appmenu.sh power
fi
exit 0
;;
"powerbutton_two")
sxmo_state.sh click 2
exit 0
;;
"powerbutton_three")
sxmo_terminal.sh
exit 0
;;
"voldown_one")
if [ -n "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
sxmo_killwindow.sh
else
sxmo_keyboard.sh toggle
fi
exit
;;
"voldown_two")
sxmo_wm.sh togglelayout
exit
;;
"voldown_three")
sxmo_killwindow.sh
exit
;;
"volup_one")
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
exit
;;
"volup_two")
sxmo_appmenu.sh sys
exit
;;
"volup_three")
sxmo_wmmenu.sh
exit
;;
"rightleftedge")
sxmo_wm.sh previousworkspace
exit 0
;;
"leftrightedge")
sxmo_wm.sh nextworkspace
exit 0
;;
"twoleft")
sxmo_wm.sh movepreviousworkspace
exit 0
;;
"tworight")
sxmo_wm.sh movenextworkspace
exit 0
;;
"righttopedge")
sxmo_brightness.sh up
exit 0
;;
"lefttopedge")
sxmo_brightness.sh down
exit 0
;;
"upleftedge")
sxmo_audio.sh vol up
exit 0
;;
"downleftedge")
sxmo_audio.sh vol down
exit 0
;;
"upbottomedge")
if [ -n "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
sxmo_terminal.sh
else
sxmo_keyboard.sh open
fi
exit 0
;;
"downbottomedge")
if [ -n "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
sxmo_killwindow.sh
else
sxmo_keyboard.sh close
fi
exit 0
;;
"downtopedge")
sxmo_dmenu.sh isopen || sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
exit 0
;;
"twodowntopedge")
sxmo_hook_quickactions.sh
exit 0
;;
"uptopedge")
sxmo_dmenu.sh close
dunstctl close-all
exit 0
;;
"twodownbottomedge")
sxmo_killwindow.sh
exit 0
;;
"uprightedge")
sxmo_type.sh -k Up
exit 0
;;
"downrightedge")
sxmo_type.sh -k Down
exit 0
;;
"leftrightedge_short")
sxmo_type.sh -k Left
exit 0
;;
"rightrightedge_short")
sxmo_type.sh -k Right
exit 0
;;
"rightbottomedge")
sxmo_type.sh -k Return
exit 0
;;
"leftbottomedge")
sxmo_type.sh -k BackSpace
exit 0
;;
"topleftcorner")
sxmo_appmenu.sh sys
exit 0
;;
"toprightcorner")
sxmo_appmenu.sh scripts
exit 0
;;
"bottomleftcorner")
sxmo_dmenu.sh close
sxmo_keyboard.sh close
if [ -n "$WMCLASS" ]; then
sxmo_state.sh set lock
else
sxmo_state.sh set screenoff
fi
exit 0
;;
"bottomrightcorner")
sxmo_rotate.sh
exit 0
;;
esac
@@ -0,0 +1,75 @@
#!/bin/sh
# configversion: 32e953d311555ad8dd7b4c13d5a0fff4
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
LISGD_THRESHOLD="${SXMO_LISGD_THRESHOLD:-125}"
LISGD_THRESHOLD_PRESSED="${SXMO_LISGD_THRESHOLD_PRESSED:-60}"
LISGD_INPUT_DEVICE="${SXMO_LISGD_INPUT_DEVICE:-"/dev/input/by-path/first-touchscreen"}"
case "$SXMO_WM" in
dwm|i3)
case "$(xrandr | grep primary | cut -d' ' -f 5)" in
right) orientation=1;;
left) orientation=3;;
inverted) orientation=2;;
*) orientation=0;;
esac
;;
esac
#-g format:
# fingers,swipe,edge,distance,command
#order matters, only the first match gets executed
lisgd "$@" -d "$LISGD_INPUT_DEVICE" ${orientation:+-o $orientation} \
-s "${LISGD_EDGE_SIZE:-1.0}" -t "$LISGD_THRESHOLD" -T "$LISGD_THRESHOLD_PRESSED" \
-g "1,DRUL,BR,*,setsid -f sxmo_hook_inputhandler.sh bottomrightcorner" \
-g "1,DLUR,BL,*,setsid -f sxmo_hook_inputhandler.sh bottomleftcorner" \
-g "1,ULDR,TL,*,setsid -f sxmo_hook_inputhandler.sh topleftcorner" \
-g "1,URDL,TR,*,setsid -f sxmo_hook_inputhandler.sh toprightcorner" \
-g "1,LR,B,L,setsid -f sxmo_hook_inputhandler.sh rightbottomedge" \
-g "1,RL,B,L,setsid -f sxmo_hook_inputhandler.sh leftbottomedge" \
-g "1,LR,L,*,setsid -f sxmo_hook_inputhandler.sh rightleftedge" \
-g "1,RL,R,*,setsid -f sxmo_hook_inputhandler.sh leftrightedge" \
-g "1,DU,L,*,P,setsid -f sxmo_hook_inputhandler.sh upleftedge" \
-g "1,UD,L,*,P,setsid -f sxmo_hook_inputhandler.sh downleftedge" \
-g "1,LR,T,*,P,setsid -f sxmo_hook_inputhandler.sh righttopedge" \
-g "1,RL,T,*,P,setsid -f sxmo_hook_inputhandler.sh lefttopedge" \
-g "1,DU,B,*,setsid -f sxmo_hook_inputhandler.sh upbottomedge" \
-g "1,UD,B,*,setsid -f sxmo_hook_inputhandler.sh downbottomedge" \
-g "1,UD,T,*,setsid -f sxmo_hook_inputhandler.sh downtopedge" \
-g "1,DU,T,*,setsid -f sxmo_hook_inputhandler.sh uptopedge" \
-g "2,UD,T,*,setsid -f sxmo_hook_inputhandler.sh twodowntopedge" \
-g "2,UD,B,*,setsid -f sxmo_hook_inputhandler.sh twodownbottomedge" \
-g "1,DU,R,*,P,setsid -f sxmo_hook_inputhandler.sh uprightedge" \
-g "1,UD,R,*,P,setsid -f sxmo_hook_inputhandler.sh downrightedge" \
-g "1,LR,R,S,setsid -f sxmo_hook_inputhandler.sh rightrightedge_short" \
-g "1,RL,L,S,setsid -f sxmo_hook_inputhandler.sh leftrightedge_short" \
-g "1,RL,*,L,setsid -f sxmo_hook_inputhandler.sh longoneleft" \
-g "1,LR,*,L,setsid -f sxmo_hook_inputhandler.sh longoneright" \
-g "1,DU,*,L,setsid -f sxmo_hook_inputhandler.sh longoneup" \
-g "1,UD,*,L,setsid -f sxmo_hook_inputhandler.sh longonedown" \
-g "1,RL,*,M,setsid -f sxmo_hook_inputhandler.sh mediumoneleft" \
-g "1,LR,*,M,setsid -f sxmo_hook_inputhandler.sh mediumoneright" \
-g "1,DU,*,M,setsid -f sxmo_hook_inputhandler.sh mediumoneup" \
-g "1,UD,*,M,setsid -f sxmo_hook_inputhandler.sh mediumonedown" \
-g "1,RL,*,*,setsid -f sxmo_hook_inputhandler.sh oneleft" \
-g "1,LR,*,*,setsid -f sxmo_hook_inputhandler.sh oneright" \
-g "1,DU,*,*,setsid -f sxmo_hook_inputhandler.sh oneup" \
-g "1,UD,*,*,setsid -f sxmo_hook_inputhandler.sh onedown" \
-g "1,DRUL,*,*,setsid -f sxmo_hook_inputhandler.sh upleft" \
-g "1,URDL,*,*,setsid -f sxmo_hook_inputhandler.sh downleft" \
-g "1,DLUR,*,*,setsid -f sxmo_hook_inputhandler.sh upright" \
-g "1,ULDR,*,*,setsid -f sxmo_hook_inputhandler.sh downright" \
-g "2,RL,*,*,setsid -f sxmo_hook_inputhandler.sh twoleft" \
-g "2,LR,*,*,setsid -f sxmo_hook_inputhandler.sh tworight" \
-g "2,DU,*,*,setsid -f sxmo_hook_inputhandler.sh twoup" \
-g "2,UD,*,*,setsid -f sxmo_hook_inputhandler.sh twodown" \
-g "3,RL,*,*,setsid -f sxmo_hook_inputhandler.sh threeleft" \
-g "3,LR,*,*,setsid -f sxmo_hook_inputhandler.sh threeright" \
-g "3,DU,*,*,setsid -f sxmo_hook_inputhandler.sh threeup" \
-g "3,UD,*,*,setsid -f sxmo_hook_inputhandler.sh threedown"
@@ -0,0 +1,37 @@
#!/bin/sh
# configversion: 70028f54f5d7428d4e3178de5c98978b
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
#
# See man 7 sxmo.states.
#
# This will:
# - blink blue led once
# - turn screen on
# - disable input
# - set up a daemon to automatically transition to screenoff state after 8s.
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# This hook is called when the system reaches a locked state
sxmo_led.sh blink blue &
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
sxmo_wm.sh display on
sxmo_wm.sh inputevent touchscreen off
sxmo_jobs.sh stop periodic_blink
sxmo_jobs.sh stop periodic_wakelock_check
# Go down after 8 seconds of inactivity
if [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then
sxmo_jobs.sh stop idle_locker
else
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout "${SXMO_LOCK_IDLE_TIME:-8}" "sxmo_state.sh idle"
fi
wait
@@ -0,0 +1,20 @@
#!/bin/sh
# configversion: 615d3d009ed6b473a5a8cc5f2f4d82a4
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout 10 'sxmo_wm.sh display off' \
resume 'sxmo_wm.sh display on'
case "$SXMO_WM" in
sway|river)
swaylockd
;;
dwm)
i3lock
;;
esac
# need & cause we are still holding flock
sxmo_state.sh set unlock &
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: 8c70b4331421862ea438b53fa6f991f8
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# For use with peanutbutter (peanutbutter --font Sxmo --statuscommand sxmo_hook_lockstatusbar.sh)
# This filters out the last component (which is usually the time and is already displayed more prominently
# make sure status bar icons are suited for peanutbutter
sxmo_hook_statusbar.sh state_change
# obtain status output to pass to peanutbutter (this keeps running and updating to stdout)
exec sxmo_status_watch.sh -o pango
@@ -0,0 +1,5 @@
#!/bin/sh
# configversion: 129937e97deb858f929aeaa989f81810
# This script is called with both toggle wm and when loging out (i.e., restarting)
# current window manager.
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: a50cff93f5d111104e24e83545e9f870
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (asynchronously) when you missed a call
# You can use it to play a ring tone
# The following parameters are provided:
# $1 = Contact Name or Number (if not in contacts)
# kill existing ring playback
sxmo_jobs.sh stop ringing
@@ -0,0 +1,15 @@
#!/bin/sh
# configversion: 45730300738694a1dcf23a31c63e90ee
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if ! command -v mnc > /dev/null; then
exit 0
fi
crontab -l | grep sxmo_rtcwake | mnc
@@ -0,0 +1,53 @@
#!/bin/sh
# configversion: 5af98b088d38ff15338bc0e0a9fe9d33
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This hook is called when the ModemManager1.Modem signals a StateChanged
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# see networkmanager documentation for state names
# oldstate="$1"
newstate="$2"
# reason="$3" # 0 or 1
sxmo_debug "$2 (old: $1 [reason: $3])"
case "$newstate" in
"locked")
sxmo_log "State is locked. Attempting to unlock."
if ! pgrep -f "sxmo_unlocksim.sh" >/dev/null; then
sxmo_unlocksim.sh
fi
;;
"enabling")
sxmo_log "State is enabling. Clearing stale call files."
rm "$XDG_RUNTIME_DIR"/sxmo_calls/* 2>/dev/null
rm -f "$SXMO_NOTIFDIR"/incomingcall* 2>/dev/null
;;
"registered")
sxmo_log "State is registered. Checking for calls and messages."
# kill the pin-entry dmenu if still open
pkill -f sxmo_unlocksim.sh
sxmo_modem.sh checkforfinishedcalls
sxmo_modem.sh checkforincomingcalls
sxmo_modem.sh checkfornewtexts
sxmo_modem.sh checkforstucksms
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
sxmo_mms.sh checkforlostmms
fi
# An example of something else to do here!
#if ! ping -Iwwan0 -q -c 1 -W 10 www.google.com >/dev/null; then
# sxmo_log "ping failed."
# nmcli c down "MINTY"
# nmcli c up "MINTY"
#else
# sxmo_log "ping ok."
#fi
;;
esac
@@ -0,0 +1,12 @@
#!/bin/sh
# configversion: c67b950eca8aca26d6966b7a2ffe19be
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (asynchronously) when you mute (Ignore) an
# incoming call, i.e., ignore the call ringing in.
# kill existing ring playback
sxmo_jobs.sh stop ringing
sxmo_playerctl.sh resume_all
@@ -0,0 +1,19 @@
#!/bin/sh
# configversion: 29ec7910bd4c699ad1a8c84f74e6aeb5
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2023 Sxmo Contributors
# This is called when any network goes down.
# $1 = device name (eg. wlan0)
# $2 = device type (eg. wifi)
# Some examples:
# Notify the user when a network goes down.
# sxmo_notify_user.sh "$2 ($1) down."
# Toggle the data connection when wifi goes down.
#if [ "$2" = "wifi" ]; then
# nmcli c down MYMINT
# nmcli c up MYMINT
#fi
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: ca99324b5d4805618119d354a47cd0ca
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2023 Sxmo Contributors
# This is called when any network prepares to go down.
# $1 = device name (eg. wlan0)
# $2 = device type (eg. wifi)
# Some examples:
# Notify the user when a network goes down.
# sxmo_notify_user.sh "$2 ($1) preparing to go down."
@@ -0,0 +1,13 @@
#!/bin/sh
# configversion: c962c5ea510e22718562938674098cb8
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2023 Sxmo Contributors
# This is called when any network prepares to go up.
# $1 = device name (eg. wlan0)
# $2 = device type (eg. wifi)
# Some examples:
# Notify the user when a network goes down.
# sxmo_notify_user.sh "$2 ($1) preparing to go up."
@@ -0,0 +1,16 @@
#!/bin/sh
# configversion: aec40a4fa4dcd04cc52ef8001970445d
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2023 Sxmo Contributors
# This is called when a network goes up.
# $1 = device name (e.g. wlan0)
# $2 = device type (e.g. wifi)
# Notify the user if a network goes up.
# sxmo_notify_user.sh "$2 ($1) up."
# tell us wifi strength
#if [ "$2" = "wifi" ]; then
# sxmo_notify_user.sh "SIGNAL STRENGTH: $(nmcli -f IN-USE,SIGNAL,SSID device wifi |awk '/^\*/{if (NR!=1) {print $2}}')"
#fi
@@ -0,0 +1,21 @@
#!/bin/sh
# configversion: 2b365df8fa90b8b424b7e1922d130a1f
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# Runs when a notification arrives,
# Arguments:
# $1 - The notification file which contains the notification text.
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
#if [ ! -f "$XDG_CONFIG_HOME"/sxmo/.novibrate ]; then
# VIBS=5
# VIBI=0
# while [ "$VIBI" -lt "$VIBS" ]; do
# sxmo_vibrate 400 "${SXMO_VIBRATE_STRENGTH:-1}" &
# sleep 0.5
# VIBI="$(echo "$VIBI+1" | bc)"
# done
#fi
@@ -0,0 +1,15 @@
#!/bin/sh
# configversion: 66bf3b04f23700d735c73c06814d35c2
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This hook is called when a notification (sxmo_notificationmonitor.sh)
# is added or removed.
# $1 is the number of notifications on the system (0 if none).
if [ "$1" -eq 0 ]; then
sxmo_led.sh set green 0
else
sxmo_led.sh set green 100
fi
sxmo_hook_statusbar.sh notifications
@@ -0,0 +1,12 @@
#!/bin/sh
# configversion: 2c55ea6c81d96a9c2873a0b92fef4f74
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (asynchronously) when you pick up an incoming call
# kill existing ring playback
sxmo_jobs.sh stop ringing
# Pause all player automatically
sxmo_playerctl.sh pause_all
@@ -0,0 +1,18 @@
#!/bin/sh
# configversion: 6363277a2c0b710bfa69218635da22d0
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if [ -z "$SXMO_NO_MODEM" ]; then
MMCLI="$(mmcli -m any -J 2>/dev/null)"
if [ -z "$MMCLI" ]; then
sxmo_notify_user.sh "Modem crashed! 30s recovery."
sxmo_wakelock.sh lock sxmo_modem_crashed 30s
fi
fi
# Add here whatever you want to do
@@ -0,0 +1,15 @@
#!/bin/sh
# configversion: 6231f22a7daf07776a7cfc2c108d4a7a
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed before reboot and poweroff the system
#
# The following parameters are provided:
# $1 = Action (poweroff or reboot)
brightnessctl -d white:torch set 0 >/dev/null 2>&1 || true
brightnessctl -d white:kbd_backlight set 0 >/dev/null 2>&1 || true
brightnessctl -d backlight set 0 >/dev/null 2>&1 || true
sync
@@ -0,0 +1,59 @@
#!/bin/sh
# configversion: abf430b9c661f8b4f955feb586077187
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2025 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
# WARNING: The menus in this script will be displayed over the lockscreen
player_options() {
case "$(playerctl status 2>/dev/null)" in
"") ;; # no player found
*"Playing"*) cat - <<-EOF
$icon_arl Previous
$icon_pau Pause
$icon_arr Next
EOF
;;
*) printf "%s Play" "$icon_itm" ;;
esac
}
while true
do
PICKED="$(grep . <<-EOF | sxmo_dmenu.sh --show-over-lockscreen
$icon_cls Close Menu
$icon_pwr Screen Off
$icon_bth Bluetooth $(rfkill list bluetooth | grep "yes" >/dev/null \
&& printf %b "$icon_tof" \
|| printf %b "$icon_ton")
$(player_options)
$(if brightness="$(brightnessctl -l -m | grep -e "white:torch" -e "white:flash" | cut -d ',' -f 3)" && [ -n "$brightness" ]; then
printf "%s Flashlight " "$icon_fll"
[ "$brightness" -gt 0 ] &&
printf %b "$icon_ton" || printf %b "$icon_tof";
fi)
$icon_wifi_signal_4 Wifi $(rfkill list wifi | grep "yes" >/dev/null \
&& printf %b "$icon_tof" \
|| printf %b "$icon_ton")
EOF
)"
case "$PICKED" in
*'Close Menu'|'') exit 0 ;;
*"Bluetooth"*) doas sxmo_bluetoothtoggle.sh ;;
*"Previous") playerctl previous ;;
*"Pause") playerctl pause ;;
*"Play") playerctl play ;;
*"Next") playerctl next ;;
*"Screen Off") sxmo_state.sh set screenoff && exit 0;;
*"Flashlight"*) sxmo_flashtoggle.sh ;;
*"Wifi"*) doas sxmo_wifitoggle.sh ;;
esac
done
@@ -0,0 +1,93 @@
#!/bin/sh
# configversion: 3329dea80a28c8eb4c54b8828e50758f
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script restart the modem-related daemons on the system
# e.g., eg25-manager, modemmonitor, etc.
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
daemon_start() {
if ! daemon_exists "$1"; then
sxmo_notify_user.sh "$1 does not exist on the system"
return 1
fi
if daemon_isrunning "$1"; then
sxmo_notify_user.sh "$1 is already running"
return 0
fi
if [ -d /run/systemd/system ]; then
[ "$1" = "modemmanager" ] && set -- ModemManager
doas systemctl start "$1"
else
doas rc-service "$1" start
fi
}
daemon_stop() {
if ! daemon_exists "$1"; then
sxmo_notify_user.sh "$1 does not exist on the system"
return 1
fi
if ! daemon_isrunning "$1"; then
sxmo_notify_user.sh "$1 is already stopped"
return 0
fi
if [ -d /run/systemd/system ]; then
[ "$1" = "modemmanager" ] && set -- ModemManager
doas systemctl stop "$1"
else
doas rc-service "$1" stop
fi
}
daemon_isrunning() {
if ! daemon_exists "$1"; then
sxmo_log "$1 does not exist on the system"
return 1
fi
if [ -d /run/systemd/system ]; then
[ "$1" = "modemmanager" ] && set -- ModemManager
systemctl is-active --quiet "$1"
else
rc-service "$1" status | grep -q started
fi
}
daemon_exists() {
if [ -d /run/systemd/system ]; then
[ "$1" = "modemmanager" ] && set -- ModemManager
systemctl status "$1" > /dev/null 2>&1
[ $? -ne 4 ]
else
[ -f /etc/init.d/"$1" ]
fi
}
if command -v eg25-manager > /dev/null; then
sxmo_notify_user.sh "Stopping eg25-manager..."
daemon_stop eg25-manager
sleep 2
sxmo_notify_user.sh "Starting eg25-manager..."
daemon_start eg25-manager
if ! daemon_isrunning eg25-manager; then
sxmo_notify_user.sh --urgency=critical "The eg25-manager failed to start!"
exit 1
fi
fi
sxmo_notify_user.sh "Stopping modemmanager..."
daemon_stop modemmanager
sleep 2
sxmo_notify_user.sh "Starting modemmanager..."
daemon_start modemmanager
if ! daemon_isrunning modemmanager; then
sxmo_notify_user.sh --urgency=critical "The modemmanager failed to start!"
exit 1
fi
# we want 120s before sleeping again
sxmo_wakelock.sh lock sxmo_modem_manually_reset 120s
@@ -0,0 +1,90 @@
#!/bin/sh
# configversion: 09ad3901daff9cc5473c32bd02533148
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed (asynchronously) when you get an incoming call
# You can use it to play a ring tone
# $1 = Contact Name or Number (if not in contacts)
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Only vibrate if you already got an active call
if sxmo_modemcall.sh list_active_calls \
| grep -v ringing-in \
| grep -q .; then
sxmo_vibrate 1500 "${SXMO_VIBRATE_STRENGTH:-1}"
exit
fi
# Shallow if you have more than one ringing call
if ! sxmo_modemcall.sh list_active_calls \
| grep -c ringing-in \
| grep -q 1; then
exit
fi
finish() {
trap - INT TERM EXIT
jobs -p | xargs -r kill
wait
exit
}
ring() {
mpv --no-resume-playback --quiet --no-video \
--loop="${SXMO_RINGNUMBER:-10}" "$SXMO_RINGTONE" >/dev/null &
}
vibrate() {
while : ; do
trap 'finish' INT TERM EXIT
sxmo_vibrate 1500 "${SXMO_VIBRATE_STRENGTH:-1}" &
wait "$!"
sleep 0.5 &
wait "$!"
done &
}
# SILENT MODE
if [ -f "$XDG_CONFIG_HOME"/sxmo/.busy ]; then
end="$(cat "$XDG_CONFIG_HOME"/sxmo/.busy)"
if [ -z "$end" ] || [ "$(date +%s)" -lt "$end" ]; then
exit
fi
fi
# RING & VIBRATE MODE (DEFAULT)
if [ ! -f "$XDG_CONFIG_HOME"/sxmo/.noring ] && [ ! -f "$XDG_CONFIG_HOME"/sxmo/.novibrate ]; then
sxmo_log "RING AND VIBRATE"
# In order for this to work, you will need to install playerctl and run playerctld
# In order for this to work with mpv, you will need to install mpv-mdis.
sxmo_playerctl.sh pause_all
ring
vibrate
# RING-ONLY MODE
elif [ ! -f "$XDG_CONFIG_HOME"/sxmo/.noring ] && [ -f "$XDG_CONFIG_HOME"/sxmo/.novibrate ]; then
sxmo_log "RING ONLY"
# In order for this to work, you will need to install playerctl and run playerctld
# In order for this to work with mpv, you will need to install mpv-mdis.
sxmo_playerctl.sh pause_all
ring
# VIBRATE-ONLY MODE
elif [ ! -f "$XDG_CONFIG_HOME"/sxmo/.novibrate ] && [ -f "$XDG_CONFIG_HOME"/sxmo/.noring ]; then
smxo_log "VIBRATE ONLY"
vibrate
fi
trap 'finish' INT TERM EXIT
sleep "${SXMO_RINGTIME:-20}" &
wait "$!"
@@ -0,0 +1,12 @@
#!/bin/sh
# configversion: 70b9e11c69ccd120bda1e1aebcc7f9cd
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed after the screen is rotated.
# You can use this to change your conky/wayout layout or status
# bar to something more appropriate to the current orientation.
# The following parameters are provided:
# $1 = the new orientation
# possible values are "normal", "invert", "left" and "right"
@@ -0,0 +1,51 @@
#!/bin/sh
# configversion: 66b67db06146e3b2dd3ae9a6f1411c5e
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
#
# See man 7 sxmo.states.
#
# This will:
# - turn screen off
# - turn input off
# - launch a demon to blink purple led every 2s
# - check wakelocks and if none suspend after 3s hold
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# This hook is called when the system reaches a off state (screen off)
sxmo_led.sh blink red blue &
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
sxmo_wm.sh display off
sxmo_wm.sh inputevent touchscreen off
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ]; then
sxmo_jobs.sh start periodic_blink \
sxmo_run_periodically.sh -w 2 -- sxmo_led.sh blink red blue
fi
case "$SXMO_WM" in
dwm)
# dmenu will grab input focus (i.e. power button) so kill it before going to
# screenoff unless proximity lock is running (i.e. there's a phone call).
if ! sxmo_jobs.sh running proximity_lock -q; then
sxmo_dmenu.sh close
fi
;;
esac
sxmo_jobs.sh stop idle_locker
wait
case "$SXMO_WM" in
sway)
if command -v peanutbutter > /dev/null; then
peanutbutter --font Sxmo --statuscommand sxmo_hook_lockstatusbar.sh && sxmo_hook_statusbar.sh state_change &
fi
;;
esac
@@ -0,0 +1,44 @@
#!/bin/sh
# configversion: 79862f7af2e87209475e387e7abd17c0
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script will output the content of the scripts menu
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
write_line() {
printf "%s ^ 0 ^ %s\n" "$1" "$2"
}
get_title() {
title=""
eval "$(head "$1" | grep '# title="[^\\"]*"' | sed 's/^# //g')"
if [ -n "$title" ]; then
echo "$title"
else
basename="$(basename "$1")"
echo "$icon_itm $basename"
fi
}
if [ -f "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
cat "$XDG_CONFIG_HOME/sxmo/userscripts"
elif [ -d "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
find -L "$XDG_CONFIG_HOME/sxmo/userscripts" -type f -o -type l | sort -f | while read -r script; do
title="$(get_title "$script")"
write_line "$title" "$script"
done
fi
write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
# System Scripts
find "$(xdg_data_path sxmo/appscripts)" -type f -o -type l | sort -f | while read -r script; do
title="$(get_title "$script")"
write_line "$title" "$script"
done
@@ -0,0 +1,21 @@
#!/bin/sh
# configversion: 4989e41f31ddd70f1bbf97685429ed1a
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed after you send a text
#You can use it to play a notification sound or forward the sms elsewhere
#The following parameters are provided:
# $1 = Contact Name or Number (if number not in contacts)
# $2 = Text
# mms / group chats will also include these parameters:
# $3 = MMS payload ID
# $4 = Group Contact Name or Number (if number not included in contacts)
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if [ ! -f "$XDG_CONFIG_HOME"/sxmo/.noring ]; then
mpv --quiet --no-video "$(xdg_data_path sxmo/notify.ogg)" > /dev/null 2>&1
fi
@@ -0,0 +1,41 @@
#!/bin/sh
# configversion: 26b9fe022a43d084906232c0de6739dd
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is executed after you received a text, mms, or vvm
# You can use it to play a notification sound or forward the sms elsewhere
# The following parameters are provided:
# $1 = Contact Name or Number (if number not in contacts)
# $2 = Text (or 'VVM' if a vvm)
# mms and vvm will include these parameters:
# $3 = MMS or VVM payload ID
# Finally, mms may include this parameter:
# $4 = Group Contact Name or Number (if number not in contacts)
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# do nothing if active call
if sxmo_modemcall.sh list_active_calls | grep -q active; then
exit
fi
# do nothing if silent mode
if [ -f "$XDG_CONFIG_HOME"/sxmo/.busy ]; then
end="$(cat "$XDG_CONFIG_HOME"/sxmo/.busy)"
if [ -z "$end" ] || [ "$(date +%s)" -lt "$end" ]; then
exit
fi
fi
if [ ! -f "$XDG_CONFIG_HOME"/sxmo/.noring ]; then
mpv --no-resume-playback --quiet --no-video "$SXMO_TEXTSOUND" >> /dev/null 2>&1 &
fi
if [ ! -f "$XDG_CONFIG_HOME"/sxmo/.novibrate ]; then
sxmo_vibrate 500 "${SXMO_VIBRATE_STRENGTH:-1}" &
fi
wait
@@ -0,0 +1,42 @@
#!/bin/sh
# configversion: 299a9ddd77ef0f09695cea6c8d9340e3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# Allow user to override what we log in the sms.txt file. Note if you change
# this you probably should change sxmo_hook_tailtextlog.sh
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
ACTION="$1" # recv or sent
LOGDIRNUM="$2" # The directory name in SXMO_LOG
NUM="$3" # The sender's phone number
TIME="$4"
TEXT="$5"
MMSID="$6" # optional
if [ "$ACTION" = "recv" ]; then
VERB="Received"
else
VERB="Sent"
fi
# if group chain also print the sender
if [ "$NUM" != "$LOGDIRNUM" ] && [ "$ACTION" = "recv" ]; then
printf "%s from %s at %s:\n%b\n" \
"$VERB" "$NUM" "$TIME" "$TEXT"
else
printf "%s at %s:\n%b\n" \
"$VERB" "$TIME" "$TEXT"
fi
# print any attachments
for attachment in "$SXMO_LOGDIR/$LOGDIRNUM/attachments/${MMSID}".*; do
[ -f "$attachment" ] && printf "%s %s\n" "$icon_att" "$(basename "$attachment")"
done
printf "\n"
@@ -0,0 +1,159 @@
#!/bin/sh
# configversion: c73f9334f62c4c1addcaf074cbcb91e8
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# Runs upon system start and starts various background services
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
xdg-user-dirs-update
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
sleep 0.5
done
# Not dangerous if "locker" isn't an available state
sxmo_state.sh set locker
if [ -n "$SXMO_ROTATE_START" ]; then
sxmo_rotate.sh
fi
# Load our sound daemons
if [ -z "$SXMO_NO_AUDIO" ]; then
if ! [ -d /run/systemd/system ]; then
if [ "$(command -v pulseaudio)" ]; then
superctl start pulseaudio
elif [ "$(command -v pipewire)" ]; then
# pipewire-pulse will start pipewire
superctl start pipewire-pulse
superctl start wireplumber
fi
fi
# monitor for headphone for statusbar
superctl start sxmo_soundmonitor
fi
# Periodically update some status bar components
sxmo_hook_statusbar.sh all
sxmo_jobs.sh start statusbar_periodics sxmo_run_aligned.sh 60 \
sxmo_hook_statusbar.sh periodics
# dunst is required for warnings.
superctl start dunst
# start adaptive brightness at boot
# superctl start sxmo_adaptivebrightness
# load some other little things here too.
case "$SXMO_WM" in
river)
superctl start sxmo_wob
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
superctl start sxmo_riverbar
;;
sway)
superctl start sxmo_wob
superctl start sxmo_menumode_toggler
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
;;
dwm|i3)
superctl start sxmo_xob
# 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
superctl start "$1"
superctl start autocutsel
superctl start autocutsel-primary
superctl start sxmo-x11-status
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Set onboard to auto-hide in config first
if [ "$KEYBOARD" = "onboard" ]; then
onboard "$KEYBOARD_ARGS"
fi
case "$SXMO_WM" in
i3)
xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
;;
esac
;;
esac
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
sxmo_wakelock.sh lock sxmo_not_suspendable infinite
superctl start sxmo_autosuspend
fi
# To setup initial unlock state
sxmo_state.sh set unlock
# Turn on lisgd
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
# Turn on the dbus-monitors for modem-related tasks
superctl start sxmo_modemmonitor
# place a wakelock for 120s to allow the modem to fully warm up (eg25 +
# elogind/systemd would do this for us, but we don't use those.)
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
# Start the desktop wallpaper
superctl start sxmo_bg
# Start the desktop widget (e.g. clock)
superctl start sxmo_conky
# Monitor the battery
superctl start sxmo_battery_monitor
# It watch network changes and update the status bar icon by example
superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &
# mmsd and vvmd
if [ -z "$SXMO_NO_MODEM" ]; then
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
superctl start mmsd-tng
fi
if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
superctl start vvmd
fi
fi
# add some warnings if things are not setup correctly
if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
sxmo_notify_user.sh --urgency=critical \
"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
fi
sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
@@ -0,0 +1,488 @@
#!/bin/sh
# configversion: bcbb01ae41a24f018e11f41c6b2668c6
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# we disable shellcheck SC2154 (unreferenced variable used)
# shellcheck disable=SC2154
# include common definitions
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# You can modify the statusbar ordering and feel here.
# Note that order number runs from 0 (far left) to 100 (far
# right). Our preference is to have "static" icons on the
# right and "variable" icons (that come and go) on the left.
set_time() {
if pidof peanutbutter > /dev/null; then
#peanutbutter already features a clock, no need for one in the icon bar
sxmobar -d time
else
date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}" | while read -r date; do
sxmobar -a time 99 "$date"
done
fi
}
set_state() {
if [ ! -f "$SXMO_STATE" ]; then
return
fi
if sxmo_jobs.sh running proximity_lock -q; then
sxmobar -a -e bold -f orange state 90 "$icon_state_proximity" # circle with dot
return
fi
if command -v peanutbutter > /dev/null; then
# no need for a state icon in this (default) scenario, the state will be obvious, either peanutbutter is on or it isn't
sxmobar -d state
return
fi
case "$(sxmo_state.sh get)" in
screenoff)
sxmobar -a -e bold -f red state 90 "$icon_state_screenoff" # filled circle
;;
lock)
sxmobar -a -e bold -f red state 90 "$icon_state_lock" # open circle with slash
;;
unlock)
sxmobar -a -e bold state 90 "$icon_state_unlock" # open circle
;;
esac
}
# from right to left: indicate signal, technologies, mm state
set_modem() {
MMCLI="$(mmcli -m any -J 2>/dev/null)"
bgcolor=default
fgcolor=default
style=normal
if [ -z "$MMCLI" ]; then
MODEMSTATE="nomodem"
else
MODEMSTATE="$(printf %s "$MMCLI" | jq -r .modem.generic.state)"
fi
case "$MODEMSTATE" in
nomodem)
fgcolor=red
MODEMSTATECMP="$icon_modem_nomodem"
;;
locked)
fgcolor=red
MODEMSTATECMP="$icon_modem_locked"
;;
initializing)
fgcolor=red
MODEMSTATECMP="$icon_modem_initializing"
;;
disabled) # low power state
fgcolor=red
MODEMSTATECMP="$icon_modem_disabled"
;;
disabling)
fgcolor=red
MODEMSTATECMP="$icon_modem_disabling"
;;
enabling) # modem enabled but neither registered (cell) nor connected (data)
fgcolor=red
MODEMSTATECMP="$icon_modem_enabling"
;;
enabled)
fgcolor=red
MODEMSTATECMP="$icon_modem_enabled"
;;
searching) # i.e. registering
fgcolor=red
MODEMSTATECMP="$icon_modem_searching"
;;
registered) # i.e. phone but no data
fgcolor=orange
MODEMSTATECMP="$icon_modem_registered"
;;
connecting)
fgcolor=orange
MODEMSTATECMP="$icon_modem_connecting"
;;
disconnecting) # i.e., going back to registered state
fgcolor=orange
MODEMSTATECMP="$icon_modem_disconnecting"
;;
connected)
MODEMSTATECMP="$icon_modem_connected"
;;
*)
# FAILED, UNKNOWN
# see https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Flags-and-Enumerations.html#MMModemState
fgcolor=red
MODEMSTATECMP="$icon_modem_failed" # cell with !
sxmo_log "WARNING: MODEMSTATE: $MODEMSTATE"
;;
esac
sxmobar -a -f "$fgcolor" -b "$bgcolor" -t "$style" \
modem-state 10 "$MODEMSTATECMP"
if [ "$MODEMSTATE" = nomodem ]; then
sxmobar -d modem-tech
sxmobar -d modem-signal
return
fi
MODEMTECHCMP="$icon_modem_notech"
bgcolor=default
fgcolor=default
style=normal
# see https://www.freedesktop.org/software/ModemManager/api/latest/ModemManager-Flags-and-Enumerations.html#MMModemAccessTechnology
USEDTECHS="$(printf %s "$MMCLI" | jq -r '.modem.generic."access-technologies"[]')"
case "$USEDTECHS" in
*5gnr*)
MODEMTECHCMP="$icon_modem_fiveg"
;;
*lte*) # lte, lte_nb_iot, lte_cat_m
MODEMTECHCMP="$icon_modem_fourg"
;;
*umts*|*hsupa*|*hsdpa*|*1xrtt*|*evdo*)
MODEMTECHCMP="$icon_modem_threeg"
;;
*hspa_plus*)
MODEMTECHCMP="$icon_modem_hspa_plus" # 3g
;;
*hspa*)
MODEMTECHCMP="$icon_modem_hspa" # 3g
;;
*edge*)
MODEMTECHCMP="E" # 2G+
;;
*pots*)
MODEMTECHCMP="P" # 0G
;;
*gsm*) # gsm, gsm_compact
MODEMTECHCMP="$icon_modem_twog"
;;
*gprs*)
MODEMTECHCMP="G" # 2G
;;
*)
sxmo_log "WARNING: USEDTECHS: $USEDTECHS"
fgcolor=red
;;
esac
if [ "$MODEMSTATE" != failed ] && [ "$MODEMSTATE" != unknown ]; then
sxmobar -a -f "$fgcolor" -b "$bgcolor" -t "$style" \
modem-tech 11 "$MODEMTECHCMP"
fi
MODEMSIGNALCMP="$icon_modem_signal_0"
bgcolor=default
fgcolor=default
style=normal
case "$MODEMSTATE" in
registered|connected|connecting|disconnecting)
MODEMSIGNAL="$(printf %s "$MMCLI" | jq -r '.modem.generic."signal-quality".value')"
if [ "$MODEMSIGNAL" -lt 33 ]; then
MODEMSIGNALCMP="$icon_modem_signal_1"
elif [ "$MODEMSIGNAL" -lt 66 ]; then
MODEMSIGNALCMP="$icon_modem_signal_2"
else
MODEMSIGNALCMP="$icon_modem_signal_3"
fi
;;
esac
if [ "$MODEMSTATE" != failed ] && [ "$MODEMSTATE" != unknown ]; then
sxmobar -a -f "$fgcolor" -b "$bgcolor" -t "$style" \
modem-signal 12 "$MODEMSIGNALCMP"
fi
}
# $1 = type (wifi, tun)
# $2 = interface name (wlan0, tun0)
set_wifi() {
if rfkill list wifi | grep -q "yes"; then
sxmobar -d wifi-status
return
fi
CONN="$(nmcli -t con show --active)"
if ! printf %b "$CONN" | cut -d':' -f3 | grep -q wireless; then
sxmobar -a -f red wifi-status 30 "$icon_wifi_disconnected"
return
fi
# we simply assume Hotspot as first bit of name
# for hotspot as this is what we create.
if printf %b "$CONN" | grep -q ^Hotspot; then
sxmobar -a wifi-status 30 "$icon_wfh"
return
fi
# if they have a vpn nmcli c shown --active should also list:
# tun0 ef5fcce9-fdae-4ffe-a540-b16fc7b42852 tun tun0
if printf %b "$CONN" | cut -d':' -f3 | grep -q -E "^tun$|^wireguard$"; then
wifivpn=1
else
wifivpn=0
fi
wifi_signal="$(nmcli -f IN-USE,SIGNAL,SSID device wifi | awk '/^\*/{if (NR!=1) {print $2}}')"
if [ -z "$wifi_signal" ]; then
icon_wif="$icon_wifi_signal_exclam"
elif [ "$wifi_signal" -lt 20 ]; then
if [ "$wifivpn" -eq 1 ]; then
icon_wif="$icon_wifi_key_signal_0"
else
icon_wif="$icon_wifi_signal_0"
fi
elif [ "$wifi_signal" -lt 40 ]; then
if [ "$wifivpn" -eq 1 ]; then
icon_wif="$icon_wifi_key_signal_1"
else
icon_wif="$icon_wifi_signal_1"
fi
elif [ "$wifi_signal" -lt 60 ]; then
if [ "$wifivpn" -eq 1 ]; then
icon_wif="$icon_wifi_key_signal_2"
else
icon_wif="$icon_wifi_signal_2"
fi
elif [ "$wifi_signal" -lt 80 ]; then
if [ "$wifivpn" -eq 1 ]; then
icon_wif="$icon_wifi_key_signal_3"
else
icon_wif="$icon_wifi_signal_3"
fi
else
if [ "$wifivpn" -eq 1 ]; then
icon_wif="$icon_wifi_key_signal_4"
else
icon_wif="$icon_wifi_signal_4"
fi
fi
sxmobar -a wifi-status 30 "$icon_wif"
}
# $1 = type (wifi, tun)
# $2 = interface name (wlan0, tun0)
set_ethernet() {
conname="$(nmcli -t device show "$2" | grep ^GENERAL.CONNECTION | cut -d: -f2-)"
if [ "$conname" = "--" ]; then
# not used device
sxmobar -d ethernet-status-"$2" 30
return
fi
if nmcli -t connection show "$conname" | grep ^ipv4.method | grep -q :shared; then
sxmobar -a ethernet-status-"$2" 30 "$icon_lnk"
else
sxmobar -d ethernet-status-"$2" 30
fi
}
# $1: type (reported by nmcli, e.g., wifi, tun)
# $2: interface name (reported by nmcli, e.g., wlan0, tun0)
set_network() {
case "$1" in
wifi|tun) set_wifi "$@" ;;
ethernet) set_ethernet "$@" ;;
esac
}
set_battery() {
name="$1"
state="$2"
percentage="$3"
fgcolor=default
bgcolor=default
style=normal
BATCMP=
case "$state" in
fully-charged)
BATCMP="$icon_bat_c_full"
;;
charging)
if [ "$percentage" -lt 10 ]; then
BATCMP="$icon_bat_c_0"
elif [ "$percentage" -lt 20 ]; then
BATCMP="$icon_bat_c_10"
elif [ "$percentage" -lt 30 ]; then
BATCMP="$icon_bat_c_20"
elif [ "$percentage" -lt 40 ]; then
BATCMP="$icon_bat_c_30"
elif [ "$percentage" -lt 50 ]; then
BATCMP="$icon_bat_c_40"
elif [ "$percentage" -lt 60 ]; then
BATCMP="$icon_bat_c_50"
elif [ "$percentage" -lt 70 ]; then
BATCMP="$icon_bat_c_60"
elif [ "$percentage" -lt 80 ]; then
BATCMP="$icon_bat_c_70"
elif [ "$percentage" -lt 90 ]; then
BATCMP="$icon_bat_c_80"
elif [ "$percentage" -lt 95 ]; then
BATCMP="$icon_bat_c_90"
else
# Treat 'Full' status as same as 'fully-charged'
fgcolor=green
BATCMP="$icon_bat_c_full"
fi
;;
discharging)
if [ "$percentage" -lt 10 ]; then
fgcolor=red
BATCMP="$icon_bat_warning"
elif [ "$percentage" -lt 20 ]; then
fgcolor=red
BATCMP="$icon_bat_10"
elif [ "$percentage" -lt 30 ]; then
fgcolor=orange
BATCMP="$icon_bat_20"
elif [ "$percentage" -lt 40 ]; then
fgcolor=orange
BATCMP="$icon_bat_30"
elif [ "$percentage" -lt 50 ]; then
fgcolor=orange
BATCMP="$icon_bat_40"
elif [ "$percentage" -lt 60 ]; then
BATCMP="$icon_bat_50"
elif [ "$percentage" -lt 70 ]; then
BATCMP="$icon_bat_60"
elif [ "$percentage" -lt 80 ]; then
BATCMP="$icon_bat_70"
elif [ "$percentage" -lt 90 ]; then
BATCMP="$icon_bat_80"
elif [ "$percentage" -lt 95 ]; then
BATCMP="$icon_bat_90"
else
# Treat 'Full' status as same as 'fully-charged'
BATCMP="$icon_bat_full"
fi
;;
esac
sxmobar -a -t "$style" -b "$bgcolor" -f "$fgcolor" \
"battery-icon-$name" 40 "$BATCMP"
if [ -z "$SXMO_BAR_SHOW_BAT_PER" ]; then
sxmobar -d "battery-status-$name"
else
sxmobar -a "battery-status-$name" 41 "$percentage%"
fi
}
set_notifications() {
[ -z "$SXMO_DISABLE_LEDS" ] && return
NNOTIFICATIONS="$(find "$SXMO_NOTIFDIR" -type f | wc -l)"
if [ "$NNOTIFICATIONS" = 0 ]; then
sxmobar -d notifs
else
sxmobar -a -f red notifs 5 "!: $NNOTIFICATIONS"
fi
}
set_volume() {
VOLCMP=""
if sxmo_audio.sh mic ismuted; then
VOLCMP="$icon_mmc"
else
case "$(sxmo_audio.sh device getinput 2>/dev/null)" in
*Headset*)
VOLCMP="$icon_hst"
;;
*)
VOLCMP="$icon_mic"
;;
esac
fi
if sxmo_audio.sh vol ismuted; then
VOLCMP="$VOLCMP $icon_mut"
else
case "$(sxmo_audio.sh device get 2>/dev/null)" in
*Speaker*|"")
# nothing for default or pulse devices
;;
*Headphone*)
VOLCMP="$VOLCMP $icon_hdp"
;;
*Earpiece*)
VOLCMP="$VOLCMP $icon_ear"
;;
esac
VOL="$(sxmo_audio.sh vol get)"
if [ "$VOL" -gt 66 ]; then
VOLCMP="$VOLCMP $icon_spk"
elif [ "$VOL" -gt 33 ]; then
VOLCMP="$VOLCMP $icon_spm"
elif [ "$VOL" -ge 0 ]; then
VOLCMP="$VOLCMP $icon_spl"
fi
fi
sxmobar -a volume 50 "$VOLCMP"
}
set_notch() {
if [ -n "$SXMO_NOTCH" ] && ! pidof peanutbutter > /dev/null; then
sxmobar -a notch "${SXMO_NOTCH_PRIO:-29}" "$SXMO_NOTCH"
else
sxmobar -d notch
fi
}
sxmo_debug "$@"
case "$1" in
network)
shift
set_network "$@"
;;
battery)
shift
set_battery "$@"
;;
time|modem|volume|state|notifications|notch)
set_"$1"
;;
periodics|state_change) # 55 s loop and screenlock triggers
set_time
if [ -z "$SXMO_NO_MODEM" ]; then
set_modem
fi
set_notch
set_state
set_network wifi wlan0
;;
all)
sxmobar -r
set_time
if [ -z "$SXMO_NO_MODEM" ]; then
set_modem
fi
if [ -z "$SXMO_NO_AUDIO" ]; then
set_volume
fi
set_state
set_notifications
set_notch
set_network wifi wlan0
;;
*)
exit # swallow it !
;;
esac
@@ -0,0 +1,7 @@
#!/bin/sh
# configversion: 9ebf1802276513c4eefc8da4e5f2eda9
# Runs after wm has been stopped., useful for cleanup
# clean up misc. stale files (if any)
rm -rf "$XDG_RUNTIME_DIR"/sxmo*
@@ -0,0 +1,57 @@
#!/bin/sh
# configversion: 10dbe6b2a440db545baeeef27c58e076
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This hook displays the sms log for a numbers passed as $1
LOGDIRNUM="$1"
# Wrap this in a terminal if not already done
if [ -z "$TERMNAME" ]; then
TERMNAME="$LOGDIRNUM SMS"
# If it's already open, switch to it.
if [ "$SXMO_WM" = "sway" ] && [ -z "$SSH_CLIENT" ]; then
regesc_termname="$(echo "$TERMNAME" | sed 's|+|\\+|g')"
if swaymsg -q "[title=\"^$regesc_termname\$\"]" focus; then
exit 0
fi
fi
export TERMNAME
exec sxmo_terminal.sh "$0" "$@"
fi
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
mkcontactssedcmd() {
pnc find "$LOGDIRNUM" | while read -r NUMBER; do
CONTACT="$(sxmo_contacts.sh --name-or-number "$NUMBER")"
if [ ! "$CONTACT" = "$NUMBER" ]; then
printf %s "s/$NUMBER/$CONTACT/;"
fi
done
}
# Replace certain dates with human readable versions
TODAY="$(date +%F)"
YESTERDAY="$(date -d "- 1 day" +%F)"
TWO_DAYS="$(date -d "- 2 day" +%F)"
DATESEDCMD="s/ at ${TODAY}T/ today at /; s/ at ${YESTERDAY}T/ yesterday at /; s/ at ${TWO_DAYS}T/ two days ago at /; s/[-+][0-9][0-9][0-9][0-9]://; s/\(-[0-9][0-9]\)T\([0-9][0-9]\)/\1 \2/;"
# TODO
#ALIGNSEDCMD="s/^Sent/<right align>/;s/^Received/<left align>/;"
# Colorize Sent and Received lines
RECEIVED_COLOR="2"
SENT_COLOR="3"
COLORSEDCMD="s#^\(Sent.*\)#$(tput setaf "$SENT_COLOR")\1$(tput op)#;s#^\(Received.*\)#$(tput setaf "$RECEIVED_COLOR")\1$(tput op)#;"
# Replace phone numbers in the filename with contacts from contact book
CONTACTSSEDCMD="$(mkcontactssedcmd)"
tail -n9999 -f "$SXMO_LOGDIR/$LOGDIRNUM/sms.txt" |\
sed -e "$CONTACTSSEDCMD" -e "$DATESEDCMD" -e "$COLORSEDCMD"
@@ -0,0 +1,51 @@
#!/bin/sh
# configversion: 5697e0579ea20a4a6b8dc05f5814d0c6
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# This hook is called when the system becomes unlocked again
sxmo_led.sh blink red green &
sxmo_wm.sh display on
sxmo_wm.sh inputevent touchscreen on
sxmo_jobs.sh stop periodic_blink
sxmo_jobs.sh stop periodic_wakelock_check
# Go to the next idle state after 120 seconds of inactivity
if [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then
sxmo_jobs.sh stop idle_locker
else
case "$SXMO_WM" in
river)
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout "${SXMO_UNLOCK_IDLE_TIME:-120}" 'sh -c "
exec sxmo_state.sh idle
"'
;;
sway)
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout "${SXMO_UNLOCK_IDLE_TIME:-120}" 'sh -c "
swaymsg mode default;
exec sxmo_state.sh idle
"'
;;
i3)
# Idle fails to trigger if formatted like sway
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout "${SXMO_UNLOCK_IDLE_TIME:-120}" \
'sh -c "i3-msg mode default; exec sxmo_state.sh idle"'
;;
dwm)
sxmo_jobs.sh start idle_locker sxmo_idle.sh -w \
timeout "${SXMO_UNLOCK_IDLE_TIME:-120}" "sxmo_state.sh idle"
;;
esac
fi
wait
@@ -0,0 +1,29 @@
#!/bin/sh -e
# configversion: 9c6286bbff8167b35278cf97aae4d7e6
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# This script is executed once, and must output the wallpaper to display
installed_wallpapers() {
xdg_data_path wallpapers 0 "\0" | xargs -r0I{} find "{}" -name "$SXMO_OS.*"
}
sxmo_wallpaper() {
xdg_data_path sxmo/background.jpg
}
all_wallpapers() {
installed_wallpapers
sxmo_wallpaper
}
if [ -n "$SXMO_BG_IMG" ]; then
printf "%s" "$SXMO_BG_IMG"
exit
fi
all_wallpapers | head -n1