init commit
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
export SXMO_WM=sway
|
||||
export SXMO_ROTATION=normal
|
||||
|
||||
# Native 1:1 240x320 QVGA resolution
|
||||
export SXMO_SWAY_SCALE=1
|
||||
|
||||
# Physical button mappings
|
||||
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
|
||||
export SXMO_VOLUME_UP_BUTTON="0:103:KEY_UP"
|
||||
export SXMO_VOLUME_DOWN_BUTTON="0:108:KEY_DOWN"
|
||||
export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
|
||||
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
|
||||
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
|
||||
|
||||
# Nokia 8110 4G has a physical keypad and no touchscreen
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export KEYBOARD_ARGS="-H 1 -L 1"
|
||||
export SXMO_MENU=wofi
|
||||
export SXMO_WOFI_LANDSCAPE_WIDTH=320
|
||||
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
|
||||
export SXMO_BEMENU_PORTRAIT_LINES=10
|
||||
export SXMO_BEMENU_LANDSCAPE_LINES=6
|
||||
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
export SXMO_WM=sway
|
||||
export SXMO_ROTATION=normal
|
||||
|
||||
# Native 1:1 240x320 QVGA resolution
|
||||
export SXMO_SWAY_SCALE=1
|
||||
|
||||
# Physical button mappings
|
||||
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
|
||||
export SXMO_VOLUME_UP_BUTTON="0:103:KEY_UP"
|
||||
export SXMO_VOLUME_DOWN_BUTTON="0:108:KEY_DOWN"
|
||||
export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
|
||||
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
|
||||
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
|
||||
|
||||
# Nokia 8110 4G has a physical keypad and no touchscreen
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export KEYBOARD_ARGS="-H 1 -L 1"
|
||||
export SXMO_MENU=wofi
|
||||
export SXMO_WOFI_LANDSCAPE_WIDTH=320
|
||||
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
|
||||
export SXMO_BEMENU_PORTRAIT_LINES=10
|
||||
export SXMO_BEMENU_LANDSCAPE_LINES=6
|
||||
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
export SXMO_WM=sway
|
||||
export SXMO_ROTATION=normal
|
||||
|
||||
# Native 1:1 240x320 QVGA resolution
|
||||
export SXMO_SWAY_SCALE=1
|
||||
|
||||
# Physical button mappings
|
||||
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
|
||||
export SXMO_VOLUME_UP_BUTTON="0:103:KEY_UP"
|
||||
export SXMO_VOLUME_DOWN_BUTTON="0:108:KEY_DOWN"
|
||||
export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
|
||||
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
|
||||
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
|
||||
|
||||
# Nokia 8110 4G has a physical keypad and no touchscreen
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export KEYBOARD_ARGS="-H 1 -L 1"
|
||||
export SXMO_MENU=wofi
|
||||
export SXMO_WOFI_LANDSCAPE_WIDTH=320
|
||||
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
|
||||
export SXMO_BEMENU_PORTRAIT_LINES=10
|
||||
export SXMO_BEMENU_LANDSCAPE_LINES=6
|
||||
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
export SXMO_WM=sway
|
||||
export SXMO_ROTATION=normal
|
||||
|
||||
# Native 1:1 240x320 QVGA resolution
|
||||
export SXMO_SWAY_SCALE=1
|
||||
|
||||
# Physical button mappings
|
||||
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
|
||||
export SXMO_VOLUME_UP_BUTTON="0:103:KEY_UP"
|
||||
export SXMO_VOLUME_DOWN_BUTTON="0:108:KEY_DOWN"
|
||||
export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
|
||||
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
|
||||
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
|
||||
|
||||
# Nokia 8110 4G has a physical keypad and no touchscreen
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export KEYBOARD_ARGS="-H 1 -L 1"
|
||||
export SXMO_MENU=wofi
|
||||
export SXMO_WOFI_LANDSCAPE_WIDTH=320
|
||||
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
|
||||
export SXMO_BEMENU_PORTRAIT_LINES=10
|
||||
export SXMO_BEMENU_LANDSCAPE_LINES=6
|
||||
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
export SXMO_WM=sway
|
||||
export SXMO_ROTATION=normal
|
||||
|
||||
# Native 1:1 240x320 QVGA resolution
|
||||
export SXMO_SWAY_SCALE=1
|
||||
|
||||
# Physical button mappings
|
||||
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
|
||||
export SXMO_VOLUME_UP_BUTTON="0:103:KEY_UP"
|
||||
export SXMO_VOLUME_DOWN_BUTTON="0:108:KEY_DOWN"
|
||||
export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
|
||||
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
|
||||
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
|
||||
|
||||
# Nokia 8110 4G has a physical keypad and no touchscreen
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export KEYBOARD_ARGS="-H 1 -L 1"
|
||||
export SXMO_MENU=wofi
|
||||
export SXMO_WOFI_LANDSCAPE_WIDTH=320
|
||||
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
|
||||
export SXMO_BEMENU_PORTRAIT_LINES=10
|
||||
export SXMO_BEMENU_LANDSCAPE_LINES=6
|
||||
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec sxmo_hook_inputhandler.sh "$@"
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
usage() {
|
||||
printf "usage: %s [reboot|poweroff|logout|togglewm]\n" "$(basename "$0")"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
reboot)
|
||||
sxmo_hook_power.sh reboot || true
|
||||
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
|
||||
sync
|
||||
(sleep 5; doas /sbin/reboot -f >/dev/null 2>&1) &
|
||||
doas /sbin/reboot || doas reboot || doas /sbin/reboot -f
|
||||
;;
|
||||
poweroff)
|
||||
sxmo_hook_power.sh poweroff || true
|
||||
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
|
||||
sync
|
||||
(sleep 5; doas /sbin/poweroff -f >/dev/null 2>&1) &
|
||||
doas /sbin/poweroff || doas poweroff || doas /sbin/poweroff -f
|
||||
;;
|
||||
logout)
|
||||
sxmo_hook_logout.sh || true
|
||||
case "$SXMO_WM" in
|
||||
"i3") i3-msg exit ;;
|
||||
"sway") swaymsg exit ;;
|
||||
"river") riverctl exit ;;
|
||||
"dwm") pkill dwm ;;
|
||||
esac
|
||||
;;
|
||||
togglewm) sxmo_togglewm.sh ;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# Run from sway.
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
monitor="${SXMO_MONITOR:-"$(swaymsg -t get_outputs | jq -r '.[0] | .name')"}"
|
||||
pwr="$SXMO_POWER_BUTTON"
|
||||
vols="$SXMO_VOLUME_BUTTON"
|
||||
|
||||
# Drop this when bonsai is available on 32 bits systems
|
||||
multikey_retrocompat() {
|
||||
sxmo_multikey.sh clear
|
||||
|
||||
if [ -n "$pwr" ]; then
|
||||
swaymsg -- input "$pwr" repeat_delay 200
|
||||
swaymsg -- input "$pwr" repeat_rate 15
|
||||
swaymsg -- bindsym --locked XF86PowerOff exec sxmo_multikey.sh \
|
||||
powerbutton \
|
||||
powerbutton_one \
|
||||
powerbutton_two \
|
||||
powerbutton_three
|
||||
else
|
||||
swaymsg -- bindsym --locked XF86PowerOff exec \
|
||||
sxmo_hook_inputhandler.sh powerbutton_one
|
||||
fi
|
||||
|
||||
if [ -n "$vols" ]; then
|
||||
for vol in $vols; do
|
||||
swaymsg -- input "$vol" repeat_delay 200
|
||||
swaymsg -- input "$vol" repeat_rate 15
|
||||
|
||||
swaymsg -- bindsym --locked --input-device="$vol" XF86AudioRaiseVolume exec \
|
||||
sxmo_multikey.sh \
|
||||
volup \
|
||||
volup_one \
|
||||
volup_two \
|
||||
volup_three
|
||||
|
||||
swaymsg -- bindsym --locked --input-device="$vol" XF86AudioLowerVolume exec \
|
||||
sxmo_multikey.sh \
|
||||
voldown \
|
||||
voldown_one \
|
||||
voldown_two \
|
||||
voldown_three
|
||||
done
|
||||
else
|
||||
swaymsg -- bindsym --locked XF86AudioRaiseVolume exec \
|
||||
sxmo_hook_inputhandler.sh volup_one
|
||||
swaymsg -- bindsym --locked XF86AudioLowerVolume exec \
|
||||
sxmo_hook_inputhandler.sh voldown_one
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -n "$SXMO_MODEM_GPIO_KEY_RI" ]; then
|
||||
# Disable the gpio-key-ri input devive
|
||||
# It will trigger idle wakeup on modem notification which break sxmo
|
||||
swaymsg -- input "$SXMO_MODEM_GPIO_KEY_RI" events disabled
|
||||
fi
|
||||
|
||||
if [ -n "$SXMO_SWAY_SCALE" ]; then
|
||||
swaymsg -- output "$monitor" scale "$SXMO_SWAY_SCALE"
|
||||
fi
|
||||
|
||||
swaymsg -- layout splitv >/dev/null 2>&1 || true
|
||||
swaymsg -- splitv >/dev/null 2>&1 || true
|
||||
|
||||
focused_name="$(
|
||||
swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
|
||||
)"
|
||||
swaymsg -- input type:touch map_to_output "$focused_name"
|
||||
swaymsg -- input type:tablet_tool map_to_output "$focused_name"
|
||||
|
||||
if [ -n "$SXMO_DISABLE_KEYBINDS" ]; then
|
||||
swaymsg -- bindsym --locked XF86PowerOff exec \
|
||||
sxmo_hook_inputhandler.sh powerbutton_one
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! command -v bonsaictl > /dev/null; then
|
||||
multikey_retrocompat
|
||||
exit
|
||||
fi
|
||||
|
||||
swaymsg -- bindsym --locked --no-repeat XF86PowerOff exec bonsaictl -e power_pressed
|
||||
swaymsg -- bindsym --locked --release XF86PowerOff exec bonsaictl -e power_released
|
||||
|
||||
swaymsg -- bindsym --locked --no-repeat XF86AudioRaiseVolume exec bonsaictl -e volup_pressed
|
||||
swaymsg -- bindsym --locked --release XF86AudioRaiseVolume exec bonsaictl -e volup_released
|
||||
|
||||
swaymsg -- bindsym --locked --no-repeat XF86AudioLowerVolume exec bonsaictl -e voldown_pressed
|
||||
swaymsg -- bindsym --locked --release XF86AudioLowerVolume exec bonsaictl -e voldown_released
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
change_alpine() {
|
||||
echo "Changing timezone to $1"
|
||||
|
||||
doas setup-timezone -z "$1"
|
||||
sxmo_hook_statusbar.sh time
|
||||
|
||||
echo "Timezone changed ok"
|
||||
}
|
||||
|
||||
change_systemd() {
|
||||
echo "Changing timezone to $1"
|
||||
|
||||
timedatectl set-timezone "$1"
|
||||
sxmo_hook_statusbar.sh time
|
||||
|
||||
echo "Timezone changed ok"
|
||||
}
|
||||
|
||||
menu() {
|
||||
zoneinfo_dir=$(xdg_data_path zoneinfo)
|
||||
T="$(
|
||||
find "$zoneinfo_dir" -type f |
|
||||
sed "s#^${zoneinfo_dir}/##g" |
|
||||
sort |
|
||||
sxmo_dmenu.sh -p Timezone -i
|
||||
)" || exit 0
|
||||
sxmo_terminal.sh "$0" "$T"
|
||||
}
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
trap "read -r" EXIT
|
||||
set -e
|
||||
|
||||
case "$SXMO_OS" in
|
||||
alpine|postmarketos|bananarchy) change_alpine "$@";;
|
||||
arch|archarm|debian) change_systemd "$@";;
|
||||
nixos) echo "Change the timezone in configuration.nix with time.timeZone = \"[timezone]\"";;
|
||||
*) echo "Changing the timezone isn't implemented on your distro yet";;
|
||||
esac
|
||||
else
|
||||
menu
|
||||
fi
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
trap "read -r" EXIT
|
||||
|
||||
update_apk() {
|
||||
echo "Updating all packages from repositories"
|
||||
doas apk update
|
||||
|
||||
echo "Upgrading all packages"
|
||||
doas apk upgrade -aiv
|
||||
|
||||
echo "Upgrade complete - reboot for all changes to take effect"
|
||||
}
|
||||
|
||||
update_pacman() {
|
||||
echo "Upgrading all packages"
|
||||
doas pacman -Syu
|
||||
|
||||
echo "Upgrade complete - reboot for all changes to take effect"
|
||||
}
|
||||
|
||||
update_nixos() {
|
||||
echo "Upgrading all packages"
|
||||
# nohup needed because nixos-rebuild might restart the display manager
|
||||
# (and thus the terminal we're running in) before the update is complete
|
||||
doas nohup nixos-rebuild switch --upgrade > /tmp/sxmo-last-upgrade.log &
|
||||
coreutils --coreutils-prog=tail -f /tmp/sxmo-last-upgrade.log --pid=$!
|
||||
|
||||
echo "Upgrade complete - reboot for all changes to take effect"
|
||||
}
|
||||
|
||||
sxmo_wakelock.sh lock sxmo_upgrading infinite
|
||||
|
||||
case "$SXMO_OS" in
|
||||
alpine|postmarketos|bananarchy) update_apk;;
|
||||
arch|archarm) update_pacman;;
|
||||
nixos) update_nixos;;
|
||||
esac
|
||||
|
||||
sxmo_wakelock.sh unlock sxmo_upgrading
|
||||
@@ -0,0 +1,533 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# shellcheck disable=SC2317 disable=SC2329
|
||||
# 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
|
||||
|
||||
swi3msg() {
|
||||
case "$SXMO_WM" in
|
||||
sway) swaymsg "$@" ;;
|
||||
i3) i3-msg "$@" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Output Power Management {{{
|
||||
xorgdisplay() {
|
||||
case "$1" in
|
||||
off)
|
||||
xset dpms 0 0 3
|
||||
xset dpms force off
|
||||
;;
|
||||
on)
|
||||
xset dpms 0 0 0
|
||||
xset dpms force on
|
||||
;;
|
||||
"")
|
||||
if xset q | grep -q "Off: 3"; then
|
||||
printf "off\n"
|
||||
else
|
||||
printf "on\n"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'sxmo_wm.sh display: unknown command "%s"\n' "$1" >&2
|
||||
printf 'Usage: sxmo_wm.sh display [on|off]\n' >&2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
wldisplay() {
|
||||
case "$1" in
|
||||
on) wlopm --on "*" ;;
|
||||
off) wlopm --off "*";;
|
||||
"")
|
||||
if wlopm | grep -q "on"; then
|
||||
printf "on\n"
|
||||
else
|
||||
printf "off\n"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'sxmo_wm.sh display: unknown command "%s"\n' "$1" >&2
|
||||
printf 'Usage: sxmo_wm.sh display [on|off]\n' >&2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
wm_generic_dpms() {
|
||||
sxmo_log "WARNING: $0: the dpms subcommand is deprecated, use display instead"
|
||||
|
||||
# The dpms command was origionally implemented with on/off being the
|
||||
# opposite of what they should have been. Swap them for backwards
|
||||
# compatability.
|
||||
case "$1" in
|
||||
on)
|
||||
shift
|
||||
set -- "off" "$@"
|
||||
;;
|
||||
off)
|
||||
shift
|
||||
set -- "on" "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
dispatch display "$@"
|
||||
}
|
||||
# }}}
|
||||
|
||||
# inputevent {{{
|
||||
xorginputevent() {
|
||||
if [ "$1" = "touchscreen" ]; then
|
||||
TOUCH_POINTER_ID="$SXMO_TOUCHSCREEN_ID"
|
||||
elif [ "$1" = "stylus" ]; then
|
||||
TOUCH_POINTER_ID="$SXMO_STYLUS_ID"
|
||||
fi
|
||||
|
||||
if [ -z "$TOUCH_POINTER_ID" ]; then
|
||||
echo "not found"
|
||||
return 0
|
||||
fi
|
||||
|
||||
STATE=off
|
||||
if xinput list-props "$TOUCH_POINTER_ID" | \
|
||||
grep "Device Enabled" | \
|
||||
grep -q "1$"; then
|
||||
STATE=on
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
printf %s "$STATE"
|
||||
elif [ "$2" = on ] && [ "$STATE" != on ]; then
|
||||
xinput enable "$TOUCH_POINTER_ID"
|
||||
elif [ "$2" = off ] && [ "$STATE" != off ] ; then
|
||||
xinput disable "$TOUCH_POINTER_ID"
|
||||
fi
|
||||
}
|
||||
|
||||
swayinputevent() {
|
||||
if [ "$1" = "touchscreen" ]; then
|
||||
TOUCH_POINTER_ID="touch"
|
||||
elif [ "$1" = "stylus" ]; then
|
||||
TOUCH_POINTER_ID="tablet_tool"
|
||||
fi
|
||||
|
||||
# If we dont have any matching input
|
||||
if ! swaymsg -t get_inputs \
|
||||
| jq -r ".[] | select(.type == \"$TOUCH_POINTER_ID\" )" \
|
||||
| grep -q .; then
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
printf "not found"
|
||||
exit 0
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
STATE=on
|
||||
if swaymsg -t get_inputs \
|
||||
| jq -r ".[] | select(.type == \"$TOUCH_POINTER_ID\" ) | .libinput.send_events" \
|
||||
| grep -q "disabled"; then
|
||||
STATE=off
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
printf %s "$STATE"
|
||||
elif [ "$2" = on ] && [ "$STATE" != on ]; then
|
||||
swaymsg "input type:$TOUCH_POINTER_ID events enabled" > /dev/null
|
||||
elif [ "$2" = off ] && [ "$STATE" != off ] ; then
|
||||
swaymsg "input type:$TOUCH_POINTER_ID events disabled" > /dev/null
|
||||
fi
|
||||
}
|
||||
# }}}
|
||||
|
||||
# focusedwindow {{{
|
||||
_xorgfocusedwindow() {
|
||||
xprop -id "$(xdotool getactivewindow 2>/dev/null)" 2>/dev/null | awk '
|
||||
/^WM_CLASS/ {
|
||||
sub(/^WM_CLASS[^=]*= ?"[^"]*", "/, "")
|
||||
sub(/"$/, "")
|
||||
class = $0
|
||||
}
|
||||
/^WM_NAME/ {
|
||||
sub(/^WM_NAME[^=]*= ?"/, "")
|
||||
sub(/"$/, "")
|
||||
title = $0
|
||||
}
|
||||
END { printf "%s\n%s\n", tolower(class), tolower(title) }
|
||||
'
|
||||
}
|
||||
|
||||
_swi3_focusedwindow() {
|
||||
swi3msg -t get_tree | jq -r '
|
||||
recurse(.nodes[]) |
|
||||
select(.focused == true) |
|
||||
{
|
||||
app_id: (if .app_id != null then
|
||||
.app_id
|
||||
else
|
||||
.window_properties.class
|
||||
end) | gsub("\n"; "\\n") | ascii_downcase,
|
||||
name: (.name | gsub("\n"; "\\n") | ascii_downcase),
|
||||
} |
|
||||
select(.app_id != null and .name != null) |
|
||||
"\(.app_id)\n\(.name)"
|
||||
'
|
||||
}
|
||||
|
||||
_raw_focusedwindow() {
|
||||
case "$SXMO_WM" in
|
||||
dwm) _xorgfocusedwindow ;;
|
||||
sway|i3) _swi3_focusedwindow ;;
|
||||
river) lswt -j | jq -r '
|
||||
.toplevels |
|
||||
map(select(.activated))[0] |
|
||||
(."app-id" | ascii_downcase), (.title | ascii_downcase)
|
||||
'
|
||||
esac
|
||||
}
|
||||
|
||||
wm_generic_focusedwindow() {
|
||||
if [ "$1" = "-r" ]; then
|
||||
_raw_focusedwindow
|
||||
else
|
||||
# This script originally output this format, which is a bit
|
||||
# harder to parse. Keep it for backwards compatibility in case
|
||||
# anyone was using it.
|
||||
_raw_focusedwindow | {
|
||||
read -r app
|
||||
read -r title
|
||||
printf "app: %s\ntitle: %s\n" "$app" "$title"
|
||||
}
|
||||
fi
|
||||
}
|
||||
# }}}
|
||||
|
||||
# paste {{{
|
||||
wlpaste() {
|
||||
wl-paste
|
||||
}
|
||||
|
||||
xorgpaste() {
|
||||
xclip -o
|
||||
}
|
||||
# }}}
|
||||
|
||||
# exec {{{
|
||||
wm_generic__swi3exec_inner() {
|
||||
cmd="$(cat "$1")"
|
||||
rm "$1"
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
swi3exec() {
|
||||
set -e
|
||||
|
||||
cmdfile="$(mktemp)"
|
||||
jq -r --null-input '$ARGS.positional | @sh' --args -- "$@" > "$cmdfile"
|
||||
|
||||
swi3msg exec "sxmo_wm.sh _swi3exec_inner '$cmdfile'" > /dev/null
|
||||
}
|
||||
|
||||
riverexec() {
|
||||
riverctl spawn "$@"
|
||||
}
|
||||
|
||||
xorgexec() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
"$@" &
|
||||
}
|
||||
# }}}
|
||||
|
||||
# execwait {{{
|
||||
wm_generic__execwait_inner() {
|
||||
notify_file="$1/done"
|
||||
shift
|
||||
|
||||
# This opens the pipe for writing, when this process exits it will be
|
||||
# closed, which will send eof to the monitoring process.
|
||||
exec 3>"$notify_file"
|
||||
|
||||
"$@"
|
||||
}
|
||||
|
||||
_execwait() {
|
||||
set -e
|
||||
runner="$1"
|
||||
shift
|
||||
|
||||
notify_dir="$(mktemp -d)"
|
||||
mkfifo "$notify_dir/done"
|
||||
|
||||
"$runner" sxmo_wm.sh _execwait_inner "$notify_dir" "$@"
|
||||
|
||||
exec 3<"$notify_dir/done"
|
||||
|
||||
# The exec line won't finish until the inner file has been opened for
|
||||
# writing, so it's safe to remove the temp dir here.
|
||||
rm -r "$notify_dir"
|
||||
|
||||
# Wait for the notification file to be closed
|
||||
read -r _ <&3 || true
|
||||
}
|
||||
|
||||
swi3execwait() {
|
||||
_execwait swi3exec "$@"
|
||||
}
|
||||
|
||||
riverexecwait() {
|
||||
_execwait riverexec "$@"
|
||||
}
|
||||
|
||||
xorgexecwait() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
exec "$@"
|
||||
}
|
||||
# }}}
|
||||
|
||||
# toggle layout {{{
|
||||
swi3togglelayout() {
|
||||
swi3msg "layout toggle splitv splith tabbed" > /dev/null
|
||||
}
|
||||
|
||||
dwmtogglelayout() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers key Super+space
|
||||
}
|
||||
|
||||
rivertogglelayout() {
|
||||
riverctl toggle-fullscreen
|
||||
}
|
||||
# }}}
|
||||
|
||||
# switch focus {{{
|
||||
i3switchfocus() {
|
||||
sxmo_wmmenu.sh i3windowswitcher
|
||||
}
|
||||
|
||||
swayswitchfocus() {
|
||||
sxmo_wmmenu.sh swaywindowswitcher
|
||||
}
|
||||
|
||||
dwmswitchfocus() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers Super+x
|
||||
}
|
||||
# }}}
|
||||
|
||||
# workspace switching {{{
|
||||
_swi3getcurrentworkspace() {
|
||||
swi3msg -t get_workspaces | jq -r '.[] | select(.focused).name'
|
||||
}
|
||||
|
||||
_swi3getnextworkspace() {
|
||||
value="$(($(_swi3getcurrentworkspace)+1))"
|
||||
if [ "$value" -eq "$((${SXMO_WORKSPACE_WRAPPING:-4}+1))" ]; then
|
||||
printf 1
|
||||
else
|
||||
printf %s "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
_swi3getpreviousworkspace() {
|
||||
value="$(($(_swi3getcurrentworkspace)-1))"
|
||||
if [ "$value" -lt 1 ]; then
|
||||
if [ "${SXMO_WORKSPACE_WRAPPING:-4}" -ne 0 ]; then
|
||||
printf %s "${SXMO_WORKSPACE_WRAPPING:-4}"
|
||||
else
|
||||
return 1 # cant have previous workspace
|
||||
fi
|
||||
else
|
||||
printf %s "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
swi3nextworkspace() {
|
||||
swi3msg "workspace $(_swi3getnextworkspace)" > /dev/null
|
||||
}
|
||||
|
||||
rivernextworkspace() {
|
||||
river-shifttags
|
||||
}
|
||||
|
||||
dwmnextworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers Super+Shift+r
|
||||
}
|
||||
|
||||
swi3previousworkspace() {
|
||||
swi3msg "workspace $(_swi3getpreviousworkspace )" > /dev/null
|
||||
}
|
||||
|
||||
dwmpreviousworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers Super+Shift+e
|
||||
}
|
||||
|
||||
riverpreviousworkspace() {
|
||||
river-shifttags --shift -1
|
||||
}
|
||||
|
||||
swi3movenextworkspace() {
|
||||
swi3msg "move container to workspace $(_swi3getnextworkspace)" > /dev/null
|
||||
}
|
||||
|
||||
dwmmovenextworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers Super+r
|
||||
}
|
||||
|
||||
swi3movepreviousworkspace() {
|
||||
swi3msg "move container to workspace $(_swi3getpreviousworkspace )" > /dev/null
|
||||
}
|
||||
|
||||
dwmmovepreviousworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers Super+e
|
||||
}
|
||||
|
||||
swi3workspace() {
|
||||
swi3msg "workspace $1" > /dev/null
|
||||
}
|
||||
|
||||
riverworkspace() {
|
||||
tags=$((1 << ($1 - 1)))
|
||||
riverctl set-focused-tags "$tags"
|
||||
}
|
||||
|
||||
dwmworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers "Super+$1"
|
||||
}
|
||||
|
||||
swi3moveworkspace() {
|
||||
swi3msg "move container to workspace $1" > /dev/null
|
||||
}
|
||||
|
||||
rivermoveworkspace() {
|
||||
tags=$((1 << ($1 - 1)))
|
||||
riverctl set-view-tags "$tags"
|
||||
}
|
||||
|
||||
dwmmoveworkspace() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers "Super+shift+$1"
|
||||
}
|
||||
# }}}
|
||||
|
||||
# toggle bar {{{
|
||||
swi3togglebar() {
|
||||
swi3msg "bar mode toggle" > /dev/null
|
||||
}
|
||||
|
||||
dwmtogglebar() {
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
export DISPLAY=:0
|
||||
fi
|
||||
xdotool key --clearmodifiers "Super+b"
|
||||
}
|
||||
|
||||
rivertogglebar() {
|
||||
if superctl status sxmo_riverbar | grep -q started; then
|
||||
superctl stop sxmo_riverbar
|
||||
else
|
||||
superctl start sxmo_riverbar
|
||||
fi
|
||||
}
|
||||
# }}}
|
||||
|
||||
# configmenuentry {{{
|
||||
wm_generic_configmenuentry() {
|
||||
case "$SXMO_WM" in
|
||||
dwm)
|
||||
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/xinit"
|
||||
;;
|
||||
i3)
|
||||
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/i3"
|
||||
;;
|
||||
river)
|
||||
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/river"
|
||||
;;
|
||||
sway)
|
||||
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/sway"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
# }}}
|
||||
|
||||
dispatch() {
|
||||
if [ "$#" -lt 1 ]; then
|
||||
echo "Usage: sxmo_wm.sh <command>" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
action="$1"
|
||||
shift
|
||||
|
||||
# invoke action covering single wm
|
||||
if type "$SXMO_WM$action" >/dev/null 2>&1; then
|
||||
"$SXMO_WM$action" "$@"
|
||||
return
|
||||
fi
|
||||
|
||||
# invoke action covering multiple wms
|
||||
if [ "$SXMO_WM" = "sway" ] || [ "$SXMO_WM" = "i3" ]; then
|
||||
if type "swi3$action" >/dev/null 2>&1; then
|
||||
"swi3$action" "$@"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
# invoke action covering all of xorg/wayland
|
||||
case "$SXMO_WM" in
|
||||
dwm|i3)
|
||||
if type "xorg$action" >/dev/null 2>&1; then
|
||||
"xorg$action" "$@"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
sway|river)
|
||||
# We don't yet support everything
|
||||
if type "wl$action" >/dev/null 2>&1; then
|
||||
"wl$action" "$@"
|
||||
return
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# invoke action covering all wms
|
||||
if type "wm_generic_$action" >/dev/null 2>&1; then
|
||||
"wm_generic_$action" "$@"
|
||||
return
|
||||
else
|
||||
printf "%s not implemented for %s\n" "$action" "$SXMO_WM" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
dispatch "$@"
|
||||
@@ -0,0 +1,429 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# this script is a menu which lets the user perform some WM actions.
|
||||
|
||||
# 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
|
||||
|
||||
set -e
|
||||
|
||||
_movetowssubmenu() {
|
||||
for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
|
||||
printf "%s Move to WS %s\n" "$ws" "$ws"
|
||||
done
|
||||
}
|
||||
|
||||
# A menu which allows to move windows or toggle floating.
|
||||
swaymovemenu() {
|
||||
CHOICES="$(cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_aru Move Up
|
||||
$icon_ard Move Down
|
||||
$icon_arl Move Left
|
||||
$icon_arr Move Right
|
||||
$icon_wn2 Toggle Floating
|
||||
$icon_ac1 Move Scratchpad
|
||||
$(_movetowssubmenu)
|
||||
EOF
|
||||
)"
|
||||
|
||||
MOVEINDEX=0
|
||||
while : ; do
|
||||
# Remove current workspace from the list
|
||||
CHOICES="$(
|
||||
printf "%s" "$CHOICES" |
|
||||
grep -v "$(
|
||||
swaymsg -t get_workspaces |
|
||||
jq -r '
|
||||
.[] | select(.focused).name
|
||||
')"
|
||||
)"
|
||||
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$MOVEINDEX" -p "Move menu")"
|
||||
MOVEINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
?" Move to WS "?)
|
||||
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
|
||||
return
|
||||
;;
|
||||
"$icon_wn2 Toggle Floating")
|
||||
swaymsg floating toggle
|
||||
;;
|
||||
*)
|
||||
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# The generic sway menu
|
||||
swaywmmenu() {
|
||||
WMINDEX=0
|
||||
|
||||
while : ; do
|
||||
# generate layout line with format "current → next → 2nd next"
|
||||
CURRENT_LAYOUT="$(
|
||||
swaymsg -t get_tree |
|
||||
jq -r 'recurse(.nodes[]) |
|
||||
if select(.nodes[].focused).layout=="output" then
|
||||
select(.nodes[].focused).nodes[].layout
|
||||
else select(.nodes[].focused).layout end'
|
||||
)"
|
||||
if [ -n "$CURRENT_LAYOUT" ]; then
|
||||
if [ "$CURRENT_LAYOUT" = "splitv" ]; then
|
||||
LAYOUT_LINE="splitv $icon_arr splith $icon_arr tabbed"
|
||||
elif [ "$CURRENT_LAYOUT" = "splith" ]; then
|
||||
LAYOUT_LINE="splith $icon_arr tabbed $icon_arr splitv"
|
||||
else
|
||||
LAYOUT_LINE="tabbed $icon_arr splitv $icon_arr splith"
|
||||
fi
|
||||
fi
|
||||
CHOICES="$(grep . <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_win Next window
|
||||
$icon_mov Move menu
|
||||
$icon_rld Switch menu
|
||||
$([ -n "$CURRENT_LAYOUT" ] && printf "%s" "$icon_rld $LAYOUT_LINE")
|
||||
$icon_mnu Split vertical
|
||||
$icon_grd Split horizontal
|
||||
$icon_tab Tabbed layout
|
||||
$icon_exp Focus parent
|
||||
$icon_trh Kill window
|
||||
EOF
|
||||
)"
|
||||
PICKED="$(printf "%s" "$CHOICES" | grep . | dmenu -I "$WMINDEX" -p "WM Menu")"
|
||||
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
"$icon_win Next window")
|
||||
swaymsg focus next
|
||||
return
|
||||
;;
|
||||
"$icon_mov Move menu")
|
||||
swaymovemenu
|
||||
;;
|
||||
"$icon_rld Switch menu")
|
||||
swaywindowswitcher
|
||||
;;
|
||||
"$icon_rld $LAYOUT_LINE")
|
||||
sxmo_wm.sh togglelayout
|
||||
;;
|
||||
"$icon_mnu Split vertical")
|
||||
swaymsg layout splitv
|
||||
swaymsg splitv
|
||||
return
|
||||
;;
|
||||
"$icon_grd Split horizontal")
|
||||
swaymsg layout splith
|
||||
swaymsg splith
|
||||
return
|
||||
;;
|
||||
"$icon_tab Tabbed layout")
|
||||
swaymsg layout tabbed
|
||||
return
|
||||
;;
|
||||
"$icon_exp Focus parent")
|
||||
swaymsg focus parent
|
||||
;;
|
||||
"$icon_trh Kill window")
|
||||
sxmo_killwindow.sh
|
||||
;;
|
||||
*)
|
||||
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# The generic river menu
|
||||
riverwmmenu() {
|
||||
WMINDEX=0
|
||||
|
||||
while : ; do
|
||||
# For now justs swap between fullscreen and tiled.
|
||||
LAYOUT_LINE="tiled $icon_arr fullscreen"
|
||||
CHOICES="$(grep . <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_mov Move menu
|
||||
$icon_rld Switch menu
|
||||
$(printf "%s" "$icon_rld $LAYOUT_LINE")
|
||||
$icon_trh Kill window
|
||||
EOF
|
||||
)"
|
||||
PICKED="$(printf "%s" "$CHOICES" | grep . | dmenu -I "$WMINDEX" -p "WM Menu")"
|
||||
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
"$icon_mov Move menu")
|
||||
rivermovemenu
|
||||
;;
|
||||
"$icon_rld Switch menu")
|
||||
riverwindowswitcher
|
||||
;;
|
||||
"$icon_rld $LAYOUT_LINE")
|
||||
sxmo_wm.sh togglelayout
|
||||
;;
|
||||
"$icon_trh Kill window")
|
||||
sxmo_killwindow.sh
|
||||
;;
|
||||
*)
|
||||
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_rivermovetowssubmenu() {
|
||||
for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-9}"); do
|
||||
printf "%s Move to WS %s\n" "$ws" "$ws"
|
||||
done
|
||||
}
|
||||
|
||||
# A menu which allows to move windows or toggle floating.
|
||||
rivermovemenu() {
|
||||
CHOICES="$(cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_wn2 Toggle Floating
|
||||
$(_rivermovetowssubmenu)
|
||||
EOF
|
||||
)"
|
||||
|
||||
MOVEINDEX=0
|
||||
while : ; do
|
||||
# Remove current workspace from the list
|
||||
CHOICES="$(
|
||||
printf "%s" "$CHOICES" |
|
||||
grep -v "$(
|
||||
river-bedload -print focused |
|
||||
jq -r ' .[] | .focused_id')"
|
||||
)"
|
||||
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$MOVEINDEX" -p "Move menu")"
|
||||
MOVEINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
?" Move to WS "?)
|
||||
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
|
||||
return
|
||||
;;
|
||||
"$icon_wn2 Toggle Floating")
|
||||
riverctl toggle-float
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
riverwindowswitcher() {
|
||||
SWITCHINDEX=0
|
||||
|
||||
while : ; do
|
||||
# There is currently no easy in river to get the tag of a given window,
|
||||
# skip the window part of this menu for now.
|
||||
|
||||
# Get the container ID from the node tree
|
||||
CHOICES="$(
|
||||
cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_arl Previous Workspace
|
||||
$icon_arr Next Workspace
|
||||
$(_rivermovetowssubmenu | grep -v "$(
|
||||
river-bedload -print focused |
|
||||
jq -r ' .[] | .focused_id')")
|
||||
EOF
|
||||
)"
|
||||
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
|
||||
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
"$icon_arr Next Workspace")
|
||||
sxmo_wm.sh nextworkspace
|
||||
;;
|
||||
"$icon_arl Previous Workspace")
|
||||
sxmo_wm.sh previousworkspace
|
||||
;;
|
||||
?" Move to WS "?)
|
||||
sxmo_wm.sh workspace "${PICKED%" Move to WS "?}"
|
||||
return
|
||||
;;
|
||||
## When we'll have proper window switching:
|
||||
# *)
|
||||
# # Requires the actual `id` to be at the end and between parentheses
|
||||
# CON_ID=${PICKED##*(}
|
||||
# CON_ID=${CON_ID%)}
|
||||
# swaymsg "[con_id=$CON_ID]" focus
|
||||
# ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
dwmwmmenu() {
|
||||
WMINDEX=0
|
||||
|
||||
while : ; do
|
||||
CHOICES="$(
|
||||
cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$(_movetowssubmenu)
|
||||
$icon_rld Shift stack
|
||||
$icon_grd Toggle Layout
|
||||
$icon_trh Kill window
|
||||
EOF
|
||||
)"
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$WMINDEX" -p "WM Menu")"
|
||||
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
?" Move to WS "?)
|
||||
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
|
||||
;;
|
||||
"$icon_rld Shift stack")
|
||||
sxmo_wm.sh switchfocus
|
||||
;;
|
||||
"$icon_grd Toggle Layout")
|
||||
sxmo_wm.sh togglelayout
|
||||
;;
|
||||
"$icon_trh Kill window")
|
||||
sxmo_killwindow.sh
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
i3windowswitcher() {
|
||||
SWITCHINDEX=0
|
||||
|
||||
while : ; do
|
||||
FORMAT='"W:" + .workspace + " | " + .app_id + " - " + .name + " (" + .id + ")"'
|
||||
|
||||
WINDOWSLIST="$(
|
||||
i3-msg -t get_tree |
|
||||
jq -r ".nodes[]
|
||||
| {output: .name, content: .nodes[]}
|
||||
| {output: .output, workspace: .content.name, apps: .content
|
||||
| ..
|
||||
| {id: .id?|tostring, name: .name?, app_id: .app_id?, shell: .shell?}
|
||||
| select(.app_id != null or .shell != null)}
|
||||
| {output: .output, workspace: .workspace,
|
||||
id: .apps.id, app_id: .apps.app_id, name: .apps.name }
|
||||
| $FORMAT
|
||||
| tostring
|
||||
"
|
||||
)"
|
||||
|
||||
# Get the container ID from the node tree
|
||||
CHOICES="$(
|
||||
cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_arl Previous Workspace
|
||||
$icon_arr Next Workspace
|
||||
$WINDOWSLIST
|
||||
EOF
|
||||
)"
|
||||
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
|
||||
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
"$icon_arr Next Workspace")
|
||||
sxmo_wm.sh nextworkspace
|
||||
;;
|
||||
"$icon_arl Previous Workspace")
|
||||
sxmo_wm.sh previousworkspace
|
||||
;;
|
||||
*)
|
||||
# Requires the actual `id` to be at the end and between parentheses
|
||||
CON_ID=${PICKED##*(}
|
||||
CON_ID=${CON_ID%)}
|
||||
i3-msg "[con_id=$CON_ID]" focus
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
swaywindowswitcher() {
|
||||
SWITCHINDEX=0
|
||||
|
||||
while : ; do
|
||||
FORMAT='"W:" + .workspace + " | " + .app_id + " - " + .name + " (" + .id + ")"'
|
||||
|
||||
WINDOWSLIST="$(
|
||||
swaymsg -t get_tree |
|
||||
jq -r ".nodes[]
|
||||
| {output: .name, content: .nodes[]}
|
||||
| {output: .output, workspace: .content.name, apps: .content
|
||||
| ..
|
||||
| {id: .id?|tostring, name: .name?, app_id: .app_id?, shell: .shell?}
|
||||
| select(.app_id != null or .shell != null)}
|
||||
| {output: .output, workspace: .workspace,
|
||||
id: .apps.id, app_id: .apps.app_id, name: .apps.name }
|
||||
| $FORMAT
|
||||
| tostring
|
||||
"
|
||||
)"
|
||||
|
||||
# Get the container ID from the node tree
|
||||
CHOICES="$(
|
||||
cat <<EOF
|
||||
$icon_cls Close Menu
|
||||
$icon_arl Previous Workspace
|
||||
$icon_arr Next Workspace
|
||||
$WINDOWSLIST
|
||||
EOF
|
||||
)"
|
||||
|
||||
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
|
||||
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
|
||||
|
||||
case "$PICKED" in
|
||||
""|"$icon_cls Close Menu")
|
||||
return
|
||||
;;
|
||||
"$icon_arr Next Workspace")
|
||||
sxmo_wm.sh nextworkspace
|
||||
;;
|
||||
"$icon_arl Previous Workspace")
|
||||
sxmo_wm.sh previousworkspace
|
||||
;;
|
||||
*)
|
||||
# Requires the actual `id` to be at the end and between parentheses
|
||||
CON_ID=${PICKED##*(}
|
||||
CON_ID=${CON_ID%)}
|
||||
swaymsg "[con_id=$CON_ID]" focus
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
"$SXMO_WM$1"
|
||||
exit
|
||||
fi
|
||||
case "$SXMO_WM" in
|
||||
dwm|i3) dwmwmmenu ;;
|
||||
sway) swaywmmenu ;;
|
||||
river) riverwmmenu ;;
|
||||
esac
|
||||
@@ -0,0 +1,15 @@
|
||||
# Use case configuration for common MSM8916 devices. No SecondaryMic.
|
||||
# All analog outputs/inputs connected to internal PM8916 codec.
|
||||
|
||||
Define {
|
||||
WcdPlaybackPCM "hw:${CardId},0"
|
||||
WcdCapturePCM "hw:${CardId},1"
|
||||
}
|
||||
<platforms/msm8916/qdsp6-components.conf>
|
||||
|
||||
<codecs/msm8916-wcd/Speaker.conf>
|
||||
<codecs/msm8916-wcd/Earpiece.conf>
|
||||
<codecs/msm8916-wcd/Headphones.conf>
|
||||
|
||||
<codecs/msm8916-wcd/PrimaryMic.conf>
|
||||
<codecs/msm8916-wcd/HeadsetMic.conf>
|
||||
@@ -0,0 +1,6 @@
|
||||
Syntax 3
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "HiFi.conf"
|
||||
Comment "Play and record HiFi quality Music"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
# Use case configuration for common MSM8916 devices.
|
||||
# All analog outputs/inputs connected to internal PM8916 codec.
|
||||
|
||||
Define {
|
||||
WcdPlaybackPCM "hw:${CardId},0"
|
||||
WcdCapturePCM "hw:${CardId},1"
|
||||
}
|
||||
<platforms/msm8916/qdsp6-components.conf>
|
||||
|
||||
<codecs/msm8916-wcd/Speaker.conf>
|
||||
<codecs/msm8916-wcd/Earpiece.conf>
|
||||
<codecs/msm8916-wcd/Headphones.conf>
|
||||
|
||||
<codecs/msm8916-wcd/PrimaryMic.conf>
|
||||
<codecs/msm8916-wcd/SecondaryMic.conf>
|
||||
<codecs/msm8916-wcd/HeadsetMic.conf>
|
||||
@@ -0,0 +1,6 @@
|
||||
Syntax 3
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "HiFi.conf"
|
||||
Comment "Play and record HiFi quality Music"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Addon]
|
||||
Name=t9
|
||||
Category=InputMethod
|
||||
Enabled=True
|
||||
Library=t9
|
||||
Type=SharedLibrary
|
||||
OnDemand=False
|
||||
RegisterInputMethod=True
|
||||
Configurable=False
|
||||
|
||||
[Addon/Dependencies]
|
||||
0=core
|
||||
@@ -0,0 +1,7 @@
|
||||
[InputMethod]
|
||||
Name=T9
|
||||
Icon=input-keyboard
|
||||
Label=T9
|
||||
LangCode=en
|
||||
Addon=t9
|
||||
Configurable=False
|
||||
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 801 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 320 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
@@ -0,0 +1,5 @@
|
||||
/lib/firmware/nokia,argon-gc9305-v2-panel.bin
|
||||
/lib/firmware/nokia,beatles-gc9305-panel.bin
|
||||
/lib/firmware/nokia,coconut-gc9305-panel.bin
|
||||
/lib/firmware/nokia,sparkler-gc9307-hlt-28-panel.bin
|
||||
/lib/firmware/nokia,leo-gc9305-hlt-24-panel.bin
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,18 @@
|
||||
-- Space to setup configversion
|
||||
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
|
||||
conky.config = {
|
||||
out_to_x = false,
|
||||
out_to_wayland = true,
|
||||
alignment = 'top_middle',
|
||||
gap_y = 12,
|
||||
own_window_argb_value = 0,
|
||||
own_window_type = 'desktop',
|
||||
default_shade_color = 'black',
|
||||
draw_shades = true,
|
||||
font = 'Sxmo:size=13',
|
||||
use_xft = true,
|
||||
update_interval = 15,
|
||||
}
|
||||
|
||||
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
|
||||
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
|
||||
@@ -0,0 +1,37 @@
|
||||
# Space to setup configversion
|
||||
# configversion: 75e8b9c31a47e01f21724c1e3beefc69
|
||||
[global]
|
||||
width = 230
|
||||
height = 120
|
||||
offset = (5,26)
|
||||
padding = 4
|
||||
horizontal_padding = 6
|
||||
frame_width = 2
|
||||
frame_color = "#005577"
|
||||
idle_threshold = 120
|
||||
font = Monospace 12
|
||||
markup = full
|
||||
max_icon_size = 24
|
||||
dmenu = sxmo_dmenu.sh -p dunst:
|
||||
follow=mouse
|
||||
mouse_left_click = do_action, close_current
|
||||
|
||||
[shortcuts]
|
||||
close_all = ctrl+shift+space
|
||||
|
||||
[urgency_low]
|
||||
background = "#222222"
|
||||
foreground = "#cccccc"
|
||||
timeout = 8
|
||||
|
||||
[urgency_normal]
|
||||
background = "#1c1c1c"
|
||||
foreground = "#ffffff"
|
||||
frame_color = "#005577"
|
||||
timeout = 12
|
||||
|
||||
[urgency_critical]
|
||||
background = "#900000"
|
||||
foreground = "#ffffff"
|
||||
frame_color = "#ff0000"
|
||||
timeout = 0
|
||||
@@ -0,0 +1,40 @@
|
||||
# Space to setup configversion
|
||||
# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
|
||||
font=monospace:size=13
|
||||
dpi-aware=no
|
||||
pad=2x2
|
||||
|
||||
[colors-dark]
|
||||
# alpha=1.0
|
||||
foreground=eaeaea
|
||||
background=000000
|
||||
regular0=000000 # black
|
||||
regular1=d54e53 # red
|
||||
regular2=b9ca4a # green
|
||||
regular3=e6c547 # yellow
|
||||
regular4=7aa6da # blue
|
||||
regular5=c397d8 # magenta
|
||||
regular6=70c0ba # cyan
|
||||
regular7=eaeaea # white
|
||||
bright0=666666 # bright black
|
||||
bright1=ff3334 # bright red
|
||||
bright2=9ec400 # bright green
|
||||
bright3=e7c547 # bright yellow
|
||||
bright4=7aa6da # bright blue
|
||||
bright5=b77ee0 # bright magenta
|
||||
bright6=54ced6 # bright cyan
|
||||
bright7=ffffff # bright white
|
||||
|
||||
[scrollback]
|
||||
lines=5000
|
||||
|
||||
[key-bindings]
|
||||
scrollback-up-page=Shift+Page_Up
|
||||
scrollback-down-page=Shift+Page_Down
|
||||
scrollback-up-half-page=Page_Up
|
||||
scrollback-down-half-page=Page_Down
|
||||
scrollback-up-line=Shift+Up
|
||||
scrollback-down-line=Shift+Down
|
||||
scrollback-home=Shift+Home
|
||||
scrollback-end=Shift+End
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
# Default config for sway
|
||||
# configversion: 076611fe8cc699bcaa01092a8e4481c0
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term sxmo_terminal.sh
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
set $menu bemenu-run
|
||||
|
||||
font "Sxmo 13"
|
||||
xwayland disable
|
||||
output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
|
||||
default_orientation vertical
|
||||
|
||||
exec_always sxmo_swayinitconf.sh
|
||||
|
||||
exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
|
||||
|
||||
mode "menu" {
|
||||
bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
|
||||
bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym XF86AudioRaiseVolume exec wtype -k Up
|
||||
bindsym XF86AudioLowerVolume exec wtype -k Down
|
||||
bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
|
||||
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
|
||||
}
|
||||
|
||||
# Mode specifically for use with Nokia N900 hardware keyboard
|
||||
mode "N900" {
|
||||
# follow the standard sxmo keybinds as far as possible
|
||||
bindsym t exec $term; mode "default"
|
||||
bindsym q mode "default"
|
||||
bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
|
||||
bindsym p exec sxmo_appmenu.sh; mode "default"
|
||||
bindsym d exec $menu; mode "default"
|
||||
bindsym Shift+q kill; mode "default"
|
||||
bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
|
||||
bindsym Shift+c reload; mode "default"
|
||||
bindsym f fullscreen; mode "default"
|
||||
bindsym Shift+space floating toggle; mode "default"
|
||||
bindsym a focus parent; mode "default"
|
||||
}
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
input * xkb_options compose:ralt
|
||||
|
||||
# Nokia N900 hardware keyboard
|
||||
input "1:1:TWL4030_Keypad" {
|
||||
xkb_model "nokiarx51"
|
||||
xkb_layout "us"
|
||||
# ralt has special meaning on N900 keyboard so do not use as
|
||||
# compose key
|
||||
xkb_options compose:rwin
|
||||
}
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Launch appmenu
|
||||
bindsym $mod+p exec sxmo_appmenu.sh
|
||||
bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
|
||||
|
||||
# Wm menu switcher
|
||||
bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# Start your launcher
|
||||
bindsym $mod+d exec $menu
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
# Exit sway (logs you out of your Wayland session)
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# Move the focused workspace to output
|
||||
bindsym $mod+Shift+Ctrl+$left move workspace output left
|
||||
bindsym $mod+Shift+Ctrl+$down move workspace output down
|
||||
bindsym $mod+Shift+Ctrl+$up move workspace output up
|
||||
bindsym $mod+Shift+Ctrl+$right move workspace output right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace number 1
|
||||
bindsym $mod+2 workspace number 2
|
||||
bindsym $mod+3 workspace number 3
|
||||
bindsym $mod+4 workspace number 4
|
||||
bindsym $mod+5 workspace number 5
|
||||
bindsym $mod+6 workspace number 6
|
||||
bindsym $mod+7 workspace number 7
|
||||
bindsym $mod+8 workspace number 8
|
||||
bindsym $mod+9 workspace number 9
|
||||
bindsym $mod+0 workspace number 10
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+b splith
|
||||
bindsym $mod+v splitv
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# Manual locker
|
||||
bindsym $mod+g exec sxmo_state.sh set locker
|
||||
|
||||
# Shutdown
|
||||
bindsym $mod+t exec sxmo_appmenu.sh power
|
||||
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 30px
|
||||
bindsym $down resize grow height 30px
|
||||
bindsym $up resize shrink height 30px
|
||||
bindsym $right resize grow width 30px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 30px
|
||||
bindsym Down resize grow height 30px
|
||||
bindsym Up resize shrink height 30px
|
||||
bindsym Right resize grow width 30px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
# Read `man 5 sway-bar` for more information about this section.
|
||||
bar {
|
||||
position top
|
||||
height 24
|
||||
font "Sxmo 13"
|
||||
|
||||
# When the status_command prints a new line to stdout, swaybar updates.
|
||||
# The default just shows the current date and time.
|
||||
status_command sxmo_status_watch.sh -o pango
|
||||
|
||||
pango_markup enabled
|
||||
|
||||
colors {
|
||||
statusline #ffffff
|
||||
background #323232
|
||||
inactive_workspace #323232 #323232 #ffffff
|
||||
font "Sxmo 13"
|
||||
}
|
||||
}
|
||||
|
||||
for_window [app_id="pinentry-.*"] floating true
|
||||
for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
|
||||
for_window [title="megapixels"] inhibit_idle open
|
||||
for_window [title="ep[yr].*"] inhibit_idle visible
|
||||
|
||||
default_border pixel 2
|
||||
titlebar_border_thickness 2
|
||||
hide_edge_borders smart
|
||||
|
||||
# Need playerctl installed and running
|
||||
bindsym --locked XF86AudioPlay exec playerctl play-pause
|
||||
bindsym --locked XF86AudioPause exec playerctl play-pause
|
||||
bindsym --locked XF86AudioStop exec playerctl stop
|
||||
bindsym --locked XF86AudioNext exec playerctl next
|
||||
bindsym --locked XF86AudioPrev exec playerctl previous
|
||||
|
||||
bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
|
||||
bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
|
||||
|
||||
# Nokia N900-specific key bindings:
|
||||
# 1. Bind lock key (XF86ScreenSaver)
|
||||
# Use keycode due to https://github.com/swaywm/sway/issues/8438
|
||||
bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
|
||||
# 2. Workaround the lack of a free ModX key on hardware keyboard
|
||||
bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
|
||||
|
||||
bindsym Print exec sxmo_screenshot.sh
|
||||
|
||||
bindsym button2 kill
|
||||
|
||||
bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
|
||||
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
|
||||
|
||||
# Nokia 8110 4G hardware keypad bindings (User:Ybon)
|
||||
bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
|
||||
bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
|
||||
bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
|
||||
|
||||
include /etc/sway/config.d/*
|
||||
|
||||
exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
|
||||
|
||||
exec sxmo_hook_start.sh
|
||||
|
||||
# vim: ft=swayconfig
|
||||
@@ -0,0 +1,6 @@
|
||||
# Space to setup configversion
|
||||
# configversion: 4de2da84af48414f557742c29bde606e
|
||||
anchor = top
|
||||
width = 220
|
||||
height = 28
|
||||
margin = 28
|
||||
@@ -0,0 +1,51 @@
|
||||
/* Space to setup configversion */
|
||||
/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
|
||||
* {
|
||||
font-family: monospace;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
window {
|
||||
margin: 0px;
|
||||
border: 2px solid #005577;
|
||||
background-color: #1c1c1c;
|
||||
}
|
||||
|
||||
#input {
|
||||
margin: 0px;
|
||||
padding: 4px 6px;
|
||||
border-radius: 0px;
|
||||
border: 1px solid #005577;
|
||||
background-color: #383838;
|
||||
color: #ffffff;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
margin: 0px;
|
||||
color: #ffdd00;
|
||||
}
|
||||
|
||||
#text {
|
||||
margin: 1px 4px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#entry {
|
||||
padding: 3px 2px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
background-color: #005577;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,18 @@
|
||||
-- Space to setup configversion
|
||||
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
|
||||
conky.config = {
|
||||
out_to_x = false,
|
||||
out_to_wayland = true,
|
||||
alignment = 'top_middle',
|
||||
gap_y = 12,
|
||||
own_window_argb_value = 0,
|
||||
own_window_type = 'desktop',
|
||||
default_shade_color = 'black',
|
||||
draw_shades = true,
|
||||
font = 'Sxmo:size=13',
|
||||
use_xft = true,
|
||||
update_interval = 15,
|
||||
}
|
||||
|
||||
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
|
||||
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
|
||||
@@ -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
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 34 KiB |