Actually add wireless.sh

This commit is contained in:
Katie 2022-06-28 06:32:02 -05:00
parent 7d42e82b19
commit bccdf862c8
5 changed files with 167 additions and 0 deletions

3
.Xresources Normal file
View file

@ -0,0 +1,3 @@
dmenu.font=12
dwm.font=12
st.font=12

7
.config/bspwm/bspwm-session.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
xrandr --output DSI-1 --primary &
#nitrogen --restore &
#xsettingsd &
#picom -f & > /dev/null 2>&1
exec bspwm

View file

@ -0,0 +1,58 @@
#!/bin/bash
#INTERFACE="/sys/class/net/wwan0"
ICONFONT=8
STATE="$(mmcli -m any | grep 'state:' | tr -d ' ' | cut -d ':' -f 2 | cut -d '%' -f 1)"
SIGNAL="$(mmcli -m any | grep 'signal quality:' | tr -d ' ' | cut -d ':' -f 2 | cut -d '%' -f 1)"
CARRIER="$(mmcli -m any | grep 'operator name:' | tr -d ' ' | cut -d ':' -f 2 | cut -d '%' -f 1)"
# These are intervals of 16%.
#CHAR_NOSIGNAL=""
#CHAR_SIGNAL1=""
#CHAR_SIGNAL2=""
#CHAR_SIGNAL3=""
#CHAR_SIGNAL4=""
#CHAR_SIGNAL5=""
CHAR_NOSIGNAL=""
CHAR_SIGNAL1=""
CHAR_SIGNAL2=""
CHAR_SIGNAL3=""
CHAR_SIGNAL4=""
CHAR_SIGNAL5=""
#echo $STATE
#echo $SIGNAL
#echo $CARRIER
printicon() {
echo -n "%{T$ICONFONT}$1%{T-} "
#echo -n "$1"
}
if [[ "$STATE" != *"connected"* ]]; then
#if [[ "$STATE" != "connected on" ]]; then
#echo "$CHAR_NOSIGNAL N/A"
printicon $CHAR_NOSIGNAL
echo "N/A"
exit 0
fi
# This is ugly
if [[ "$SIGNAL" -lt "16" ]]; then
$CHAR_SIGNAL1
printicon $CHAR_SIGNAL1
elif [[ "$SIGNAL" -lt "32" ]]; then
printicon $CHAR_SIGNAL2
elif [[ "$SIGNAL" -lt "38" ]]; then
printicon $CHAR_SIGNAL3
elif [[ "$SIGNAL" -lt "64" ]]; then
printicon $CHAR_SIGNAL4
elif [[ "$SIGNAL" -lt "80" ]]; then
printicon $CHAR_SIGNAL5
fi
echo "$CARRIER"

View file

@ -0,0 +1,94 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
envvars() {
export SXMO_WM=dwm
# SXMO_CUSTOMWM is used for the project's custom hooks. This maintains compatibility with DWM and Sway.
export SXMO_CUSTOMWM=bspwm
# SXMO_SUSPENDCLOCK defines the clock speed the phone will transition to when suspending.
# SXMO_DEFAULTCLOCK defines the normal clock speed the phone will use. It will return to this upon leaving suspension.
#export SXMO_SUSPENDCLOCK=310000
#export SXMO_DEFAULTCLOCK=$()
# shellcheck disable=SC2086
command -v $TERMCMD "" >/dev/null || export TERMCMD="st"
command -v "$KEYBOARD" >/dev/null || defaultkeyboard
[ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1
}
defaults() {
xmodmap /usr/share/sxmo/appcfg/xmodmap_caps_esc
xsetroot -mod 29 29 -fg '#0b3a4c' -bg '#082430'
xset s off -dpms
for xr in /usr/share/sxmo/appcfg/*.xr; do
xrdb -merge "$xr"
done
[ -e "$HOME"/.Xresources ] && xrdb -merge "$HOME"/.Xresources
SCREENWIDTH=$(xrandr | grep "Screen 0" | cut -d" " -f 8)
SCREENHEIGHT=$(xrandr | grep "Screen 0" | cut -d" " -f 10 | tr -d ",")
if [ "$SCREENWIDTH" -lt 1024 ] || [ "$SCREENHEIGHT" -lt 768 ]; then
gsettings set org.gtk.Settings.FileChooser window-size "($SCREENWIDTH,$((SCREENHEIGHT / 2)))"
fi
}
defaultkeyboard() {
if command -v svkbd-mobile-intl >/dev/null; then
export KEYBOARD=svkbd-mobile-intl
elif command -v svkbd-mobile-plain >/dev/null; then
export KEYBOARD=svkbd-mobile-plain
else
#legacy
export KEYBOARD=svkbd-sxmo
fi
}
with_dbus() {
echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR"/dbus.bus
# shellcheck source=configs/appcfg/xinit_template
. "$XDG_CONFIG_HOME"/sxmo/xinit
#exec /usr/bin/bspwm-session.sh
exec bspwm
}
start() {
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
dbus-run-session -- "$0" "with_dbus"
else
# with_dbus calls exec because dbus-run-session starts it in a
# new shell, but we need to keep this shell; start in a subshell
( with_dbus )
fi
}
cleanup() {
sxmo_daemons.sh stop all
pkill svkbd
pkill dmenu
}
init() {
# shellcheck source=scripts/core/sxmo_common.sh
. /etc/profile.d/sxmo_init.sh
_sxmo_load_environments
_sxmo_prepare_dirs
envvars
sxmo_migrate.sh sync
defaults
# shellcheck disable=SC1090,SC1091
. "$XDG_CONFIG_HOME/sxmo/profile"
start
cleanup
sxmo_hook_stop.sh
}
if [ -z "$1" ]; then
init
else
"$1"
fi

View file

@ -0,0 +1,5 @@
[Desktop Entry]
Name=bspwm (sxmo'd)
Comment=Binary space partitioning window manager (with picom and sxmo added)
Exec=/usr/bin/sxmo-bspwm-xinit.sh
Type=Application