diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6949186 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# speedwm-extras // extra content for speedwm +# See LICENSE file for copyright and license details. + +PREFIX = /usr +VERSION = 1.2 + +dist: + mkdir -p speedwm-extras-${VERSION} + cp -R Makefile LICENSE src speedwm-extras-${VERSION} + tar -cf speedwm-extras-${VERSION}.tar speedwm-extras-${VERSION} + gzip speedwm-extras-${VERSION}.tar + rm -rf speedwm-extras-${VERSION} + rm -rf speedwm-extras-${VERSION} + +install: + mkdir -p ${DESTDIR}${PREFIX}/bin + mkdir -p ${DESTDIR}${PREFIX}/share/speedwm + cp -f src/speedwm* ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm* + echo ${VERSION} > ${DESTDIR}${PREFIX}/share/speedwm/speedwm-version + +uninstall: + rm -f ${DESTDIR}${PREFIX}/bin/speedwm + rm -rf ${DESTDIR}${PREFIX}/share/speedwm + +help: + @echo -- speedwm-extras Makefile help -- + @echo + @echo - Installation - + @echo install: Installs speedwm-extras. You may need to run this as root. + @echo uninstall: Uninstalls speedwm-extras. You may need to run this as root. + @echo + @echo - Releasing - + @echo dist to create a tarball. + +.PHONY: dist install uninstall help diff --git a/src/speedwm-applist b/src/speedwm-applist new file mode 100755 index 0000000..0bf17aa --- /dev/null +++ b/src/speedwm-applist @@ -0,0 +1,94 @@ +#!/bin/sh +# speedwm-applist +# list extra applications + +# rl +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +# assume we have grid as default +HAVE_GRID="true" + +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc + echo "Loaded configuration!" +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +# grid number is one +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +# grid argument +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +# create applist +MK_APPLIST() { + if [ -e "$HOME/.local/share/speedwm/applist" ]; then + USER_CMD="$(printf "$(cat $HOME/.local/share/speedwm/applist)\n------\nAdd command\nRemove command\nClear\n" | $RUNLAUNCHER -l 20 -p 'Run:' $GRIDARG $GRIDNUM)" + else + mkdir -p $HOME/.local/share/speedwm + echo "No commands added." > $HOME/.local/share/speedwm/applist + $0 && exit 0 + fi +} + +# remove commands +REMOVE_CMD() { + USER_CMD="$(printf "$(cat $HOME/.local/share/speedwm/applist)\n------\nAdd command\nRemove command\nClear\n" | $RUNLAUNCHER -l 20 -p 'Remove: ' $GRIDARG $GRIDNUM)" + + if [ "$(cat $HOME/.local/share/speedwm/applist | wc -l)" -lt "2" ]; then + rm -f $HOME/.local/share/speedwm/applist + else + grep -v "$USER_CMD" $HOME/.local/share/speedwm/applist | sed ':a;N;$!ba;s/\n//g' > /tmp/applist + mv /tmp/applist $HOME/.local/share/speedwm/applist + fi + + $0 && exit 0 +} + + +# clear commands +CLEAR_CMD() { + case "$(printf "Yes\nNo\n" | $RUNLAUNCHER -l 2 -p 'Are you sure?')" in + "Yes") rm -f $HOME/.local/share/speedwm/applist ;; + esac + + $0 && exit 0 +} + + +# add command +ADD_CMD() { + grep -q "No commands added" $HOME/.local/share/speedwm/applist && rm -f $HOME/.local/share/speedwm/applist + USER_I_ARG="$(printf "" | $RUNLAUNCHER -l 0 -p 'Enter a command:' $GRIDARG $GRIDNUM)" + printf "$USER_I_ARG\n" >> $HOME/.local/share/speedwm/applist + $0 && exit 0 +} + +MK_APPLIST + +# check user cmd +if [ "$USER_CMD" = "" ]; then + exit 0 +else + if [ "$USER_CMD" = "Add command" ]; then + ADD_CMD + else + if [ "$USER_CMD" = "Clear" ]; then + CLEAR_CMD + else + if [ "$USER_CMD" = "Remove command" ]; then + REMOVE_CMD + else + $USER_CMD + fi + fi + fi +fi diff --git a/src/speedwm-audioctrl b/src/speedwm-audioctrl new file mode 100755 index 0000000..8f238e6 --- /dev/null +++ b/src/speedwm-audioctrl @@ -0,0 +1,142 @@ +#!/bin/sh +# speedwm-audioctrl +# This simple shell script handles audio controls for speedwm. +# Run speedwm-audioctrl -help for more information! +# License: GPLv3. + +BINDIR="$(dirname $(command -v speedwm-core))/" + +MUTE() { + # Mute for pulseaudio/pipewire + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pactl" ]; then + pactl set-sink-mute 0 toggle + if [ -e "${BINDIR}notify-send" ]; then + if [ "$remute" = "" ]; then + notify-send " Toggled mute" + fi + fi + else + amixer set Master toggle + if [ -e "${BINDIR}notify-send" ]; then + if [ "$remute" = "" ]; then + notify-send " Toggled mute" + fi + fi + fi + fi +} + +RAISE() { + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pactl" ]; then + if [ "$(pactl get-sink-volume 0 | awk '{ print $5;exit }' | sed 's/%//g')" -gt "100" ]; then + pactl set-sink-volume 0 100% + else + pactl set-sink-volume 0 +10% + test ${BINDIR}notify-send && notify-send " $(pactl get-sink-volume 0 | awk '{ print $5;exit }')" + fi + fi + else + if [ "$(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")" = "100" ]; then + a=$a + else + amixer -c 0 set Master 7%+ + ls ${BINDIR}notify-send && notify-send " $(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")%" + fi + fi +} + +LOWER() { + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pactl" ]; then + if [ "$(pactl get-sink-volume 0 | awk '{ print $5;exit }' | sed 's/%//g')" != "0" ]; then + pactl set-sink-volume 0 -10% + test ${BINDIR}notify-send && notify-send " $(pactl get-sink-volume 0 | awk '{ print $5;exit }')" + fi + + fi + else + if [ "$(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")" = "0" ]; then + a=$a + else + amixer -c 0 set Master 7%- + test ${BINDIR}notify-send && notify-send " $(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")%" + fi + fi +} + +GETVOL() { + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pactl" ]; then + pactl get-sink-volume 0 | awk '{ print $5;exit }' + fi + else + echo "$(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")%" + fi +} + +GETMUTE() { + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pactl" ]; then + pactl get-sink-mute 0 | sed "s/Mute: //; s/no/Not muted/; s/yes/Muted/g" + fi + fi +} + +SWITCH() { + ls $HOME/.local/share/audioctrl-status || echo "0" > $HOME/.local/share/audioctrl-status + if [ "$(cat $HOME/.local/share/audioctrl-status)" = "0" ]; then + amixer -c 0 sset 'Auto-Mute Mode' Enabled ; echo "1" > $HOME/.local/share/audioctrl-status + if [ -e "${BINDIR}notify-send" ]; then + notify-send " Switched to headphones." + fi + else + amixer -c 0 sset 'Auto-Mute Mode' Disabled ; echo "0" > $HOME/.local/share/audioctrl-status + if [ -e "${BINDIR}notify-send" ]; then + notify-send " Switched to speakers." + fi + fi +} + +RUNMIXER() { + if [ "$AUDIO" = "pulse" ]; then + if [ -e "${BINDIR}pulsemixer" ]; then + pulsemixer + elif [ -e "${BINDIR}alsamixer" ]; then + alsamixer + fi + fi +} + +AUDIO=$2 +case "$2" in +"") AUDIO=alsa +if [ -e "${BINDIR}pulsemixer" ]; then + AUDIO=pulse +else + if [ -e "${BINDIR}pactl" ]; then + AUDIO=pulse + fi +fi +;; +esac + +# Update status +UPDATESTATUS() { + pkill -x status && status & +} + +case "$1" in +"-mute") MUTE && GETMUTE > /tmp/speedwm-audioctrl-mutestatus ;; +"-remute") remute=true ; MUTE && GETMUTE > /tmp/speedwm-audioctrl-mutestatus ; MUTE && GETMUTE > /tmp/speedwm-audioctrl-mutestatus ; remute="" ; exit 0 ;; +"-raise") RAISE ;; +"-lower") LOWER ;; +"-switch") SWITCH && exit 0 ;; +"-getvol") GETVOL && exit 0 ;; +"-getmute") GETMUTE > /tmp/speedwm-audioctrl-mutestatus && exit 0 ;; +"-getbackend") printf "$AUDIO\n" && exit 0 ;; +"-runmixer") RUNMIXER && exit 0 ;; +"-help") printf "speedwm-audioctrl\n-mute | Toggle mute\n-raise | Raise the volume by 7\n-lower | Lower the volume by 7\n-switch | Toggle output\n-getvol | Get current volume in percentage\n-getmute | Get mute status\n-getbackend | Get audio backend (ALSA, PulseAudio, etc.)\n-runmixer | Run the audio mixer detected on the system\n-remute | Mute and unmute.\n-help | Display this help screen\nNo arguments | Display this help screen\n"; exit 0 ;; +"") $0 -help && exit 0 ;; +esac diff --git a/src/speedwm-btctrl b/src/speedwm-btctrl new file mode 100755 index 0000000..f096e3a --- /dev/null +++ b/src/speedwm-btctrl @@ -0,0 +1,145 @@ +#!/bin/sh +# speedwm-btctrl +# Basic dmenu/other run launcher Bluetooth manager written for speedwm. +# Licensed under GNU GPLv3. + +# Check stuff +CHECK() { + case "$RUNLAUNCHER" in + "") RUNLAUNCHER=dmenu ;; + esac + + BINDIR="$(dirname $(command -v speedwm-core))/" +} + +HAVE_GRID="true" + +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +CHECK + +# Help +HELP() { + printf "\n1. Turn on your device\n2. Make sure the bluetooth service is running. If it is not, start it.\n3. Press the pair button on your device\n4. Select your device in the list of devices. If it does not show up, select 'Refresh'.\n5. Select 'Pair' and then optionally 'Trust' to save it in the list of devices.\n6. And finally, select 'Connect' to connect the device." | $RUNLAUNCHER -l 12 $GRIDARG $GRIDNUM -p 'How to use' + $0 && exit 0 +} + +# Enable bluetooth and scan for devices +ENABLE_BT() { + bluetoothctl power on > /dev/null && echo "Power: On" + bluetoothctl scan on & # Start scanning for devices + bluetoothctl devices | grep -q "No default controller" && printf "No Bluetooth controller was found.\n" && exit 1 + USEROPT_1="$(printf "$(bluetoothctl devices | cut -d\ -f3-)\n------\nRefresh\nHelp\nExit" | $RUNLAUNCHER -l 12 $GRIDARG $GRIDNUM -p "Select a device")" + + # Check what to do + case "$USEROPT_1" in + "") exit 0 ;; + "Refresh") ENABLE_BT ;; + "Exit") exit 0 ;; + "Help") HELP && $0 && exit 0 ;; + esac + + SELDEVICE_MAC="$(bluetoothctl devices | grep "$USEROPT_1$" | awk '{ print $2 }')" + echo "$SELDEVICE_MAC" + + # Check if a MAC was grabbed + case "$SELDEVICE_MAC" in + "") echo "Could not get MAC" && exit 1 ;; + esac +} + +ENABLE_BT + +# List options for the device +LIST_OPTIONS() { + USEROPT_2="$(echo -e "-- Options --\nConnect\nDisconnect\n-- Toggle --\nPair\nRemove\nTrust\nUntrust\n--\nExit\nHelp" | sed "s/-e //g" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 20 -p "What do you want to do with this device?" | awk '{ print $1 }')" +} + +LIST_OPTIONS + +# Trust device +TRUST() { + bluetoothctl trust $SELDEVICE_MAC +} + +# Pair device +PAIR() { + bluetoothctl pair $SELDEVICE_MAC +} + +# Remove device +REMOVE() { + bluetoothctl remove $SELDEVICE_MAC +} + +UNTRUST() { + bluetoothctl untrust $SELDEVICE_MAC +} + +# Connect +CONNECT() { + if [ -e "$/tmp/isconnected" ]; then + NOTIFY_ALREADY_CONNECTED && exit 0 + fi + + bluetoothctl connect $SELDEVICE_MAC + touch /tmp/isconnected +} + +# Disconnect +DISCONNECT() { + rm -f /tmp/isconnected + bluetoothctl disconnect $SELDEVICE_MAC +} + +# Notification when connecting +NOTIFY_CONNECT() { + notify-send " Connected to ${USEROPT_1}!" +} + +# Notification when disconnecting +NOTIFY_DISCONNECT() { + notify-send " Disconnected from ${USEROPT_1}!" +} + +# Notification when removing +NOTIFY_REMOVE() { + notify-send " Removed ${USEROPT_1}!" +} + +# Notification when already connected +NOTIFY_ALREADY_CONNECTED() { + notify-send " Device $USEROPT_1 is already connected!" +} + +# Perform actions as per user choice +PERFORM() { + case "$USEROPT_2" in + "Trust") TRUST && LIST_OPTIONS ;; + "Pair") PAIR && LIST_OPTIONS ;; + "Connect") CONNECT && NOTIFY_CONNECT && LIST_OPTIONS ;; + "Disconnect") DISCONNECT && NOTIFY_DISCONNECT && LIST_OPTIONS ;; + "Untrust") UNTRUST && LIST_OPTIONS ;; + "Remove") REMOVE && NOTIFY_REMOVE && LIST_OPTIONS ;; + "Exit") exit 0 ;; + "Help") HELP ;; + "") exit 0 ;; + esac +} + +PERFORM + +$0 && exit 0 diff --git a/src/speedwm-core b/src/speedwm-core new file mode 100755 index 0000000..4274360 --- /dev/null +++ b/src/speedwm-core @@ -0,0 +1,10 @@ +#!/bin/sh +# speedwm-core +# This script handles the updating and other things necessary for keybinds. + +BINDIR="$(dirname $(command -v speedwm-core))/" +OPT=$1 + +case "$OPT" in +"-curl-weather") clear ; curl -s wttr.in | head -n 38 | tail -n 37 && sleep 60 ;; +esac diff --git a/src/speedwm-debug b/src/speedwm-debug new file mode 100755 index 0000000..aa52396 --- /dev/null +++ b/src/speedwm-debug @@ -0,0 +1,17 @@ +#!/bin/sh + +install_xephyr() { + echo "Xephyr not installed, please install it." + exit 1 +} + +command -v Xephyr > /dev/null || install_xephyr + +Xephyr -screen 1024x768 :80 & +sleep 1 + +export DISPLAY=:80 +speedwm_run -f +~/.config/speedwm/swal/swal_wm +killall Xephyr + diff --git a/src/speedwm-dfmpeg b/src/speedwm-dfmpeg new file mode 100755 index 0000000..65526f4 --- /dev/null +++ b/src/speedwm-dfmpeg @@ -0,0 +1,197 @@ +#!/bin/sh +# speedwm-dfmpeg +# dmenu/other run launcher GUI for recording your screen with ffmpeg +# +# Licensed under MIT, written by speedie +# Modified version for speedwm (available https://speedie.gq/speedwm) +# https://speedie.gq/dmenu-scripts + +# speedwm specfic dotfile directory, probably don't change +DOTDIR=$HOME/.config/speedwm/dfmpeg +NOMKCONFIG=false # Do not create a config file if this is set to true + +# Set runlauncher +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu +esac + +# -s flag stops recording +case "$1" in +"-s") pkill -x ffmpeg ; rm /tmp/dfmpeg-recording ; STATUS=idle ; exit ;; +esac + +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +# Write default configuration +defaultConfig() { + RESOLUTION="1920x1080" # The resolution to record in + AUDIO_DEVICE="alsa" # How to capture audio (alsa/pulseaudio) + FRAME_RATE="60" # Frame rate to capture in. + RECORD_DEVICE="x11grab" # Probably do not change. + OUTPUT_PATH="$HOME/Recordings" # Path where videos will be saved. + OUTPUT_FORMAT="mp4" # What format to use + OUTPUT_FILENAME="dfmpeg-output" # File name of the output. Probably don't need to change. + ENCODE=true # Encode or not (true/false) + ENCODE_CODEC=libx264 # Codec to encode in + ENCODE_PRESET=ultrafast # ffmpeg preset. Available options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow + WH=":0.0" # Width and height, no need to change, defaults should work. + TERM="$TERMINAL" # Terminal to use when editing the configuration file. + EDITOR="vim" # Editor to edit the config file with + MEDIA_PLAYER="mpv" # Media player to play videos in +} + +defaultConfig + +USECONFIG() { + echo "Using $DOTDIR/config for configuration!" && . $DOTDIR/config +} + +MKCONFIG() { + if [ -e "$DOTDIR/config" ]; then + USECONFIG + else + if [ "$NOMKCONFIG" = "false" ]; then + mkdir -p $DOTDIR + printf "RESOLUTION=$RESOLUTION # The resolution to capture in" > $DOTDIR/config + printf "\nAUDIO_DEVICE=$AUDIO_DEVICE # How to capture audio (alsa/pulseaudio)" >> $DOTDIR/config + printf "\nFRAME_RATE=$FRAME_RATE # Frame rate to capture in." >> $DOTDIR/config + printf "\nOUTPUT_PATH=$OUTPUT_PATH # Directory where captures will be saved." >> $DOTDIR/config + printf "\nOUTPUT_FORMAT=$OUTPUT_FORMAT # What format to use" >> $DOTDIR/config + printf "\n#OUTPUT_FILENAME='filename'" >> $DOTDIR/config + printf "\n\nRECORD_DEVICE=$RECORD_DEVICE" >> $DOTDIR/config + printf "\nWH=$WH" >> $DOTDIR/config + printf "\nTERM=$TERMINAL # Terminal to use when editing the config file" >> $DOTDIR/config + printf "\nEDITOR=$EDITOR # Editor to edit the config file" >> $DOTDIR/config + printf "\nMEDIA_PLAYER=$MEDIA_PLAYER # Media player to play videos in" >> $DOTDIR/config + printf "\nENCODE=$ENCODE # Encode or not on 'Stop' (true/false)" >> $DOTDIR/config + printf "\nENCODE_CODEC=$ENCODE_CODEC # Codec to encode in (libx264 is default)" >> $DOTDIR/config + printf "\nENCODE_PRESET=$ENCODE_PRESET # ffmpeg preset. Available options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow" >> $DOTDIR/config + fi + fi +} + +MKCONFIG + +OUTPUT_FILENAME="$OUTPUT_PATH/$OUTPUT_FILENAME.$OUTPUT_FORMAT" + +# Create the output path if it does not exist +if [ -e "$OUTPUT_PATH" ]; then + a=$a +else + mkdir -p $OUTPUT_PATH +fi + +# Check if we should encode the video or not. +if [ "$ENCODE" = "false" ]; then + startrec="ffmpeg -f $RECORD_DEVICE -s $RESOLUTION -i $WH -f $AUDIO_DEVICE -r $FRAME_RATE -i default $OUTPUT_FILENAME" + startrec_no_audio="ffmpeg -y -f $RECORD_DEVICE -s $RESOLUTION -r $FRAME_RATE -i $WH $OUTPUT_FILENAME" +else + startrec="ffmpeg -y -f x11grab -framerate $FRAME_RATE -s $RESOLUTION -i $WH -f $AUDIO_DEVICE -i default -r 30 -c:v $ENCODE_CODEC -crf 0 -preset ultrafast -c:a aac $OUTPUT_FILENAME" + startrec_no_audio="ffmpeg -y -f x11grab -framerate $FRAME_RATE -s $RESOLUTION -i $WH -r 30 -c:v $ENCODE_CODEC -crf 0 -preset ultrafast -c:a aac $OUTPUT_FILENAME" + touch /tmp/isencoding + echo $ENCODE_CODEC > /tmp/encoding-codec +fi + +# Call this function to encode a video manually. +# /tmp/rec.$OUTPUT_FORMAT must be the file. Consider copying it there and then copying it back. +encode() { + if [ "$ENCODE" = "true" ]; then + cp $(cat /tmp/outputfilename) /tmp/rec.$OUTPUT_FORMAT + ffmpeg -i /tmp/rec.$OUTPUT_FORMAT -c:v $ENCODE_CODEC -preset $ENCODE_PRESET -threads 0 -b:v -pass 1 -f $OUTPUT_FORMAT -qp 0 + cp /tmp/rec.$OUTPUT_FORMAT $(cat /tmp/outputfilename) + rm -f "/tmp/rec.$OUTPUT_FORMAT" + fi +} + +# Hardcoded version number +dfmpeg_ver="2022-08-06-r1" +about_screen="dfmpeg $dfmpeg_ver." + +# About screen text +about_screen_2="Licensed under MIT, written by speedie.gq and jornmann." +about_screen_3="Modified for https://speedie.gq/speedwm" +about_screen_4="https://speedie.gq/dmenu-scripts" + +# Conversion function +convert() { + # Convert mp4 to mp3 + mp42mp3() { + COPT=$(printf 'Enter a path\n------\nExit' | $RUNLAUNCHER -l 3 -p 'Convert which file?') + case "$COPT" in + "Enter a path") exit 0 ;; + "------") exit 0 ;; + "Exit") exit 0 ;; + "") exit 0 ;; + esac + + echo $COPT | grep ".mp4" && ffmpeg -i $COPT -vn $(echo $COPT | sed "s/.mp4/.mp3/g") + } + + case "$(printf '.mp4 to .mp3\n------\n..\nExit' | $RUNLAUNCHER -l 40 -p 'Convertion options')" in + ".mp4 to .mp3") mp42mp3 ;; + "Exit") exit 0 ;; + "------") exit 0 ;; + "..") $0 && exit 0 ;; + esac +} + +encodeopts() { + + case "$(printf 'Encode last recording\nEncode video\n------\n..\nExit' | $RUNLAUNCHER -l 40 -p 'Encoding options')" in + "Encode last recording") encode ; exit 0 ;; + "Encode video") echo "$(echo "" | $RUNLAUNCHER -l 1 $GRIDARG $GRIDNUM -p "What file do you want to encode?")" > /tmp/outputfilename && encode ; exit 0 ;; + "------") exit 0 ;; + "Exit") exit 0 ;; + "..") $0 && exit 0 ;; + "") exit 0 ;; + esac +} + +# More options +MORE_OPTIONS() { + case "$(printf 'Encode\nConvert\nConfigure\n------\n..\nExit' | $RUNLAUNCHER -l 40 -p 'More options')" in + "Encode last recording") encode ; exit 0 ;; + "Encode video") echo "$(echo "" | $RUNLAUNCHER -l 1 $GRIDARG $GRIDNUM -p "What file do you want to encode?")" > /tmp/outputfilename && encode ; exit 0 ;; + "Encode") encodeopts ; exit 0 ;; + "Configure") $TERM $EDITOR $DOTDIR/config ; exit 0 ;; + "Convert") convert ; exit 0 ;; + "") exit 0 ;; + "..") $0 && exit 0 ;; + "------") exit 0 ;; + esac +} + +case "$(printf 'Start\nStop\nStart without audio\nPlay last\n------\nMore options\nAbout\nExit' | $RUNLAUNCHER -l 40 -p 'Record your screen:')" in + "Exit") STATUS=idle && exit 0 ;; + "Start") touch /tmp/isaudio ; echo "$OUTPUT_FILENAME" > /tmp/outputfilename && STATUS=recording && touch /tmp/dfmpeg-recording + $startrec && exit 0 ;; + "Stop") pkill -x ffmpeg ; rm /tmp/dfmpeg-recording ; STATUS=idle ;; + "Start without audio") echo "$OUTPUT_FILENAME" > /tmp/outputfilename && STATUS=recording && touch /tmp/dfmpeg-recording + $startrec_no_audio && exit 0 ;; + "Play last") DFMPEG_STATUS=idle && $MEDIA_PLAYER $(cat /tmp/outputfilename) && exit 0 ;; + "More options") MORE_OPTIONS && exit 0 ;; + "") exit 0 ;; + "About") + echo $about_screen > /tmp/dfmpeg_about + echo $about_screen_2 >> /tmp/dfmpeg_about + echo $about_screen_3 >> /tmp/dfmpeg_about + echo $about_screen_4 >> /tmp/dfmpeg_about + cat /tmp/dfmpeg_about | $RUNLAUNCHER -l 40 $GRIDARG $GRIDNUM + ;; +esac + +exit 0 # This fixes a small bug. diff --git a/src/speedwm-netctrl b/src/speedwm-netctrl new file mode 100755 index 0000000..e0e9922 --- /dev/null +++ b/src/speedwm-netctrl @@ -0,0 +1,129 @@ +#!/bin/sh +# speedwm-netctrl +# dmenu/other run launcher GUI for iwd +# Licensed under the GNU GPLv3 free software license. + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +BINDIR="$(dirname $(command -v speedwm-core))/" + +command -v iwctl > /dev/null || exit 1 + +HAVE_GRID="true" +HAVE_PASSWORD="false" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc + grep -q HAVE_PASSWORD $HOME/.config/speedwm/globalrc || printf "\nHAVE_PASSWORD=$HAVE_PASSWORD # Whether or not to use the Password argument if a script requests it. If you do not have the dmenu password patch, set this to false. Doing so will disable password prompts." >> $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc + printf "\nHAVE_PASSWORD=$HAVE_PASSWORD # Whether or not to use the Password argument if a script requests it. If you do not have the dmenu password patch, set this to false. Doing so will disable password prompts." >> $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +SHOW_PASSWORD="true" + +test ${BINDIR}iwctl || exit 0 + +if [ -e "$HOME/.config/speedwm/netctrl/config" ]; then + . $HOME/.config/speedwm/netctrl/config +else + mkdir -p $HOME/.config/speedwm/netctrl + printf "SHOW_PASSWORD=$SHOW_PASSWORD # Show password when entering it or not? Requires the 'password' dmenu patch. If you do not have it, you can get my build. You also need to enable it in $HOME/.config/speedwm/globalrc. (true/false)" > $HOME/.config/speedwm/netctrl/config +fi + +if [ "$SHOW_PASSWORD" = "false" ]; then + if [ "$HAVE_PASSWORD" = "true" ]; then + PASS_ARG="-P" + fi +fi + +# Get the device used to connect. +getdevice() { + seldevice=$1 + if [ -e "$HOME/.local/share/seldevice" ]; then + seldevice=$(cat $HOME/.local/share/seldevice) + else + case "$1" in + "") devices="$(printf "\n$(ip link)" | awk '{ print $2 }' | awk 'NR%2==0' | sed "s/://g")" + seldevice=$(echo $devices | sed 's/ /\n/g' | $RUNLAUNCHER -p "What device do you want to connect with?" -l 10 $GRIDARG $GRIDNUM) && echo $seldevice > $HOME/.local/share/seldevice ;; + esac + fi + + case "$seldevice" in + "") exit 0 ;; + esac +} + +# connect to wifi +connectwifi() { + # if args aren't disconnect, scan for networks + # if it is disconnect, disconnect + if [ "$INARGS" != "disconnect" ]; then + iwctl station $seldevice scan + network="$(printf "$(iwctl station $seldevice get-networks | sed -n 6,20p | sed "s|>||g" | awk '{ print $1 }')\nDisconnect\n------\nExit" | sed "s| |No networks found|g" | $RUNLAUNCHER -l 10 $GRIDARG $GRIDNUM -p "Select a network to connect to" | sed "s|------||g" | sed "s|No networks found| |g")" + + case "$network" in + "") exit 0 ;; + "Disconnect") disconnect=true ;; + "Exit") exit 0 ;; + esac + else + disconnect=true + fi + + if [ "$disconnect" != "true" ]; then + iwctl station $seldevice get-networks | grep "$network" > /dev/null || exit 1 + + connect_pass() { + PASSPHRASE=$(printf "\n" | $RUNLAUNCHER -p "This network is protected. Enter the passphrase." -l 1 $GRIDARG $GRIDNUM $PASS_ARG) + case "$PASSPHRASE" in + "") exit 0 ;; + esac + + printf "$network\n" >> $HOME/.local/share/networks + + iwctl station $seldevice connect $network -P $PASSPHRASE || connect_pass + if [ -e "${BINDIR}notify-send" ]; then + notify-send " Connected to $network!" + fi + exit 0 + } + + connect_no_pass() { + iwctl station $seldevice connect $network || exit 0 + if [ -e "${BINDIR}notify-send" ]; then + notify-send " Connected to $network!" + fi + exit 0 + } + fi + + disconnect() { + iwctl station $seldevice disconnect + if [ -e "${BINDIR}notify-send" ]; then + notify-send " Disconnected from the network!" + fi + exit 0 + } + + if [ "$disconnect" != "true" ]; then + grep $network $HOME/.local/share/networks && connect_no_pass && exit 0 + iwctl station $seldevice get-networks | grep psk && connect_pass && exit 0 + else + disconnect + fi +} + +export INARGS="$1" +getdevice && connectwifi +pgrep -x status > /dev/null && pkill status && status & diff --git a/src/speedwm-screenshotutil b/src/speedwm-screenshotutil new file mode 100755 index 0000000..23f943b --- /dev/null +++ b/src/speedwm-screenshotutil @@ -0,0 +1,145 @@ +#!/bin/sh +# speedwm-screenshotutil +# Built in screenshot utility for my build of speedwm +# Requires curl, maim and xclip. +# +# curl snippet by nezbednik, thank you! + +rm -f /tmp/screenshot* + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +BINDIR="$(dirname $(command -v speedwm-core))/" + +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +EXPORTDIR=$HOME/.config/speedwm/screenshotutil + +mkdir -p $EXPORTDIR + +# Config +SHOWCURSOR="true" # Show cursor or not (true/false) +DEFAULTSCREENSHOTPATH=$HOME/Screenshots # Default screenshot path +FORMAT="+%T_%D" # Screenshot format + +if [ -e "$EXPORTDIR/config" ]; then + . $EXPORTDIR/config +else + printf "SHOWCURSOR=$SHOWCURSOR # Show cursor or not (true/false)" > $EXPORTDIR/config + printf "\nDEFAULTSCREENSHOTPATH=$DEFAULTSCREENSHOTPATH # Where screenshots are saved\n" >> $EXPORTDIR/config + echo "FORMAT='$FORMAT' # Where screenshots are saved. : and / will be replaced with _ and nothing respectively." >> $EXPORTDIR/config +fi + +case "$SHOWCURSOR" in +"true") ARG2="" ;; +"false") ARG2=u ;; +esac + +# Help argument action +HELP() { + printf "speedwm-screenshotutil\n-t | Wait seconds and then take the screenshot." + printf "\n-f | Take a full screen screenshot instead of selecting manually." + printf "\n-s | Take a screenshot, allowing the user to select a section manually." + printf "\n-o | Select a file and allow the user to perform actions with it." + printf "\n-tf | Wait seconds and then take a full screen screenshot." + printf "\n-h | View this help screen" + printf "\nNo arguments will print this screen.\n" +} + +# Sleep argument (-t) +if [ "$1" = "-t" ]; then + sleep $2 && maim -s${ARG2}B > /tmp/screenshot-$DATE || exit 0 +fi + +# Open argument (-o) +if [ "$1" = "-o" ]; then + cat $2 > /tmp/screenshot-$DATE +fi + +# Sleep and full argument (-tf) +if [ "$1" = "-tf" ]; then + sleep $2 && maim -${ARG2}B > /tmp/screenshot-$DATE || exit 0 +elif [ "$1" = "-ft" ]; then + sleep $2 && maim -${ARG2}B > /tmp/screenshot-$DATE || exit 0 +fi + +# Full argument (-f) +if [ "$1" = "" ]; then + HELP ; exit 0 +else + if [ "$1" = "-f" ]; then + if [ -e "/tmp/screenshot-$DATE" ]; then + exists=true + else + maim -${ARG2}B > /tmp/screenshot-$DATE || exit 0 + fi + fi + + if [ "$1" = "-s" ]; then + if [ -e "/tmp/screenshot-$DATE" ]; then + exists=true + else + maim -s${ARG2}B > /tmp/screenshot-$DATE || exit 0 + fi + fi +fi + +# Help argument (-h) +if [ "$1" = "-h" ]; then + HELP ; exit 0 +fi + +# User action +if [ -e "/tmp/screenshot-$DATE" ]; then + U_INPUT="$(printf "Image\nURL\nSave" | $RUNLAUNCHER -l 3 -p "Copy to clipboard as an: ")" +else + exit 0 +fi + +# Send notification for URL +SENDNOTIF_URL() { + if [ -e "${BINDIR}notify-send" ]; then + notify-send "Screenshot copied to clipboard." + fi +} + +# Send notifcation for local image save +SENDNOTIF_SAVE() { + if [ -e "${BINDIR}notify-send" ]; then + notify-send "Screenshot saved to $SAVEDIR." + fi +} + +# Send notification for image copied to clipboard +SENDNOTIF_IMG() { + if [ -e "${BINDIR}notify-send" ]; then + notify-send "Screenshot copied to clipboard." + fi +} + +mkdir -p $DEFAULTSCREENSHOTPATH + +# Perform actions based on user input +case "$U_INPUT" in +"Image") cat /tmp/screenshot-$DATE | xclip -selection clipboard -t image/png && SENDNOTIF_IMG ;; +"URL") printf "\n" | xclip -selection clipboard && curl -s -F source=@"/tmp/screenshot-$DATE" -F "type=file" -F "action=upload" "https://imgbb.com/json" | sed "s/\\\\//g; s/\"/\\n/g" | grep -m 1 -A 2 url | tail -n 1 | xclip -selection clipboard && SENDNOTIF_URL ;; +"Save") SAVEDIR=$(printf "$DEFAULTSCREENSHOTPATH/screenshot-$(date "$FORMAT" | sed "s|:|-|g" | sed "s|/||g").png" | $RUNLAUNCHER -l 1 $GRIDARG $GRIDNUM -p "Where do you want to save it? (Including filename)") && cat /tmp/screenshot-$DATE > $SAVEDIR && SENDNOTIF_SAVE ;; +esac + +rm -f /tmp/screenshot* # Remove the screenshots diff --git a/src/speedwm-shutdown b/src/speedwm-shutdown new file mode 100755 index 0000000..a960aeb --- /dev/null +++ b/src/speedwm-shutdown @@ -0,0 +1,172 @@ +#!/bin/sh +# speedwm-shutdwon +# This simple script uses $RUNLAUNCHER to ask the user what action they want to perform. +# +# NOTE: You must either permit nopass for poweroff and reboot commands for your user or simply enable nopass entirely!! + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +case "$TERMINAL" in +"") TERMINAL=st ;; +esac + +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +BINDIR="$(dirname $(command -v speedwm-core))/" + +EXPORTDIR=$HOME/.config/speedwm/powermenu +mkdir -p $EXPORTDIR + +command -v sudo > /dev/null && PERM=sudo +command -v doas > /dev/null && PERM=doas +command -v rootdo > /dev/null && PERM=rootdo + +case "$PERM" in +"") PERM=su ;; +esac + +COL_NORMAL_TEXT_NORMAL="#ffffff" +COL_NORMAL_TEXT_SELECTED="#ffffff" +COL_NORMAL_BACKGROUND_NORMAL="#333333" +COL_NORMAL_BACKGROUND_SELECTED="#222222" +COL_WARNING_TEXT_NORMAL="#ffffff" +COL_WARNING_TEXT_SELECTED="#000000" +COL_WARNING_BACKGROUND_NORMAL="#DC143C" +COL_WARNING_BACKGROUND_SELECTED="#8b0000" +USEDEFAULTCOLORS=true +LOCK_TEXT="" + +# Load config if available and override settings +if [ -e "$EXPORTDIR/config" ]; then + . $EXPORTDIR/config +else + printf "# Colors for the prompt. Replace the color values with 'dmenu' for regular default colors." > $EXPORTDIR/config + printf "\nCOL_NORMAL_TEXT_NORMAL=$COL_NORMAL_TEXT_NORMAL # Text color for not selected options (Regular prompt)" >> $EXPORTDIR/config + printf "\nCOL_NORMAL_TEXT_SELECTED=$COL_NORMAL_TEXT_SELECTED # Text color for selected option (Regular prompt)" >> $EXPORTDIR/config + printf "\nCOL_NORMAL_BACKGROUND_NORMAL=$COL_NORMAL_BACKGROUND_NORMAL # Background color for not selected options (Regular prompt)" >> $EXPORTDIR/config + printf "\nCOL_NORMAL_BACKGROUND_SELECTED=$COL_NORMAL_BACKGROUND_SELECTED # Background color for selected option (Regular prompt)" >> $EXPORTDIR/config + printf "\nCOL_WARNING_TEXT_NORMAL=$COL_WARNING_TEXT_NORMAL # Text color for not selected options (Warning prompt)" >> $EXPORTDIR/config + printf "\nCOL_WARNING_TEXT_SELECTED=$COL_WARNING_TEXT_SELECTED # Text color for selected option (Warning prompt)" >> $EXPORTDIR/config + printf "\nCOL_WARNING_BACKGROUND_NORMAL=$COL_WARNING_BACKGROUND_NORMAL # Background color for not selected options (Warning prompt)" >> $EXPORTDIR/config + printf "\nCOL_WARNING_BACKGROUND_SELECTED=$COL_WARNING_BACKGROUND_SELECTED # Background color for selected option (Warning prompt)" >> $EXPORTDIR/config + printf "\nPERM=$PERM # Root access tool (sudo, doas, etc.). Must support nopass for poweroff and reboot commands." >> $EXPORTDIR/config + printf "\nUSEDEFAULTCOLORS=$USEDEFAULTCOLORS # Use $RUNLAUNCHER colors instead of custom ones (true/false)" >> $EXPORTDIR/config + printf "\nLOCK_TEXT=$LOCK_TEXT # Text to display on the lock screen. Only works with slock and requires the message patch." >> $EXPORTDIR/config +fi + +case "$LOCK_TEXT" in +"") MESSAGEFLAG="" ;; +esac + +SBFLAG="-sb" +SFFLAG="-sf" +NBFLAG="-nb" +NFFLAG="-nf" + +if [ "$USEDEFAULTCOLORS" = "true" ]; then + SBFLAG="" + NBFLAG="" + SFFLAG="" + NFFLAG="" + COL_NORMAL_BACKGROUND_SELECTED="" + COL_NORMAL_BACKGROUND_NORMAL="" + COL_NORMAL_TEXT_SELECTED="" + COL_NORMAL_TEXT_NORMAL="" + COL_WARNING_BACKGROUND_NORMAL="" + COL_WARNING_TEXT_SELECTED="" + COL_WARNING_TEXT_NORMAL="" + COL_WARNING_BACKGROUND_SELECTED="" +fi + +# Standard Background +if [ "$COL_NORMAL_BACKGROUND_SELECTED" = "dmenu" ]; then + SBFLAG="" + COL_NORMAL_BACKGROUND_SELECTED="" +fi + +# Normal Background +if [ "$COL_NORMAL_BACKGROUND_NORMAL" = "dmenu" ]; then + NBFLAG="" + COL_NORMAL_BACKGROUND_NORMAL="" +fi + +# Standard Background +if [ "$COL_NORMAL_TEXT_SELECTED" = "dmenu" ]; then + SFFLAG="" + COL_NORMAL_TEXT_SELECTED="" +fi + +# Normal Text +if [ "$COL_NORMAL_TEXT_NORMAL" = "dmenu" ]; then + NFFLAG="" + COL_NORMAL_TEXT_NORMAL="" +fi + +# Standard Background +if [ "$COL_WARNING_BACKGROUND_SELECTED" = "dmenu" ]; then + SBFLAG="" + COL_WARNING_BACKGROUND_SELECTED="" +fi + +# Normal Background +if [ "$COL_WARNING_BACKGROUND_NORMAL" = "dmenu" ]; then + NBFLAG="" + COL_WARNING_BACKGROUND_NORMAL="" +fi +# Standard Background +if [ "$COL_WARNING_TEXT_SELECTED" = "dmenu" ]; then + SFFLAG="" + COL_WARNING_TEXT_SELECTED="" +fi + +# Normal Text +if [ "$COL_WARNING_TEXT_NORMAL" = "dmenu" ]; then + NFFLAG="" + COL_WARNING_TEXT_NORMAL="" +fi + +MOREOPTS() { + USER_OPT3=$(printf "Restart speedwm\nEnd task\nspeedwm command\n.." | $RUNLAUNCHER -l 4 $GRIDARG $GRIDNUM -p "What do you want to do?" $NBFLAG $COL_NORMAL_BACKGROUND_NORMAL $SBFLAG $COL_NORMAL_BACKGROUND_SELECTED $NFFLAG $COL_NORMAL_TEXT_NORMAL $SFFLAG $COL_NORMAL_TEXT_SELECTED) + + case "$USER_OPT3" in + "") exit 0 ;; + "Restart speedwm") speedwm_run -r && exit 0 ;; + "End task") ENDTASK=$(printf "\n" | $RUNLAUNCHER -l 1 -p "What task to end?" $NBFLAG $COL_NORMAL_BACKGROUND_NORMAL $SBFLAG $COL_NORMAL_BACKGROUND_SELECTED $NFFLAG $COL_NORMAL_TEXT_NORMAL $SFFLAG $COL_NORMAL_TEXT_SELECTED) && pkill $ENDTASK && exit 0 ;; + "speedwm command") speedwm-utils && exit 0 ;; + "..") $0 && exit 0 ;; + esac +} + +USER_OPT1=$(printf "Shutdown\nReboot\nExit\nLock\nMore" | $RUNLAUNCHER -l 5 -p "What do you want to do?" $NBFLAG $COL_NORMAL_BACKGROUND_NORMAL $SBFLAG $COL_NORMAL_BACKGROUND_SELECTED $NFFLAG $COL_NORMAL_TEXT_NORMAL $SFFLAG $COL_NORMAL_TEXT_SELECTED) + +case "$USER_OPT1" in +"Shutdown") CMD="$PERM poweroff" ;; +"Reboot") CMD="$PERM reboot" ;; +"Exit") exit 0 ;; +"Lock") CMD="slock $MESSAGEFLAG '$LOCK_TEXT'" ;; +"More") MOREOPTS ;; +"") exit 0 ;; +esac + +USER_OPT2=$(printf "Yes\nNo" | $RUNLAUNCHER -l 2 -p "Are you sure?" $NBFLAG "$COL_WARNING_BACKGROUND_NORMAL" $SBFLAG "$COL_WARNING_BACKGROUND_SELECTED" $NFFLAG "$COL_WARNING_TEXT_NORMAL" $SFFLAG "$COL_WARNING_TEXT_SELECTED") +case "$USER_OPT2" in +"Yes") $CMD ;; +"No") exit 0 ;; +"") exit 0 ;; +esac diff --git a/src/speedwm-swal b/src/speedwm-swal new file mode 100755 index 0000000..de4bd7f --- /dev/null +++ b/src/speedwm-swal @@ -0,0 +1,357 @@ +#!/bin/sh +# speedwm-swal +# wallpaper utility written for speedwm. +# Licensed under the GNU GPLv3 free software license. + +ARGS="$@" +ARG1="$1" + +# Default configuration, should be fine for most users. +SWAL_DEFAULT_CONFIG() +{ + SWAL_WALLPAPERDIR=$HOME/Wallpapers + SWAL_OLDWALLPAPERDIR=$SWAL_WALLPAPERDIR + case "$RUNLAUNCHER" in + "") RUNLAUNCHER=dmenu ;; + esac + SWAL_OPT=xwallpaper + SWAL_EXPORTDIR=$HOME/.config/speedwm/swal # Config directory + SWAL_IMAGE_VIEWER="sxiv -to" # Image viewer to use () + SWAL_ASK_WAL=false # Ask whether or not to use Pywal if possible (true/false) + SWAL_RANDOMIZE=false # Select a random wallpaper on login +} + +# By default, assume we have grid. +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc + echo "Loaded configuration!" +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +# Grid number is one +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +# Grid argument +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + + +# Create the configuration +SWAL_MKCONFIG() { + mkdir -p $SWAL_EXPORTDIR + touch $SWAL_EXPORTDIR/config + SWAL_ASK_WAL_NEW=$SWAL_ASK_WAL + SWAL_WALLPAPERDIR_NEW=$SWAL_WALLPAPERDIR + + SWAL_CHANGE_WALLPAPERDIR() { + SWAL_WALLPAPERDIR_NEW=$(printf "Your wallpaper directory" | $RUNLAUNCHER $GRIDARG $GRIDNUM -p "Where are all your wallpapers stored?" -l 1) + } + + SWAL_CHANGE_ASK_WAL() { + command -v wal > /dev/null && SWAL_ASK_WAL_NEW=$(printf "Yes\nNo" | $RUNLAUNCHER $GRIDARG $GRIDNUM -p "Ask whether or not to use Pywal?" -l 2 | sed "s|No|false|g" | sed "s|Yes|true|g") + } + + SWAL_CHANGE_IMAGE_VIEWER() { + SWAL_IMAGE_VIEWER=$(printf "" | $RUNLAUNCHER $GRIDARG $GRIDNUM -p "What image viewer do you want to use for previews?" -l 1) + } + + SWAL_CHANGE_RANDOMIZE() { + SWAL_RANDOMIZE=$(printf "Yes\nNo" | $RUNLAUNCHER $GRIDARG $GRIDNUM -p "Pick a random wallpaper on login?" -l 2 | sed "s|No|false|g" | sed "s|Yes|true|g") + } + + USER_OPT_ACTION=$(printf "Wallpaper directory\nPywal\nImage Viewer\nRandomize\n------\nExit" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 10 -p "What setting do you want to change?") + + case "$USER_OPT_ACTION" in + "") $0 && exit 0 ;; + "Wallpaper directory") SWAL_CHANGE_WALLPAPERDIR && CHANGED=true ;; + "Pywal") SWAL_CHANGE_ASK_WAL && CHANGED=true ;; + "Image Viewer") SWAL_CHANGE_IMAGE_VIEWER && CHANGED=true ;; + "Randomize") SWAL_CHANGE_RANDOMIZE && CHANGED=true ;; + "Exit") exit 0 ;; + "------") $0 && exit 0 ;; + esac + + case "$CHANGED" in + "") $0 && exit 0 ;; + esac + + case "$SWAL_ASK_WAL_NEW" in + "true") ASKED=true ;; + "false") ASKED=true ;; + esac + + if [ "$ASKED" = "" ]; then + $0 && exit 0 + fi + + printf "SWAL_WALLPAPERDIR=$SWAL_WALLPAPERDIR_NEW" > $SWAL_EXPORTDIR/config + printf "\nRUNLAUNCHER=$RUNLAUNCHER" >> $SWAL_EXPORTDIR/config + printf "\nSWAL_OPT=$SWAL_OPT" >> $SWAL_EXPORTDIR/config + printf "\nSWAL_EXPORTDIR=$SWAL_EXPORTDIR" >> $SWAL_EXPORTDIR/config + printf "\nSWAL_IMAGE_VIEWER='$SWAL_IMAGE_VIEWER'" >> $SWAL_EXPORTDIR/config + printf "\nSWAL_ASK_WAL=$SWAL_ASK_WAL_NEW" >> $SWAL_EXPORTDIR/config + printf "\nSWAL_RANDOMIZE=$SWAL_RANDOMIZE" >> $SWAL_EXPORTDIR/config +} + +# Binary directory +SWAL_OLDWALLPAPERDIR=$SWAL_WALLPAPERDIR + +# Source things +SWAL_SOURCE() +{ + ls "$SWAL_EXPORTDIR/config" || SWAL_MKCONFIG + . "$SWAL_EXPORTDIR/config" || rm -f "$SWAL_EXPORTDIR/config" +} + +# Set image viewer if none is specified. +SWAL_CHECK() +{ + if [ "$SWAL_IMAGE_VIEWER" = "" ]; then + if command -v feh > /dev/null; then + SWAL_IMAGE_VIEWER=feh + if command -v sxiv > /dev/null; then + SWAL_IMAGE_VIEWER=sxiv + if command -v nsxiv > /dev/null; then + SWAL_IMAGE_VIEWER=nsxiv + fi + fi + + command -v xwallpaper > /dev/null || SWAL_DIE +} + +# Die +SWAL_DIE() +{ + SWAL_EXIT=1 && exit 1 +} + +# Print usage. +SWAL_USAGE() { + echo "To set a wallpaper, you must create a configuration. To do this, select 'Options' in the menu and set all the options to your liking." + echo "The image viewer must be set to an image viewer that supports printing the filename to stdout. If you use sxiv, set the image viewer to 'sxiv -o'." + echo "In the case of sxiv, This means you can press 'm' when previewing an image to select it and then set it." + echo "Once you've selected your image using the method you prefer, select how you want to set it." + echo "Then your pywal colors will reload, and the wallpaper will be set." + echo "For more information, see speedwm-help -a." +} + +# Select wallpaper +SWAL_SELWALLPAPER() +{ + if [ "$ARG1" = "" ]; then + SWAL_SELWALLPAPER="$(printf "$(ls "$SWAL_WALLPAPERDIR")\n------\n..\nPreview\nPrevious\nRandom\nFavorites\nAdd used wallpaper to favorites\nOptions\nHelp\nExit" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 100 -p "What wallpaper would you like to set?")" + fi +} + +# Set the type/check what was selected. +SWAL_SETTYPE() +{ + case "$ARG1" in + "--randomize") SWAL_SELWALLPAPER="Random" ;; + "--previous") SWAL_SELWALLPAPER="Previous" ;; + esac + + case "$SWAL_SELWALLPAPER" in + "Options") SWAL_MKCONFIG && $0 $@ && exit 0 ;; + "") $0 && exit 0 ;; + "Favorites") SWAL_SELWALLPAPER="$(printf "$(cat $SWAL_EXPORTDIR/favorites.filename)\n------\n..\nClear\n\nExit" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 100 -p "What wallpaper would you like to set?")" ; FAVORITES=true ;; + "Add used wallpaper to favorites") echo "$(readlink "$SWAL_EXPORTDIR/CurrentWallpaper")" >> $SWAL_EXPORTDIR/favorites ; echo "$(basename "$(readlink "$SWAL_EXPORTDIR/CurrentWallpaper")")" >> $SWAL_EXPORTDIR/favorites.filename && $0 && exit 0 ;; + "Preview") SWAL_PREVIEWIMG="$($SWAL_IMAGE_VIEWER "$SWAL_WALLPAPERDIR"/*)" ;; + "..") cd "$SWAL_WALLPAPERDIR/.." && SWAL_WALLPAPERDIR="$(pwd)" && SWAL_SELWALLPAPER && SET && exit 0 ;; + "Random") SWAL_FULL="$(find $SWAL_WALLPAPERDIR/* -type f | shuf -n 1)" ; SWAL_WALLPAPERDIR="$(dirname "$SWAL_FULL")" ; SWAL_SELWALLPAPER="$(basename "$SWAL_FULL")" ; SWAL_SELWAL=$SWAL_SELWALLPAPER ;; + "Previous") SWAL_PREVWAL=$(readlink $SWAL_EXPORTDIR/CurrentWallpaper_prev) ; SWAL_WALLPAPERDIR="$(dirname "$SWAL_PREVWAL")" ; SWAL_SELWALLPAPER="$(basename "$SWAL_PREVWAL")" ;; + "Exit") exit 0 ;; + "Help") SWAL_USAGE | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 50 -p "How to use" && $0 && exit 0 ;; + "------") $0 && exit 0 ;; + esac + + # Favorites feature + if [ "$FAVORITES" = "true" ]; then + case "$SWAL_SELWALLPAPER" in + "") $0 && exit 0 ;; + "Clear") rm -f $SWAL_EXPORTDIR/favorites* ; $0 && exit 0 ;; + "Exit") exit 0 ;; + "..") $0 && exit 0 ;; + "------") $0 && exit 0 ;; + esac + SWAL_WALLPAPERDIR="$(dirname "$(cat "$SWAL_EXPORTDIR/favorites" | grep "$SWAL_SELWALLPAPER")")" + fi + + # If it's an actual image, use it as wallpaper + if [ "$SWAL_SELWALLPAPER" = "Preview" ]; then + if [ "$SWAL_PREVIEWIMG" = "" ]; then + $0 && exit 0 + else + SWAL_SELWALLPAPER="$SWAL_PREVIEWIMG" + SWAL_WALLPAPERDIR="" + fi + fi + + # Check if it's a directory + if [ -d "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" ]; then + cd "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" && SWAL_WALLPAPERDIR="$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" && SWAL_SELWALLPAPER && SET && exit 0 + fi + + # Fail if the wallpaper is not a proper wallpaper. + FAIL_NOT_REAL() { + command -v notify-send > /dev/null && notify-send "The selected wallpaper is not valid/does not exist." + $0 ; exit 1 + } + + ls "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" || FAIL_NOT_REAL + + # don't set type if using argument + if [ "$SWAL_ASK_TYPE" != "false" ]; then + if [ "$ARG1" = "" ]; then + SWAL_TYPE=$(printf "Center\nTile\nZoom\nStretch\n------\nExit" | $RUNLAUNCHER -p "How do you want to set the wallpaper?" $GRIDARG $GRIDNUM -l 7) + else + SWAL_TYPE="Stretch" + fi + fi + + case "$SWAL_TYPE" in + "Center") SWAL_TYPE=center ;; + "Tile") SWAL_TYPE=tile ;; + "Zoom") SWAL_TYPE=zoom ;; + "Stretch") SWAL_TYPE=stretch ;; + "Exit") exit 0 ;; + "------") $0 && exit 0 ;; + "") $0 && exit 0 ;; + esac + + # Set type to stretch, shouldn't matter as xwallpaper can determine if it makes sense. + if [ "$SWAL_ASK_TYPE" = "false" ]; then + SWAL_TYPE=stretch + fi + + # Set variables so that we can use them with xwallpaper directly. + SWAL_TYPE="--$SWAL_TYPE" + SWAL_WAL_STATUS="0" + + # Check whether or not to ask based on configuration file. + if [ "$ARG1" = "" ]; then + case "$SWAL_ASK_WAL" in + "true") command -v wal > /dev/null && SWAL_USE_WAL=$(printf "Yes\nNo" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 90 -p "Do you want to use Pywal?" -l 2) && SWAL_WAL_STATUS="1" ;; + "false") command -v wal > /dev/null && SWAL_USE_WAL="Yes" && SWAL_WAL_STATUS="1" ;; + esac + else + command -v wal > /dev/null && SWAL_USE_WAL="Yes" && SWAL_WAL_STATUS="1" + fi + + + # Don't perform pywal actions if not installed/used + if [ "$SWAL_WAL_STATUS" = "0" ]; then + SWAL_USE_WAL="No" + fi +} + +# Set the wallpaper. +SWAL_SETWALLPAPER() +{ + $SWAL_OPT $SWAL_TYPE "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" || FAIL_NOT_REAL +} + +# Export script to autostart on login +SWAL_EXPORT_SCRIPT() +{ + if [ "$SWAL_RANDOMIZE" = "false" ]; then + printf "#!/bin/sh\n$SWAL_OPT $SWAL_TYPE ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'""" > $SWAL_EXPORTDIR/swal_wm + if [ -e "$SWAL_EXPORTDIR/CurrentWallpaper" ]; then + rm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev ; ln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" $SWAL_EXPORTDIR/CurrentWallpaper_prev + fi + + rm -f $SWAL_EXPORTDIR/CurrentWallpaper ; ln -s "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" $SWAL_EXPORTDIR/CurrentWallpaper + else + printf "#!/bin/sh" > $SWAL_EXPORTDIR/swal_wm + printf "\nSWAL_WALLPAPERDIR=""'$SWAL_OLDWALLPAPERDIR'""" >> $SWAL_EXPORTDIR/swal_wm + printf "\nSWAL_EXPORTDIR=""'$SWAL_EXPORTDIR'""" >> $SWAL_EXPORTDIR/swal_wm + printf '\nSWAL_SELWALLPAPER="$(find "$SWAL_WALLPAPERDIR"/* -type f | shuf -n 1)"' >> $SWAL_EXPORTDIR/swal_wm + printf "\n$SWAL_OPT $SWAL_TYPE " >> $SWAL_EXPORTDIR/swal_wm + printf '"$SWAL_SELWALLPAPER"' >> $SWAL_EXPORTDIR/swal_wm + printf "\nrm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm + printf '\nln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" ' >> $SWAL_EXPORTDIR/swal_wm + printf "$SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm + printf "\nrm -f $SWAL_EXPORTDIR/CurrentWallpaper" >> $SWAL_EXPORTDIR/swal_wm + printf '\nln -s "$SWAL_SELWALLPAPER" ' >> $SWAL_EXPORTDIR/swal_wm + printf "$SWAL_EXPORTDIR/CurrentWallpaper" >> $SWAL_EXPORTDIR/swal_wm + fi + + chmod +x $SWAL_EXPORTDIR/swal_wm +} + +# Export script to autostart on login for Pywal users +SWAL_EXPORT_SCRIPT_WAL() +{ + if [ "$SWAL_RANDOMIZE" = "false" ]; then + printf "#!/bin/sh\n$SWAL_OPT $SWAL_TYPE ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'""\nwal -qi ""'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'"" || rm -rf $HOME/.cache/wal ; xrdb -remove\nxrdb ~/.cache/wal/colors.Xresources" > $SWAL_EXPORTDIR/swal_wm + else + printf "#!/bin/sh" > $SWAL_EXPORTDIR/swal_wm + printf "\nSWAL_WALLPAPERDIR=""'$SWAL_OLDWALLPAPERDIR'""" >> $SWAL_EXPORTDIR/swal_wm + printf "\nSWAL_EXPORTDIR=""'$SWAL_EXPORTDIR'""" >> $SWAL_EXPORTDIR/swal_wm + printf '\nSWAL_SELWALLPAPER="$(find "$SWAL_WALLPAPERDIR"/* -type f | shuf -n 1)"' >> $SWAL_EXPORTDIR/swal_wm + printf "\n$SWAL_OPT $SWAL_TYPE " >> $SWAL_EXPORTDIR/swal_wm + printf '"$SWAL_SELWALLPAPER"' >> $SWAL_EXPORTDIR/swal_wm + printf '\nwal -nqi "$SWAL_SELWALLPAPER" || rm -rf $HOME/.cache/wal ; xrdb -remove\nxrdb $HOME/.cache/wal/colors.Xresources\nxrdb $HOME/.cache/wal/colors.Xresources' >> $SWAL_EXPORTDIR/swal_wm + printf "\nrm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm + printf '\nln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" ' >> $SWAL_EXPORTDIR/swal_wm + printf "$SWAL_EXPORTDIR/CurrentWallpaper_prev" >> $SWAL_EXPORTDIR/swal_wm + printf "\nrm -f $SWAL_EXPORTDIR/CurrentWallpaper" >> $SWAL_EXPORTDIR/swal_wm + printf '\nln -s "$SWAL_SELWALLPAPER" ' >> $SWAL_EXPORTDIR/swal_wm + printf "$SWAL_EXPORTDIR/CurrentWallpaper" >> $SWAL_EXPORTDIR/swal_wm + fi + + chmod +x $SWAL_EXPORTDIR/swal_wm + rm -rf $HOME/.cache/wal # Delete previous colors + wal -nqi "'$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER'" && xrdb ~/.cache/wal/colors.Xresources || xrdb -remove # Compatibility with my speedwm build + if [ -e "$SWAL_EXPORTDIR/CurrentWallpaper" ]; then + rm -f $SWAL_EXPORTDIR/CurrentWallpaper_prev ; ln -s "$(readlink $SWAL_EXPORTDIR/CurrentWallpaper)" $SWAL_EXPORTDIR/CurrentWallpaper_prev + fi + + rm -f $SWAL_EXPORTDIR/CurrentWallpaper ; ln -s "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" $SWAL_EXPORTDIR/CurrentWallpaper + + command -v wal > /dev/null && wal -nqi "$SWAL_WALLPAPERDIR/$SWAL_SELWALLPAPER" + command -v speedwm_run > /dev/null && speedwm_run -rnoloadcolors +} + +# Send notification +SWAL_SENDNOTIFICATION() { + if [ "$SWAL_SELWAL" = "" ]; then + command -v notify-send > /dev/null && notify-send " $SWAL_SELWALLPAPER set as wallpaper in $(echo $SWAL_TYPE | sed "s|--||g") mode." + else + command -v notify-send > /dev/null && notify-send " $SWAL_SELWAL set as wallpaper in $(echo $SWAL_TYPE | sed "s|--||g") mode." + fi + + exit 0 +} + +SWAL_DEFAULT_CONFIG +SWAL_SOURCE || SWAL_DIE +SWAL_CHECK || SWAL_DIE +SWAL_SELWALLPAPER || SWAL_DIE + +SET() { + SWAL_SETTYPE || SWAL_DIE + SWAL_SETWALLPAPER || SWAL_DIE + + # Pywal + case "$SWAL_USE_WAL" in + "Yes") SWAL_EXPORT_SCRIPT_WAL || SWAL_DIE ;; + "No") SWAL_EXPORT_SCRIPT || SWAL_DIE ;; + "") exit 0 ;; + esac + + rm -rf $HOME/.local/share/swal_wm + cp $SWAL_EXPORTDIR/swal_wm $HOME/.local/share/swal_wm + chmod +x $HOME/.local/share/swal_wm + SWAL_SENDNOTIFICATION +} + +SET + +$0 && exit 0 diff --git a/src/speedwm-utils b/src/speedwm-utils new file mode 100755 index 0000000..fa013e1 --- /dev/null +++ b/src/speedwm-utils @@ -0,0 +1,115 @@ +#!/bin/sh +# speedwm-utils +# Because controlling speedwm using shell scripts is based. +# Licensed under GNU GPLv3. + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu # Run launcher to use (dmenu, rofi, etc.) ;; +esac + +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +VARS() { + BINDIR="$(dirname $(command -v speedwm-core))/" +} + +VARS + +GENERAL() { +GENERALOPTS=$(printf "mfact +\nmfact -\nToggle Sticky\nToggle Bar\nToggle Fullscreen\nReset Layout/mfact\nReorganize Tags" | $RUNLAUNCHER -l 20 -p 'What do you want to do?') +case "$GENERALOPTS" in +"mfact +") speedwm -s "#cmd:18" ;; +"mfact -") speedwm -s "#cmd:19" ;; +"Toggle Sticky") speedwm -s "#cmd:20" ;; +"Toggle Bar") speedwm -s "#cmd:21" ;; +"Toggle Fullscreen") speedwm -s "#cmd:22" ;; +"Reorganize Tags") speedwm -s "#cmd:25" ;; +"Reset Layout/mfact") speedwm -s "#cmd:59" ;; +esac +} + +OPT() { +MENUOPTS=$(printf "Layout\nReload .Xresources\nGeneral\nExit" | $RUNLAUNCHER -l 20 -p 'What do you want to do?') + +case "$MENUOPTS" in +"Layout") ${0} layout $2 && exit 0 ;; +"Reload .Xresources") ${0} reloadcolors && exit 0 ;; +"General") ${0} -general $2 && exit 0 ;; +"Exit") exit 0 ;; +esac +} + +HELP() { + printf "speedwm-utils - Control speedwm using your terminal or dmenu.\n" + printf "\nlayout Let the user select a speedwm layout" + printf "\nreloadcolors Reload .Xresources" + printf "\nexec Execute an fsignal signum" + printf "\nlist List all available signums" + printf "\n" +} + +L1="$(printf "L1: Tiling\n")" +L2="$(printf "L2: Floating\n")" +L3="$(printf "L3: Monocle\n")" +L4="$(printf "L4: Grid\n")" +L5="$(printf "L5: Deck\n")" +L6="$(printf "L6: Centered Master\n")" +L7="$(printf "L7: Centered Floating Master\n")" +L8="$(printf "L8: Dwindle\n")" +L9="$(printf "L9: Spiral\n")" +L10="$(printf "L10: Bottom Stack (Vertical)\n")" +L11="$(printf "L11: Bottom Stack (Horizontal)\n")" +L12="$(printf "L12: Grid (Horizontal)\n")" +L13="$(printf "L13: Dynamic Grid\n")" +L14="$(printf "L14: Custom\n")" + +case "$1" in +"layout") SEL_LAYOUT=$(printf "${L1}\n${L2}\n${L3}\n${L4}\n${L5}\n${L6}\n${L7}\n${L8}\n${L9}\n${L10}\n${L11}\n${L12}\n${L13}\n${L14}\nPrevious Layout\nNext Layout\nEnter S expression" | $RUNLAUNCHER -l 21 -p "Pick a layout: ") ;; +"reloadcolors") speedwm -s "#cmd:65" ;; +"list") sed 's|speedwm -s "#cmd:||g; s|"||g; s| - ||g; s@|@-@g' /usr/share/speedwm/example.signal | head -n "$(expr "$(cat /usr/share/speedwm/example.signal | wc -l)" - 1)" ;; +"help") HELP ;; +"exec") + if [ "$2" = "" ]; then + exit 0 + else + speedwm -s "#cmd:$2" + fi ;; +"h") HELP ;; +"general") GENERAL ;; +"") OPT ;; +esac + +case "$SEL_LAYOUT" in +"Exit") exit 0 ;; +"Previous Layout") speedwm -s "#cmd:16" ;; +"Next Layout") speedwm -s "#cmd:17" ;; +"L1: Tiling") speedwm -s "#cmd:1" ;; +"L2: Floating") speedwm -s "#cmd:2" ;; +"L3: Monocle") speedwm -s "#cmd:3" ;; +"L4: Grid") speedwm -s "#cmd:4" ;; +"L5: Deck") speedwm -s "#cmd:5" ;; +"L6: Centered Master") speedwm -s "#cmd:6" ;; +"L7: Centered Floating Master") speedwm -s "#cmd:7" ;; +"L8: Dwindle") speedwm -s "#cmd:8" ;; +"L9: Spiral") speedwm -s "#cmd:9" ;; +"L10: Bottom Stack (Vertical)") speedwm -s "#cmd:10" ;; +"L11: Bottom Stack (Horizontal)") speedwm -s "#cmd:11" ;; +"L12: Grid (Horizontal)") speedwm -s "#cmd:12" ;; +"L13: Dynamic Grid") speedwm -s "#cmd:13" ;; +"L14: Custom") speedwm -s "#cmd:1" && speedwm -s "#cmd:17" ;; +"Enter S expression") speedwm -s "#cmd:15" ;; +esac diff --git a/src/speedwm-virtualkeyboard b/src/speedwm-virtualkeyboard new file mode 100755 index 0000000..5a198e7 --- /dev/null +++ b/src/speedwm-virtualkeyboard @@ -0,0 +1,2253 @@ +#!/bin/sh +# speedwm-virtualkeyboard +# Licensed under GNU GPLv3 +# https://speedie.gq/speedwm + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +HAVE_GRID="true" +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +BINDIR="$(dirname $(command -v speedwm-core))/" + +EMOJILIST() +{ +printf "🙂 Slightly smiling face +😀 Smiling face +😃 Smiling face with big eyes +😄 Smiling face with smiling eyes +😁 Beaming face with smiling eyes +😅 Smiling face with tears +😆 Grinning face +🤣 Rolling on the floor laughing +😂 Lauging with tears +🙃 Upside down face +😉 Winking face +😊 Smiling face with smiling eyes +😇 Smiling face with halo +😎 Smiling face with sunglasses +🤓 Nerdy face +🧐 Face with monocle +🥳 Partying face +🥰 Smiling face with hearts +😍 Smiling face with heart eyes +🤩 Star-struck +😘 Face blowing kiss +😗 Kissing face +☺ Smiling face +😚 Kissing face with closed eyes +😙 Kissng face with smiling eyes +🥲 Smiling face with tears +😋 Yummy face +😛 Face with tongue +😜 Winking face with tongue +🤪 Zanny face +😝 Squinting face with tongue +🤑 Money face with money tongue +🤗 Hugs +🤭 Face with hand in mouth +🤫 Shushing face +🤔 Thinkin face +😐 Neutral face +🤐 Zipped mouth +🤨 Face with raised eyebrow +😑 Expressionless face +😶 Face with no mouth +😏 Smirking face +😒 Unamused face +🙄 Face with rolling eyes +😬 Grimacing face +😮 💨 Grimacing face +🤥 Lying face +😪 Sleepy face +😴 Sleeping face +😌 Relieved face +😔 Pensive face +🤤 Drooling face +😷 Face with mask +🤒 Face with thermometer +🤕 Face with bandage +🤢 Nauseous face +🤮 Vomiting face +🤧 Sneezing face +🥵 Hot face +🥶 Cold face +🥴 Woozy face +😵 Face with crossed-out face +🤯 Face with exploding head +😕 Confused face +😟 Worried face +🙁 Slightly frowning face +☹ Frowning face +😮 Face with open mouth +😯 Hushed face +😲 Astonished face +😳 Flushed face +🥺 Begging face +😦 Frowning face with open mouth +😧 Angushed face +😨 Fearful face +😰 Anxious face with sweat +😥 Sad but relieved face +😢 Crying face +😭 Loudly crying face +😱 Screaming face +😖 Confounded face +😣 Persevering face +😞 Disapointed face +😓 Downcast face with sweat +😩 Weary face +😫 Tired face +🥱 Yawning face +😤 Face with steam +😡 Pouting face +😠 Angry face +🤬 Face with symbols on mouth +😈 Smiling face with horns +👿 Angry face with horns +💀 Skull +☠ Skull and cross-bone +💩 Pile of poo +🤡 Clown +👹 Ogre +👺 Goblin +👻 Ghost +👽 Alien +👾 Alien monster +🤖 Robot +😺 Grinnig cat +😸 Grinning cat with smiling eyes +😹 Grinning cat with tears +😻 Smiling cat with heart eyes +😼 Cat with wry smile +😽 Kissing cat +🙀 Weary cat +😿 Crying cat +😾 Pouting cat +🙈 See no evil monkey +🙉 Hear no evil monkey +🙊 Speak no evil monkey +💋 Kiss +💌 Love letter +💘 Heart with arrow +💝 HEart with ribbon +💖 Sparking heart +💗 Growing heart +💓 Beating heart +💞 Revolving heart +💕 Two hearts +💟 Heart decoration +❣ Heart exclamation +💔 Broken heart +❤️ 🔥 Heart on fire +❤️ 🩹 Mending heart +❤ Red heart +🧡 Orange heart +💛 Yellow heart +💚 Green heart +💙 Blue heart +💜 Purple heart +🤎 Brown heart +🖤 Black heart +🤍 White heart +💯 Hundred(correct) +💢 Anger +💥 collision +💫 Dizzy +💦 Sweat droplets +💨 Dashing away +🕳 Hole +💣 Bomb +💬 Message baloon +👁️ 🗨️ Eye in speech bubble +🗨 Left speech bubble +🗯 Anger bubble +💭 Thought baloon +💤 zzz +👋 Waving hand +🤚 Raised back of hand +🖐 Hands with splayed finger +✋ Raised hand +🖖 Vulcan salute +👌 Ok +🤌 Pinched fingers +🤏 Pinched hand +✌ Victory hand +🤞 Crossed fingers +🤟 Love you +🤘 Horn sign +🤙 Call me hand +👈 Index finger pointing left +👉 Index finger pointing right +👆 Index finger pointing up +👇 Index finger pointing down +🖕 Middle finger +☝ Forehand Index finger pointing up +🫵 Index finger pointing at viewer +👍 Thumbs up +👎 Thumbs down +✊ Raised fist +👊 Fist +🤛 Left facing fist +🤜 Right facing fist +👏 Clapping hands +🙌 Raised hands +👐 OPen hands +🤲 Palms together hands +🤝 Handshake +🙏 Praying hands +✍ Writing hands +💅 Nail polish +🤳 Selfie hand +💪 Flexed biceps +🦾 MEchanical arm +🦵 Leg +🦿 Mechanical leg +🦶 Foot +👂 Ear +🦻 Ear with earing aid +👃 Nose +🧠 Brain +👣 Footprint +🫀 MEchanical heart +🫁 Lungs +🦷 Tooth +🦴 Bone +👀 Eyes +👁 Eye +👅 Nose +👄 Mouth +🧑 Person +👶 Baby +🧒 Child +👦 Boy +👧 Girl +👱 Person with blonde hair +👨 Man +🧔 Bearded person +🧔 ♂‍ Bearded man +🧔 ♀‍ Bearded woman +👨 🦰 MAn with red hair +👨 🦱 Man with curly hair +👨 🦳 Man with white hair +👨 🦲 Bald man +👩 Woman +👩 🦰 Woman with red hair +👩 🦱 Woman with curly hair +👩 🦳 Woman with white hair +👩 🦲 Bald woman +👱 ♀‍ Woman with blode hair +👱 ♂‍ Man with blonde hair +🧓 Old person +👴 Old man +👵 Old woman +🙍 Person frowning +🙍 ♂‍ Man frowning +🙍 ♀‍ Woman frowning +🙎 Person pouting +🙎 ♂‍ Man pouting +🙎 ♀‍ Woman pouting +🙅 Person gesturing no +🙅 ♂‍ Man gesturing no +🙅 ♀‍ Woman gesturing no +🙆 Person stretching +🙆 ♂‍ Man stretching +🙆 ♀‍ Woman stretching +💁 Person tipping hand +💁 ♂‍ Man tipping hand +💁 ♀‍ Woman tipping hand +🙋 Person rainsing hand +🙋 ♂‍ Man raising hand +🙋 ♀‍ Woman raisning hand +🧏 Deaf person +🧏 ♂‍ Deaf man +🧏 ♀‍ Deaf woman +🙇 Person bowing +🙇 ♂‍ Man bowing +🙇 ♀‍ Woman bowing +🤦 Person facepalming +🤦 ♂‍ Man facepalming +🤦 ♀‍ Woman facepalming +🤷 Person shrugging +🤷 ♂‍ Man shrugging +🤷 ♀‍ Woman shrugging +🧑 ⚕‍ Health worker +👨 ⚕‍ Man health worker +👩 ⚕‍ Woman health worker +🧑 🎓 Student +👨 🎓 Man student +🧑 🏫 Teacher +👨 🏫 Man teacher +👩 🏫 Woman teacher +🧑 ⚖‍ Judge +👨 ⚖‍ Man judge +👩 ⚖‍ Woman judge +🧑 🌾 Farmer +👨 🌾 Man farmer +👩 🌾 Woman farmer +🧑 🍳 Cook +👨 🍳 Man cook +👩 🍳 Woman cook +🧑 🔧 Mechanic +👨 🔧 Man mechanic +👩 🔧 Woman mechanic +🧑 🏭 Factory worker +👨 🏭 Man factory worker +👩 🏭 Woman factory worker +🧑 💼 Office worker +👨 💼 Man office worker +👩 💼 Woma office worker +🧑 🔬 Scientist +👨 🔬 Man scientist +👩 🔬 Woman scientis +🧑 💻 Technologist +👨 💻 Man texhnologist +👩 💻 Woman technologist +🧑 🎤 Singer +👨 🎤 Man singer +👩 🎤 Woman singer +🧑 🎨 Artist +👨 🎨 Man artist +👩 🎨 Woman artist +🧑 ✈‍ Pilot +👨 ✈‍ Man pilot +👩 ✈‍ Woman pilot +🧑 🚀 Astronaut +👨 🚀 Man astronaut +👩 🚀 Woman astronaut +🧑 🚒 Firefighter +👨 🚒 Man firefighter +👩 🚒 Woman firefighter +👮 Police +👮 ♂‍ Policeman +👮 ♀‍ Policewoman +🕵 Detective +🕵️ ♂‍ Man detective +🕵️ ♀‍ Woman detective +💂 Guard +💂 ♂‍ Man guard +💂 ♀‍ Woman guard +🥷 Ninja +👷 Construction worker +👷 ♂‍ Man construction worker +👷 ♀‍ Woman construction worker +🤴 Prince +👸 Princess +👳 Person wearing turban +👳 ♂‍ Man wearing turban +👳 ♀‍ Woman wearing turban +👲 Person with skullcap +🧕 Woman with headscaff +🤵 Person in tuxedo +🤵 ♂‍ Man in tuxedo +🤵 ♀‍ Woman in tuxedo +👰 Person in veil +👰 ♂‍ Man in veil +👰 ♀‍ Woman in veil +🤰 Pregnant woman +🤱 Breast-feeding +🧑 🍼 Person feeding baby +👩 🍼 WOman feeding baby +👨 🍼 Man feeding baby +👼 Baby angel +🎅 Santa claus +🤶 Mrs Claus +🧑 🎄 Mx Claus +🦸 Superhero +🦸 ♂‍ Man superhero +🦸 ♀‍ Woman superhero +🦹 Supervillain +🦹 ♂‍ Man superhero +🦹 ♀‍ Woman superhero +🧙 Mage +🧙 ♂‍ Man mage +🧙 ♀‍ Woman mage +🧚 Fairy +🧚 ♂‍ Man fairy +🧚 ♀‍ Woman fairy +🧛 Vampire +🧛 ♂‍ Man vampire +🧛 ♀‍ Woman vampire +🧜 Merperson +🧜 ♂‍ Merman +🧜 ♀‍ Mermaid +🧝 Elf +🧝 ♂‍ Man elf +🧝 ♀‍ Woman elf +🧞 Genie +🧞 ♂‍ Man genie +🧞 ♀‍ Woman genie +🧟 Zombie +🧟 ♂‍ Man zombie +🧟 ♀‍ Woman zombie +💆 Person getting massage +💆 ♂‍ Man getting massage +💆 ♀‍ Woman getting massage +💇 Person getting haircut +💇 ♂‍ Man getting haircut +💇 ♀‍ Woman getting haircut +🚶 Person walking +🚶 ♂‍ Man walking +🚶 ♀‍ Woman walking +🧍 Person standing +🧍 ♂‍ Man standing +🧍 ♀‍ Woman standing +🧎 Person kneeling +🧎 ♂‍ Man kneeling +🧎 ♀‍ Woman kneeling +🧑 🦯 PErson with walking stick +👨 🦯 Man with walking stick +👩 🦯 Woman with walking stick +🧑 🦼 Person in motorized wheelchair +👨 🦼 Man in motorized wheelchair +👩 🦼 Womain in motorized wheelchair +🧑 🦽 Person in manual wheelchair +👨 🦽 Man in manual wheelchair +👩 🦽 Womaan in motorized wheelchair +🏃 Person sprinting +🏃 ♂‍ Man sprinting +🏃 ♀‍ Woman sprinting +💃 Woman dancing +🕺 Man dancing +🕴 Person in suit levitating +👯 People with bunny ears +👯 ♂‍ Men with bunny ears +👯 ♀‍ Women in bunny ears +🧖 Person in steaming room +🧖 ♂‍ Man in steaming room +🧖 ♀‍ Woman in steaming room +🧗 Person climbing +🧗 ♂‍ Man climbing +🧗 ♀‍ Woman climbing +🤺 Person fencing +🏇 Horse racing +⛷ Skier +🏂 Snowball +🏌 Person playing golf +🏌️ ♂‍ Man playing golf +🏌️ ♀‍ Woman playing golf +🏄 Person surfing +🏄 ♂‍ Man surfing +🏄 ♀‍ Woman surfing +🚣 Person rowing boat +🚣 ♂‍ Man rowing boat +🚣 ♀‍ Woman rowing boat +🏊 Person swimming +🏊 ♂‍ Man swimming +🏊 ♀‍ Woman swimming +⛹ Person bouncing ball +⛹️ ♂‍ Man bouncing ball +⛹️ ♀‍ Woman bouncing ball +🏋 Person lifting weight +🏋️ ♂‍ Man lifting weight +🏋️ ♀‍ Woman lifting weight +🚴 Person cycling +🚴 ♂‍ Man cycling +🚴 ♀‍ Woman cycling +🚵 Person mountain biking +🚵 ♂‍ Man mountain biking +🚵 ♀‍ Woman mountain biking +🤸 Person catwheeling +🤸 ♂‍ Man catwheeling +🤸 ♀‍ Woman catwheeling +🤼 People wrestling +🤼 ♂‍ Men wrestling +🤼 ♀‍ Women wrestling +🤽 Person playing water polo +🤽 ♂‍ Man playing water polo +🤽 ♀‍ Woman playing water polo +🤾 Person playing handball +🤾 ♂‍ Man playing handball +🤾 ♀‍ Woman playing handball +🤹 Person juggling +🤹 ♂‍ Man juggling +🤹 ♀‍ Woman juggling +🧘 Person lotus position +🧘 ♂‍ Man in lotus position +🧘 ♀‍ Woman in lotus position +🛀 Person bathing +🛌 Person in bed +👪 Family +👨 👩‍👦 Family: man, woman, and boy +👨 👩‍👧 Family: man, woman, and girl +👨 👩‍👧‍👦 Family: man, woman, boy, and girl +👨 👩‍👦‍👦 Family: man, woman, and two boys +👨 👩‍👧‍👧 Family: man, woman, and two girls +👨 👨‍👦 Family: two men and boy +👨 👨‍👧 Family: two men and girl +👨 👨‍👧‍👦 Family: two men, girl, and boy +👨 👨‍👦‍👦 Family: two men and two boys +👨 👨‍👧‍👧 Family: two men and two girls +👩 👩‍👦 Family: two women and boy +👩 👩‍👧 Family: two women and girl +👩 👩‍👧‍👦 Family: two women, girl, and boy +👩 👩‍👦‍👦 Family: two women and two boys +👩 👩‍👧‍👧 Family: two women and two girls +👨 👦 Family: man and boy +👨 👦‍👦 Family: man and two boys +👨 👧 Family: man and girl +👨 👧‍👦 Family: man, girl and boy +👨 👧‍👧 Family: man and two girls +👩 👦 Family: woman and boy +👩 👦‍👦 Family: woman and two boys +👩 👧 Family: woman and girl +👩 👧‍👦 Family: woman, girl, and boy +👩 👧‍👧 Family: woman and two girls +🧑 🤝‍🧑 People holding hands +👭 Women holding hands +👫 Woman and man holding hands +👬 Men holding hands +💏 Kiss +👩 ❤‍💋‍👨 Woman and man kissing +👨 ❤‍💋‍👨 Man and man kissing +👩 ❤‍💋‍👩 Womand and woman kissing +💑 Couple with heart +🗣 Person speaking +👤 Bust in silhouhette +👥 Busts in silhouette +🫂 People hugging +🐵 Monkey face +🐒 Monkey +🦍 Gorilla +🦧 Orangutan +🐶 Dog face +🐕 Dog +🦮 Guide dog +🐕 🦺 Service dog +🐩 Poodle +🐺 Wolf +🦊 Fox +🦝 Racoon +🐱 Cat face +🐈 Cat +🐈 ⬛ Black cat +🦁 Lion +🐯 Tiger face +🐅 Tiger +🐆 Leopard +🐴 Horse face +🐎 Horse +🦄 Unicorn +🦓 Zebra +🦌 Deer +🦬 Bison +🐮 Cow face +🐄 Cow +🐂 Ox +🐃 Water buffalo +🐷 Pig face +🐖 Pig +🐗 Boar +🐽 Pig nose +🐏 Ram +🐑 Ewe +🐐 Goat +🐪 Camel +🐫 Two hump camel +🦙 Ilama +🦒 Giraffe +🐘 Elephant +🦣 Mammoth +🦏 Rhiniceros +🦛 Hippopotamus +🐭 Mouse face +🐁 Mouse +🐀 Rat +🐹 Hamster +🐰 Rabbit face +🐇 Rabbit +🐿 Chipmunk +🦫 Beaver +🦔 Hedgehog +🦇 Bat +🐻 Bear +🐻 ❄️ Polar bear +🐨 Koala +🐼 Panda +🦥 Sloth +🦦 Otter +🦨 Skunk +🦘 Kangaroo +🦡 Badger +🐾 Paw prints +🦃 Turkey +🐔 Chicken +🐓 Rooster +🐣 Hatching +🐤 Baby chick +🐥 Front-facing chick +🐦 Bird +🐧 Penguin +🕊 Dove +🦅 Eagle +🦆 Duck +🦢 Swan +🦉 Owl +🦤 Dodo +🪶 Feather +🦩 Flamingo +🦜 Peacock +🐸 Frog +🐊 Crocodile +🐢 Turtle +🦎 Lizard +🐍 Snake +🐲 Dragon face +🐉 Dragon +🦕 Sauropod +🦖 Tyranosaurus +🐳 Spouting whale +🐋 Whale +🐬 Dolphin +🦭 Seal +🐟 Fish +🐠 Tropical fish +🐡 Blowfish +🦈 Shark +🐙 Octopus +🐚 Spiral shell +🐌 Snail +🦋 Butterfly +🐛 Bug +🐜 Ant +🐝 Honeybee +🪲 Beetle +🐞 Lady Beetle +🦗 Cricket +🪳 Cockroach +🕷 Spider +🕸 Spider web +🦂 Scorpion +🦟 Mosquito +🪰 Fly +🪱 Worm +🦠 Microbe +💐 Bouquet +🌸 Cherry blossom +💮 White flower +🏵 Rosette +🌹 Rose +🥀 Wilted flower +🌺 Hibiscus +🌻 Sunflower +🌼 Blossom +🌷 Tulip +🌱 Seedling +🪴 Potted plant +🌲 Evergreen tree +🌳 Deciduous plant +🌴 Palm tree +🌵 Cactus +🌾 Sheaf of rice +🌿 Herb +☘ Shamrock +🍀 Four leaf clover +🍁 Maple leaf +🍂 Fallen leaf +🍃 Leaf fluttering in wind +🪴 Empty nest +🪴 Nest with eggs +🍇 Grapes +🍈 Melon +🍉 Water melon +🍊 Tangerine +🍋 Lime +🍌 Banana +🍍 Pineapple +🥭 Mango +🍎 Red apple +🍏 Green apple +🍐 Pear +🍑 Peach +🍒 Cherries +🍓 Strawberries +🫐 Blueberries +🥝 Kiwi fruit +🍅 Tomato +🫒 Olive +🥥 Coconut +🥑 Avocado +🍆 Eggplant +🥔 Potato +🥕 Carrot +🌽 Corn +🌶 Pepper +🫑 Bell pepper +🥒 Cucumber +🥬 Leafy green +🥦 Broccoli +🧄 Garlic +🧅 Onion +🍄 Mushroom +🥜 Peanuts +🫑 Beans +🌰 Chestnut +🍞 Bread +🥐 Croissant +🥖 Baguette bread +🫓 Flat bread +🥨 Pretzel +🥯 Bagel +🥞 Pancake +🧇 Waffle +🧀 Cheese wedge +🍖 Meat with bone +🍗 Poultry leg +🥩 Cut of meat +🥓 Bacon +🍔 Hamburger +🍟 French fries +🍕 Pizza +🌭 Hot dog +🥪 Sandwich +🌮 Taco +🌯 Burrito +🫔 Tamale +🥙 Stuffed flatbread +🧆 Falafel +🥚 Egg +🍳 Cooking +🥘 Shallow pan of food +🍲 Pot of food +🫕 Fondue +🥣 Bowl with food +🥗 Green salad +🍿 Popcorn +🧈 Butter +🧂 Salt +🥫 Canned food +🍱 Bento box +🍘 RIce cracker +🍙 Rice ball +🍚 Cooked rice +🍛 Curry rice +🍜 Steaming bowl +🍝 Spaghetti +🍠 Roasted sweet potato +🍢 Oden +🍣 Sushi +🍤 Fried shrimp +🍥 Fish cake with swiri +🥮 Moon cake +🍡 Dango +🥟 Dumpling +🥠 Fortune cookie +🥡 Take out box +🦀 Crab +🦞 Lobster +🦐 Shrimp +🦑 Squid +🦪 Oyster +🍨 Ice cream +🍧 Shaved ice cream +🍦 Soft ice cream +🍩 Doughnut +🍪 Cookie +🎂 Birthday cake +🍰 Short cake +🧁 Cup cake +🥧 Pie +🍫 Chocoloate +🍬 Candy +🍭 Lollipop +🍮 Custard +🍯 Honey pot +🍼 Baby bottle +🥛 Glass of milk +☕ Hot beverage +🫖 Teapot +🍵 Teacup without handle +🍶 Sake +🍾 Bottle with poppin cork +🍷 Wine glass +🍸 Cocktail glass +🍹 Tropical drink +🍺 Beer mug +🍻 Clinking beer mug +🥂 Clinking glasses +🥃 Tumbler glass +🥤 Cup with strawberry +🧋 Bubble tea +🧃 Beverage box +🧉 Mate +🧊 Ice +🥢 Chopsticks +🍽 Fork and knife with plate +🍴 Fork and knife +🥄 Spoon +🔪 Kitchen knife +🧋 Jar +🏺 Amphora +🌍 Globe showing Africa and Europe +🌎 Globe showing Americas +🌏 Globe showing Asia and Australia +🌐 Globe with meridians +🗺 World map +🧭 Compass +⛰ Mountain +🏔 Snowcap mountain +🌋 Volcanic mountain +🗻 Fuji mountain +🏕 Camping +🏖 Beach with umbrella +🏜 Desert +🏝 Desertified island +🏞 National park +🏟 Stadium +🏛 Classical building +🏗 Building construction +🧱 Brick +🪨 Rock +🪵 Wood +🛖 Hut +🏘 Houses +🏚 Derelict house +🏠 House +🏡 House with garden +🏢 Office building +🏣 Japanese office +🏤 Post office +🏥 Hospital +🏦 Bank +🏨 Hotel +🏩 Love hotel +🏪 Convenience store +🏫 School +🏬 Department +🏭 Factory +🏯 Japanese castle +🏰 Castle +💒 Wedding house +🗼 Tokyo tower +🗽 Statue of liberty +⛪ Church +🕌 Mosque +🛕 Hindu temple +🕍 Synagogue +⛩ Shinto shrine +🕋 Kaaba +⛲ Fountain +⛺ Tent +🌁 Foggy +🌃 Night with starrs +🏙 Citscape +🌅 Sunrise +🌄 Sunrise over mountains +🌆 Cityscape at dusk +🌇 Sunset +🌉 Bridge at night +♨ Hot springs +🎠 Carousel horse +🎡 Ferris wheel +🎢 Roller coaster +💈 Barber poll +🎪 Circus tent +🚂 Locomotive +🚃 Railway car +🚄 High speed train +🚅 Bullet train +🚆 Train +🚇 Metro +🚈 Light rail +🚉 Station +🚊 Tram +🚝 Monorail +🚞 Mountain railway +🚋 Tram car +🚌 us +🚍 Oncoming bus +🚎 Trolley bus +🚐 Minibus +🚑 Ambulance +🚒 Fire engine +🚓 Police car +🚔 Oncoming police car +🚕 Taxi +🚖 Oncoming taxi +🚗 Automobile +🚘 Oncoming automobile +🚙 Sport utility vehicle +🛻 Pickup truck +🚚 Delivery truck +🚛 Articulated lorry +🚜 Tractor +🏎 Racing car +🏍 Motorcycle +🛵 Scooter +🦽 Manual wheelchair +🦼 Motorized wheelchair +⌛ Hourglass done +⏳ Hourglass starting +⌚ Watch +⏰ Alarm +⏱ Stopwatch +⏲ Timer clock +🕰 Mantelpiece clock +🕛 Twelve +🕧 Twelve-thirty +🕐 One +🕜 One-thirty +🕑 Two +🕝 Two-thirty +🕒 Three +🕞 Three-thirty +🕓 Four +🕟 Four-thirty +🕔 Five +🕠 Five-thirty +🕕 Six +🕡 Six-thirty +🕖 Seven +🕢 Seven-thirty +🕗 Eight +🕣 Eight-thirty +🕘 Nine +🕤 Nine-thirty +🕙 Ten +🕥 Ten-thirty +🕚 Eleven +🕦 Eleven-thirty +🌑 New moon +🌒 Waxing crescent moon +🌓 First quarter moon +🌔 Waxing gibbous moon +🌕 Full moon +🌖 Waning gibbous moon +🌗 Last quarter moon +🌘 Waning crescent moon +🌙 Crescent moon +🌚 New moon face +🌛 First quarter moon face +🌜 Last quartermoon face +🌡 Thermometer +☀ Sun +🌝 Full moon face +🌞 Sun with face +🪐 Ringed planet +⭐ Star +🌟 Glowing star +🌠 Shooting star +🌌 Milky way +☁ Cloud +⛅ Sun behind cloud +⛈ Cloud with lighting and rain +🌤 Sun behind small cloud +🌥 Sun behind large cloud +🌦 Sun behind rain cloud +🌧 Cloud with rain +🌨 Cloud with snow +🌩 Cloud with lighting +🌪 Tornado +🌫 Fog +🌬 Wind face +🌀 Cyclone +🌈 Rainbow +🌂 Closed umbrella +☂ Umbrella +☔ Umbrella with raindrops +⛱ Umbrella on ground +⚡ High voltage +❄ Snowflake +☃ Snowman +⛄ Snowman without snow +☄ Comet +🔥 Fire +💧 Droplet +🌊 Water wave +🎃 Jack-o-lantern +🎄 Christmas tree +🎆 Fireworks +🎇 Sparkler +🧨 Firecracker +✨ Sparkles +🎈 Baloon +🎉 Party popper +🎊 Confetti ball +🎋 Tanabata tree +🎍 Pine decoration +🎎 Japanese dolls +🎏 Carp streamer +🎑 Moon viewing ceremony +🧧 Red envelope +🎀 Ribbon +🎁 Wrapped gift +🎗 Reminder ribbon +🎟 Admission ticket +🎫 Ticket +🎖 Military medal +🏆 Trophy +🏅 Sports medal +🥇 Gold medal - first position +🥈 Silver medal - second position +🥉 Bronze medal - third position +⚽ Soccer ball +⚾ Baseball +🥎 Softball +🏀 BAsketball +🏐 Volleyball +🏈 American football +🏉 Rugby +🎾 Tennis +🥏 Flying disk +🎳 Bowling +🏏 Cricket +🏑 Field hockey +🏒 Ice hockey +🥍 Lacrose +🏓 Ping pong +🏸 Badminton +🥊 Boxing glove +🥋 Martial arts uniform +🥅 Goal net +⛳ Flag in a hole +⛸ Ice skate +🎣 Fishing poll +🤿 Driving mask +🎽 Running shirt +🎿 Skis +🛷 Sled +🥌 Curling stone +🎯 Bullseye +🪀 Yo-yo +🪁 Kite +🎱 8 ball +🔮 Crystal ball +🪄 Magic wand +🧿 Nazar amulet +🪄 Hamsa +🎮 Video game pad +🕹 Joystick +🎰 Slot machine +🎲 Game die +🧩 Puxxle piece +🧸 Teddy bear +🪅 Pinata +🪆 Mirror +🪆 Nesting doll +♠ Spade suit +♥ Heart suit +♣ Club suit +♟ Chess pawn +🃏 Joker +🀄 Mahjong red dragon +🎴 Flower playing cards +🎭 Performing arts +🖼 Framed picture +🎨 Artist pallete +🧵 Thread +🪡 Sewing needle with thred +🧶 Yarn +🪢 Knot +👓 Glasses +🕶 Sunglasses +🥽 Googles +🥼 Lab coat +🦺 Safety vest +👔 Necktie +👕 T-shirt +👖 Jeans +🧣 Scarf +🧤 Gloves +🧥 Coat +🧦 Socks +👗 Dress +👘 Kimono +🥻 Sari +🩱 One piece suit +🩲 Briefs +🩳 Shorts +👙 Bikini +👚 Woma +👛 Purse +👜 Handbag +👝 Clutch bag +🛍 Shopping bags +🎒 Backpack +🩴 Thong sandals +👞 Ma +👟 Running shoe +🥾 Hiking boot +🥿 Flat shoe +👠 High-heeled shoe +👡 Woma +🩰 Ballet shoes +👢 Woma +👑 Crown +👒 Woma +🎩 Top hat +🎓 Graduation cap +🧢 Billed cap +🪖 Military helmet +⛑ Rescuew worke +📿 PRayer beads +💄 Lipstick +💍 Ring +💎 Gemstone +🔇 Muted speaker +🔈 Low volume speaker +🔉 Mid volume speaker +🔊 High volume speaker +📢 Loudspeaker +📣 Megaphone +📯 Postal horn +🔔 Bell +🔕 Bell with slash +🎼 Musical score +🎵 Musical note +🎶 Musical notes +🎙 Studio microphone +🎚 Level slider +🎛 Control knobs +🎤 Microphone +🎧 Headphone +📻 Radio +🎷 Saxophone +🪗 Accordion +🎸 Guitar +🎹 Musical keyboard +🎺 Trumpet +🎻 Violin +🪕 Banjo +🥁 Drum +🪘 Long drum +📱 Mobile phone +📲 MObile phone with arrow +☎ Telephone +📞 Telephone receiver +📟 Pager +📠 Fax machine +🔋 Full battery +🪫 Low battery +🔌 Electric plug +💻 Laptop +🖥 Desktop computer +🖨 Printer +⌨ Keyboard +🖱 Mouse +🖲 Trackball +💽 Computer disk +💾 Floppy disk +💿 Optical disk +📀 DVD +🧮 Abacus +🎥 Movie camera +🎞 Film frames +📽 Film Projector +🎬 Clapper board +📺 Television +📷 Camera +📸 Camera with flash +📹 Video camera +📼 Video cassete +🔍 Magnifying glass tilted left +🔎 Magnifying glass tilted right +🕯 Candle +💡 Light bulb +🔦 Flashlight +🏮 Red pepper lantern +🪔 Diya lamp +📔 Notebook with decorative cover +📕 Closed notebook +📖 Opened notebook +📗 Green book +📘 Blue book +📙 Orange book +📚 Orange books +📓 Notebook +📒 Ledger +📃 Page with curl +📜 Scroll +📄 Page facing up +📰 Newspaper +🗞 Rolled-up newspaper +📑 Bookmark tabs +🔖 Bookmark +🏷 Label +💰 Money bag +🪙 Coin +💴 Yen banknote +💵 Dollar banknote +💶 Euro banknote +💷 Pound banknote +💸 Money with wings +💳 Credit card +🧾 Receipt +💹 Chart increase woth Yen +✉ Envelope +📧 e-mail +📩 Envelope with arrow +📤 Outbox tray +📥 Inbox tray +📦 Package +📫 Closed mailbox with raised flag +📪 Closed mailbox with lowered flag +📬 Open mailbox with raised flag +📭 Open mailbox with lowered flag +📮 Postbox +🗳 Ballot box with ballot +✏ Pencil +✒ Black nib +🖋 Fountain pen +🖊 Pen +🖌 Paintbrush +🖍 Crayon +📝 Memo +💼 Briefcase +📁 File folder +📂 Open the folder +🗂 Card index dividers +📅 Calender +📆 Tear off calender +📇 Card index +📈 Increasing chart +📉 Decreasing chart +📊 Bar chart +📋 Clipboard +📌 Pushpin +📍 Round pushpin +📎 Paperclip +🖇 Linked paperclips +📏 Straight ruler +📐 Triangular ruler +✂ Scissors +🗃 Card file box +🗄 File cabinet +🗑 Waste basket +🔒 Locked +🔓 Unlocked +🔏 Locked with pen +🔐 Locked with key +🔑 Key +🗝 Old key +🔨 Hammer +🪓 Axe +⛏ Pick +⚒ Hammer and pick +🛠 Hammer and wrench +🗡 Sword +⚔ Crossed swords +🔫 Water gun +🪃 Boomerang +🏹 Bow and arrow +🛡 Shield +🪚 Carpentry saw +🔧 Wrench +🪛 Screwdriver +🔩 Bolt and nut +⚙ Wheel +🗜 Clamp +⚖ Balance scale +🦯 White cane +🔗 Link +⛓ Chains +🪝 Hook +🧰 Toolbox +🧲 Magnet +🪜 Ladder +⚗ Alembic +🧪 Test tube +🧫 Petri dish +🧬 DNA +🔬 Microscope +🔭 Telescope +📡 Satelite antenna +💉 Syringe +🩸 A droplet of blood +💊 Pill +🩹 Adhesive bandage +🩼 Clutch +🩺 Stethoscope +🩻 X-ray +🚪 Door +🛗 Elevator +🪞 Mirror +🪟 Window +🛏 Bed +🛋 Couch and lamp +🪑 Chair +🚽 Toilet +🪠 Plunger +🚿 Shower +🛁 Bathtub +🪤 Mouse trap +🪒 Razor +🧴 Lotion bottle +🧷 Safety pin +🧹 Broom +🧺 Basket +🧻 Roll of paper +🪣 Bucket +🧼 Soap +🫧 Bubbles +🪥 Toothbrush +🧽 Sponge +🧯 Fire extinguisher +🛒 Shopping cart +🚬 Cigarette +⚰ Casket +🪦 Headstone +⚱ Funeral urn +🗿 Mole +🪧 Placard +🪪 ID Card +🏧 ATM Sign +🚮 Litter in bin +🚰 Portable water +♿ Wheelchair symbol +🚹 Me +🚺 Wome +🚻 Restroom symbol +🚼 Baby symbol +🚾 Water closet +🛂 Passport control +🛂 Customs +🛄 Baggage claim +🛅 Left laugage +⚠ Warning +🚸 Children crossing +⛔ No entry +🚫 Prohibited +🚳 No bicycles +🚭 No smoking +🚯 No littering +🚱 Non-portable water +🚷 No pedestrians +📵 No mobile phones +🔞 No one under 18 +☢ Radioactive +☣ Biohazard +⬆ Up Arrow +↗ Up-right arrow +➡ Right arrow +↘ Down-right arrow +⬇ Down arrow +↙ Down-left arrow +⬅ Left arrow +↖ Up-left arrow +↕ Up-down arrow +↔ Left arrow +↩ Right arrow curving left +↪ Left arrow curving right +⤴ Right arrow curving up +⤵ Right arrow curving down +🔃 Clockwise vertical arrow +🔄 Counterclockwise arrows button +🔙 Back arrow +🔚 End arrow +🔛 On arrow +🔜 Soon arrow +🔝 Top arrow +🛐 Place of worship +⚛ Atom symbol +🕉 OM +✡ Star of David +☸ Wheel of Dharma +☯ Yin yang +✝ Latin cross +☦ ORthodox cross +☪ Star and cresent moon +☮ Peace +🕎 Menorah +🔯 Six-pointed star +♈ Aries +♉ Taurus +♊ Gemini +♋ Cancer +♌ Leo +♍ Virgo +♎ Libra +♏ Scorpio +♐ Sagittarius +♑ Capricon +♒ Acquarius +♓ Pisces +⛎ Ophiucus +🔀 Shuffle tracks +🔁 Repeat all +🔂 Repeat one +▶ Play +⏸ Pause +⏩ Fast-forward +⏭ Next track +⏯ Play or pause +◀ Reverse +⏪ Fast-reverse +⏮ Previous track +🔼 Upwards +⏫ Fst-up +🔽 Downwards +⏬ Fast down +⏹ Stop +⏺ Record +⏏ Eject +🎦 Cinema +🔅 Dim +🔆 Bright +📶 Network antenna bars +📳 Vibration mode +📴 Mobile phone off +♀ Female +♂ Male +⚧ Transgender +✖ Times +➕ Plus +➖ Minus +➗ Divide +🟰 Equals +♾ Infinity +‼ Double exclamation +⁉ Exclamation and question mark +❓ Red question mark +❔ White question mark +❗ Red exclamation mark +❕ White exclamation mark +〰 Wavy dash +💱 Currency exchange +💲 Heavy green dollar sign +⚕ Medical symbol +♻ Recycling symbol +⚜ Fleur-de-lis +🔱 Trident +📛 Name badge +🔰 Japanese symbol for beginner +⭕ Hollow red circle +✅ Green box with checkmark +☑ Blue box with checkmark +✔ Checkmark +❌ Crossmark +❎ Green crossmark +➰ Curly loop +➿ Double curly loop +〽 PArt alternation mark +✳ Eight-spoked asterik +✴ Eight-pointed star +❇ Sparkle +© Copyright symbol +® Registered +™ Trademark +*️⃣ * Keyca +0️⃣ 0 Keycap +1️⃣ 1 Keycap +2️⃣ 2 Keycap +3️⃣ 3 Keycap +4️⃣ 4 Keycap +5️⃣ 5 Keycap +6️⃣ 6 Keycap +7️⃣ 7 Keycap +8️⃣ 8 Keycap +9️⃣ 9 Keycap +🔟 10 Keycap +🔠 Input Latin uppercase +🔡 Input Latin lowercase +🔢 Input numbers +🔣 Input symbols +🔤 Input Latin letters +🅰 A blood type +🆎 AB blood type +🅱 B blood type +🅾 O blood type +🆑 CL button +🆒 Cool button +🆓 Free button +ℹ Info button +🆔 ID button +Ⓜ Circled M +🆕 New button +🆖 NG button +🆗 OK button +🅿 P button +🆘 SOS button +🆙 UP! button +🆚 VS Button +🈁 Japanese here button +🈂 Japanese service charge button +🈷 Japanese monthly amount button +🈶 Japanese not free of charge button +🈯 Japanese reserved button +🉐 Japanese bargain button +🈹 Japanese discount button +🈚 Japanese free of charge button +🈲 Japanese prohibited button +🉑 Japanese acceptable button +🈸 Japanese application button +🈴 Japanese passing grade button +🈳 Japanese vacancy button +㊗ Japanese congratulations button +㊙ Japanese secret button +🈺 Japanese open for business button +🈵 Japanese no vacancy button +🔴 Red circle +🟠 Orange circle +🟡 Yellow circle +🟢 Green circle +🔵 Blue circle +🟣 Purple circle +🟤 Brown circle +⚫ Black circle +⚪ White circle +🟥 Red square +🟧 Orange square +🟨 Yellow square +🟩 Green square +🟦 Blue square +🟪 Purple square +🟫 Brown square +⬛ Black square +⬜ White square +🔶 Large orange diamond +🔷 Large blue diamond +🔸 Small orange diamond +🔹 Small blue diamond +🔺 Red triangle pointed up +🔻 Red triangle pointed down +💠 Diamond with a dot +🔘 Radio button +🔳 White square button +🔲 Black square button +🏁 Chequered flag +🚩 Triangular flag +🎌 Crossed flag +🏴 Black flag +🏳 White flag +🏳️‍🌈 Rainbow flag +🏳️‍⚧️ Transgender flag +🏴‍☠️ Pirate flag +🇦🇨 Ascension Island flag +🇦🇩 Andorra flag +🇦🇪 UAE flag +🇦🇫 Afghanistan flag +🇦🇬 Antigua and Berbuda flag +🇦🇮 Anguila flag +🇦🇱 Albania flag +🇦🇲 Armenia flag +🇦🇴 Angola flag +🇦🇶 Antarctica flag +🇦🇷 Argentina flag +🇦🇸 American Samoa flag +🇦🇹 Austria flag +🇦🇺 Australia flag +🇦🇼 Aruba flag +🇦🇽 Åland Islands flag +🇦🇿 Azerbaijan flag +🇧🇦 Bosnia flag +🇧🇧 Barbados flag +🇧🇩 Bangladesh flag +🇧🇪 Belgium flag +🇧🇫 Burkina Faso flag +🇧🇬 Bulgaria flag +🇧🇭 Bahrain flag +🇧🇮 Burundi flag +🇧🇯 Benin Republic flag +🇧🇱 St. Barthélemy +🇧🇲 Bermuda flag +🇧🇳 Brunei flag +🇧🇴 Bolivia flag +🇧🇶 Caribbean Netherlands flag +🇧🇷 Brazil flag +🇧🇸 Bahamas flag +🇧🇹 Bhutan flag +🇧🇻 Bouvet Island flag +🇧🇼 Botswana flag +🇧🇾 Belarus flag +🇧🇿 Belize flag +🇨🇦 Canada flag +🇨🇨 Cocos Islands flag +🇨🇩 Congo DR flag +🇨🇫 CAR (Central African Republic) flag +🇨🇬 Congo Brazzaville flag +🇨🇭 Switzerland flag +🇨🇮 Côte d’Ivoire flag +🇨🇰 Cook Islands flag +🇨🇱 Chile flag +🇨🇲 Cameroun flag +🇨🇳 China flag +🇨🇴 Columbia flag +🇨🇵 Clipperton Island flag +🇨🇷 Costa Rica flag +🇨🇺 Cuba flag +🇨🇻 Cape Verde Island flag +🇨🇼 Curaçao flag +🇨🇽 Christmas Island flag +🇨🇾 Cyprus flag +🇩🇪 Germany flag +🇩🇬 Diego Garcia flag +🇩🇯 Djibouti flag +🇩🇰 Denmark flag +🇩🇲 Dominica flag +🇩🇴 Dominican Republic flag +🇩🇿 Algeria flag +🇪🇦 Ceuta +🇪🇨 Ecuador flag +🇪🇪 Estonia +🇪🇬 Egypt flag +🇪🇭 Western Sahara flag +🇪🇷 Eritrea flag +🇪🇸 Spain flag +🇪🇹 Ethiopia flag +🇪🇺 EU flag +🇫🇮 Finland flag +🇫🇯 Fiji flag +🇫🇰 Falkland Island flag +🇫🇲 Micronesia flag +🇫🇴 Faroe Island flag +🇫🇷 France flag +🇬🇦 Gabon flag +🇬🇧 United Kingdom flag +🇬🇩 Grenada flag +🇬🇪 Georgia flag +🇬🇫 French Guiana flag +🇬🇬 Guernsey flag +🇬🇭 Ghana flag +🇬🇮 Gibraltar flag +🇬🇱 Greenland flag +🇬🇲 Gambia flag +🇬🇳 Guinea flag +🇬🇵 Guadeloupe flag +🇬🇶 Equitorial Guinea flag +🇬🇷 Greece flag +🇬🇸 South Georgia +🇬🇹 Guatemala flag +🇬🇺 Guam flag +🇬🇼 Guinea Bissau flag +🇬🇾 Guyana flag +🇭🇰 Hong Kong flag +🇭🇲 Heard +🇭🇳 Honduras flag +🇭🇷 Croatia flag +🇭🇹 Haiti flag +🇭🇺 Hungary flag +🇮🇨 Canary Islands flag +🇮🇩 Indonesia flag +🇮🇪 Island flag +🇮🇱 Israel flag +🇮🇲 Isle of Man flag +🇮🇳 India flag +🇮🇴 British Indian Ocean Territory flag +🇮🇶 Iraq flag +🇮🇷 Iran flag +🇮🇸 Iceland flag +🇮🇹 Italy flag +🇯🇪 Jersey flag +🇯🇲 Jamaica flag +🇯🇴 Jordan flag +🇯🇵 Japan flag +🇰🇪 Kenya flag +🇰🇬 Kyrgyzstan flag +🇰🇭 Cambodia flag +🇰🇮 Kiribati flag +🇰🇲 Comoros Island flag +🇰🇳 St. Kitts +🇰🇵 North Korea flag +🇰🇷 South Korea flag +🇰🇼 Kuwait flag +🇰🇾 Cayman Island flag +🇰🇿 Kazakhstan flag +🇱🇦 Laos flag +🇱🇧 Lebanon flag +🇱🇨 St. Lucia flag +🇱🇮 Liechtenstein flag +🇱🇰 Sri Lanka flag +🇱🇷 Liberia flag +🇱🇸 Lesotho flag +🇱🇹 LIthuania flag +🇱🇻 Latvia flag +🇱🇾 Libya flag +🇲🇦 Morocco flag +🇲🇨 Monaco flag +🇲🇩 Moldova flag +🇲🇪 Montenegro flag +🇲🇬 Montenegro flag +🇲🇭 Marshall Islands flag +🇲🇰 North Macedonia flag +🇲🇱 Mali flag +🇲🇲 Myanmar flag +🇲🇳 Mongolia flag +🇲🇴 Macao flag +🇲🇵 Northern Mariana Islands flag +🇲🇶 Marthinique flag +🇲🇷 Mauritania flag +🇲🇸 Montserrat flag +🇲🇹 Malta flag +🇲🇺 Mauritius flag +🇲🇻 Maldives flag +🇲🇼 Malawi flag +🇲🇽 Mexico flag +🇲🇾 Malaysia flag +🇲🇿 Mozambique flag +🇳🇦 Namibia flag +🇳🇨 New Caledonia flag +🇳🇪 Niger flag +🇳🇫 Norfolk Island flag +🇳🇬 Nigeria flag +🇳🇮 Nicaragua flag +🇳🇱 Netherlands flag +🇳🇴 Norway flag +🇳🇵 Nepal flag +🇳🇷 Nauru flag +🇳🇺 Niue flag +🇳🇿 New Zealand flag +🇴🇲 Oman flag +🇵🇦 Panama flag +🇵🇪 Peru flag +🇵🇫 French Polynesia flag +🇵🇬 Papua New Guinea flag +🇵🇭 Philipines flag +🇵🇰 Pakistan flag +🇵🇱 Poland flag +🇵🇲 St. Pierre +🇵🇳 Pitcairn Islands flag +🇵🇷 Puerto Rico flag +🇵🇸 Palestinian Territories flag +🇵🇹 Portugal flag +🇵🇼 Palau flag +🇵🇾 Paraguay flag +🇶🇦 Qatar flag +🇷🇪 Réunion flag +🇷🇸 Serbia flag +🇷🇺 Russia flag +🇷🇼 Rwanda flag +🇸🇦 Saudi Arabia flag +🇸🇧 Solomon Islands +🇸🇨 Seychelles flag +🇸🇩 Sudan flag +🇸🇪 Sweeden flag +🇸🇬 Singapore flag +🇸🇭 St. Helena flag +🇸🇮 Slovenia flag +🇸🇯 Svalbard +🇸🇰 Slovakia flag +🇸🇱 Sierra Leone flag +🇸🇲 San Marino flag +🇸🇳 Senegal flag +🇸🇴 Somalia flag +🇸🇷 Suriname flag +🇸🇸 South Sudan flag +🇸🇹 São Tomé +🇸🇻 El Salvador flag +🇸🇽 Saint Maarten flag +🇸🇾 Syria flag +🇸🇿 Eswatini (Swaziland) flag +🇹🇦 Tristan da Cunha flag +🇹🇨 Turks +🇹🇩 Chad flag +🇹🇫 French Southern Territories flag +🇹🇬 Togo flag +🇹🇭 Thailand flag +🇹🇯 Tajikistan flag +🇹🇰 Tokelau flag +🇹🇱 Timor-Leste flag +🇹🇲 Turkmenistan flag +🇹🇳 Tunisia flag +🇹🇴 Tonga flag +🇹🇷 Turkey flag +🇹🇹 Trinidad and Tobago flag +🇹🇻 Tuvalu flag +🇹🇼 Taiwan flag +🇹🇿 Tanzania flag +🇺🇦 Ukraine flag +🇺🇬 Uganda flag +🇺🇲 US Outlying Islands flag +🇺🇳 United Nations (UN) flag +🇺🇸 United State flag +🇺🇾 Uruguay flag +🇺🇿 Uzbekistan flag +🇻🇦 Vatical City flag +🇻🇨 St. Vincent +🇻🇪 Venezuela flag +🇻🇬 British Virgin Islands flag +🇻🇮 U.S. Virgin Islands +🇻🇮 Vietnam flag +🇻🇺 Vanuatu flag +🇼🇫 Wallis +🇼🇸 Samoa flag +🇽🇰 Kosovo flag +🇾🇪 Yemen flag +🇾🇹 Mayotte flag +🇿🇦 South Africa flag +🇿🇲 Zambia flag +🇿🇼 Zimbabwe flag" +} + +SWEDISH_FINNISH_CHARACTERS_LIST() +{ +printf "å +ä +ö" +} + +SPANISH_CHARACTERS_LIST() +{ +printf "á +é +í +ó +ú +¿ +¡ +ü +ñ" +} + +CHINESE_CHARACTERS_LIST() +{ +printf "安 ān +吧 ba +八 bā +爸 bā +百 bǎi +北 běi +不 bù - bú +大 dà - dài +岛 dǎo +的 de - dí - dì +弟 dì +地 dì - de +东 dōng +都 dōu - dū +对 duì +多 duō +儿 ér +二 èr +方 fāng +港 gǎng +哥 gē +个 gè - ge +关 guān +贵 guì +国 guó +过 guò +海 hǎi +好 hǎo - hào +很 hěn +会 huì - kuài +家 jiā +见 jiàn +叫 jiào +姐 jiě +京 jīng +九 jiǔ +可 kě +老 lǎo +李 lǐ +零 líng +六 liù +吗 ma - má - mǎ +妈 mā +么 me - yāo +没 méi - mò +美 měi +妹 mèi +们 men +名 míng +明 míng +哪 nǎ +那 nà - nèi +南 nán +你 nǐ +您 nín +朋 péng +七 qī +起 qǐ +千 qiān +去 qù +人 rén +认 rèn +日 rì +三 sān +上 shàng +谁 shéi - shuí +什 shén - shí +生 shēng +师 shī +十 shí +识 shí +是 shì +四 sì +他 tā +她 tā +台 tái +天 tiān +湾 wān +万 wàn +王 wáng +我 wǒ +五 wǔ +西 xī +息 xí +系 xì - jì +先 xiān +香 xiāng +想 xiǎng +小 xiǎo +谢 xiè +姓 xìng +休 xiū +学 xué +也 yě +一 yī +亿 yì +英 yīng +友 yǒu +月 yuè +再 zài +张 zhāng +这 zhè +中 zhōng - zhòng +字 zì" +} + +BAYBAIN_CHARACTERS_LIST() +{ +printf "ᜀ +ᜁ +ᜂ +ᜃ +ᜄ +ᜅ +ᜆ +ᜇ +ᜈ +ᜉ +ᜊ +ᜋ +ᜌ +ᜍ +ᜎ +ᜏ +ᜐ +ᜑ +ᜃᜒ +ᜄᜒ +ᜅᜒ +ᜆᜒ +ᜇᜒ +ᜈᜒ +ᜉᜒ +ᜊᜒ +ᜋᜒ +ᜌᜒ +ᜍᜒ +ᜎᜒ +ᜏᜒ +ᜐᜒ +ᜑᜒ +ᜃᜓ +ᜄᜓ +ᜅᜓ +ᜆᜓ +ᜇᜓ +ᜈᜓ +ᜉᜓ +ᜊᜓ +ᜋᜓ +ᜌᜓ +ᜍᜓ +ᜎᜓ +ᜏᜓ +ᜐᜓ +ᜑᜓ +ᜃ᜔ +ᜄ᜔ +ᜅ᜔ +ᜆ᜔ +ᜇ᜔ +ᜈ᜔ +ᜉ᜔ +ᜊ᜔ +ᜋ᜔ +ᜌ᜔ +ᜍ᜔ +ᜎ᜔ +ᜏ᜔ +ᜐ᜔ +ᜑ᜔ +᜶ᜒ +᜶ᜓ +᜶᜔ " +} + +ARABIC_CHARACTERS_LIST() +{ +printf "ء hamza +ا alef +آ alef +أ alef with hamza above +إ alef with hamza below +ى alef maksura +ب beh +ة teh marbuta +ت teh +ث theh +ج jeem +ح hah +خ khah +د dal +ذ thal +ر reh +ز zain +س seen +ش sheen +ص sad +ض dad +ط tah +ظ zah +ع ain +غ ghain +ـ tatweel +ف feh +ق qaf +ك kaf +ل lam +م meem +ن noon +ه heh +و waw +ؤ waw with hamza above +ي yeh +ئ yeh with hamza above" +} + +JAPANESE_CHARACTERS_LIST() +{ +printf "あ a +い i +う o +え e +お o +は ha +ひ hi +ふ fu +へ he +ほ ho +か kka +き ki +く ko +け ke +こ ko +ま ma +み mi +む mu +め me +も mo +さ sa +し shi +す su +せ se +そ so +や ya +ゆ yu +よ yo +た ta +ち chi +つ tsu +て te +と to +ら ra +り ri +る ru +れ re +ろ ro +な na +に ni +ぬ nu +ね ne +の no +わ wa +ゐ wi +ん n +ゑ we +を wo" +} + +ROMANIAN_CHARACTERS_LIST() +{ +printf "ă +â +î +ș +ț" +} + +JAPANESECOPY() +{ + JAPANESE_LETTER_CHOICE="$(printf "$(JAPANESE_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ' | awk '{ print $1 }')" + printf "$JAPANESE_LETTER_CHOICE" | xclip -selection clipboard + if [ "$JAPANESE_LETTER_CHOICE" != "" ]; then + notify-send "$JAPANESE_LETTER_CHOICE copied to clipboard." + fi +} + +ARABICCOPY() +{ + ARABIC_LETTER_CHOICE="$(printf "$(ARABIC_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ' | awk '{ print $1 }')" + printf "$ARABIC_LETTER_CHOICE" | xclip -selection clipboard + if [ "$ARABIC_LETTER_CHOICE" != "" ]; then + notify-send "$ARABIC_LETTER_CHOICE copied to clipboard." + fi +} + +BAYBAINCOPY() +{ + BAYBAIN_LETTER_CHOICE="$(printf "$(BAYBAIN_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ')" + printf "$BAYBAIN_LETTER_CHOICE" | xclip -selection clipboard + if [ "$BAYBAIN_LETTER_CHOICE" != "" ]; then + notify-send "$BAYBAIN_LETTER_CHOICE copied to clipboard." + fi +} + +SPANISHCOPY() +{ + SPANISH_LETTER_CHOICE="$(printf "$(SPANISH_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ')" + printf "$SPANISH_LETTER_CHOICE" | xclip -selection clipboard + if [ "$SPANISH_LETTER_CHOICE" != "" ]; then + notify-send "$SPANISH_LETTER_CHOICE copied to clipboard." + fi +} + +CHINESECOPY() +{ + CHINESE_LETTER_CHOICE="$(printf "$(CHINESE_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ')" + printf "$CHINESE_LETTER_CHOICE" | awk '{ print $1 }' | xclip -selection clipboard + if [ "$CHINESE_LETTER_CHOICE" != "" ]; then + notify-send "$(printf "$CHINESE_LETTER_CHOICE" | awk '{ print $1 }') copied to clipboard." + fi +} + +SWEDISHFINNISHCOPY() +{ + SWEDISH_LETTER_CHOICE="$(printf "$(SWEDISH_FINNISH_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ')" + printf "$SWEDISH_LETTER_CHOICE" | xclip -selection clipboard + if [ "$SWEDISH_LETTER_CHOICE" != "" ]; then + notify-send "$SWEDISH_LETTER_CHOICE copied to clipboard." + fi +} + +ROMANIANCOPY() +{ + ROMANIAN_LETTER_CHOICE="$(printf "$(ROMANIAN_CHARACTERS_LIST)" | $RUNLAUNCHER -l 5 -p 'Pick a character: ')" + printf "$ROMANIAN_LETTER_CHOICE" | xclip -selection clipboard + if [ "$ROMANIAN_LETTER_CHOICE" != "" ]; then + notify-send "$ROMANIAN_LETTER_CHOICE copied to clipboard." + fi +} + +COPYPASTALIST() +{ + printf "I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux. +No, Richard, it's 'Linux', not 'GNU/Linux'. The most important contributions that the FSF made to Linux were the creation of the GPL and the GCC compiler. Those are fine and inspired products. GCC is a monumental achievement and has earned you, RMS, and the Free Software Foundation countless kudos and much appreciation. Following are some reasons for you to mull over, including some already answered in your FAQ. One guy, Linus Torvalds, used GCC to make his operating system (yes, Linux is an OS -- more on this later). He named it 'Linux' with a little help from his friends. Why doesn't he call it GNU/Linux? Because he wrote it, with more help from his friends, not you. You named your stuff, I named my stuff -- including the software I wrote using GCC -- and Linus named his stuff. The proper name is Linux because Linus Torvalds says so. Linus has spoken. Accept his authority. To do otherwise is to become a nag. You don't want to be known as a nag, do you? (An operating system) != (a distribution). Linux is an operating system. By my definition, an operating system is that software which provides and limits access to hardware resources on a computer. That definition applies wherever you see Linux in use. However, Linux is usually distributed with a collection of utilities and applications to make it easily configurable as a desktop system, a server, a development box, or a graphics workstation, or whatever the user needs. In such a configuration, we have a Linux (based) distribution. Therein lies your strongest argument for the unwieldy title 'GNU/Linux' (when said bundled software is largely from the FSF). Go bug the distribution makers on that one. Take your beef to Red Hat, Mandrake, and Slackware. At least there you have an argument. Linux alone is an operating system that can be used in various applications without any GNU software whatsoever. Embedded applications come to mind as an obvious example. Next, even if we limit the GNU/Linux title to the GNU-based Linux distributions, we run into another obvious problem. XFree86 may well be more important to a particular Linux installation than the sum of all the GNU contributions. More properly, shouldn't the distribution be called XFree86/Linux? Or, at a minimum, XFree86/GNU/Linux? Of course, it would be rather arbitrary to draw the line there when many other fine contributions go unlisted. Yes, I know you've heard this one before. Get used to it. You'll keep hearing it until you can cleanly counter it. You seem to like the lines-of-code metric. There are many lines of GNU code in a typical Linux distribution. You seem to suggest that (more LOC) == (more important). However, I submit to you that raw LOC numbers do not directly correlate with importance. I would suggest that clock cycles spent on code is a better metric. For example, if my system spends 90% of its time executing XFree86 code, XFree86 is probably the single most important collection of code on my system. Even if I loaded ten times as many lines of useless bloatware on my system and I never excuted that bloatware, it certainly isn't more important code than XFree86. Obviously, this metric isn't perfect either, but LOC really, really sucks. Please refrain from using it ever again in supporting any argument. Last, I'd like to point out that we Linux and GNU users shouldn't be fighting among ourselves over naming other people's software. But what the heck, I'm in a bad mood now. I think I'm feeling sufficiently obnoxious to make the point that GCC is so very famous and, yes, so very useful only because Linux was developed. In a show of proper respect and gratitude, shouldn't you and everyone refer to GCC as 'the Linux compiler'? Or at least, 'Linux GCC'? Seriously, where would your masterpiece be without Linux? Languishing with the HURD? If there is a moral buried in this rant, maybe it is this: Be grateful for your abilities and your incredible success and your considerable fame. Continue to use that success and fame for good, not evil. Also, be especially grateful for Linux' huge contribution to that success. You, RMS, the Free Software Foundation, and GNU software have reached their current high profiles largely on the back of Linux. You have changed the world. Now, go forth and don't be a nag. Thanks for listening. +Stop using the term 'Open Source'. By supporting 'open source', you're not supporting software that respects the user's freedom. Instead you're supporting "fake" freedom. If that's what you actually support, please use the term 'Free software' or 'Libre software' instead. If you support 'open source' you're supporting companies Microsoft, Google, Apple and many more who don't care about your (free)dom but just the "collaborate" aspect of open source. They like open source because they get YOUR (as in people who write code for the project) work and your code and you get nothing in return. Open source is important but it's just part of freedom (specifically freedom 1 and 3). In addition to this, many people who are unaware of the free software movement/project think these big tech companies are nice people who care about their users when this is far from the truth. Open source does not guarantee the user's freedom. This is why tech companies support 'Open source' but not free software. Free software is evil to them because they want control, something free software doesn't and cannot allow. If you support 'open source' then you don't deserve anything except the evil you're responsible for. + " +} + +COPYPASTACOPY() +{ + COPYPASTASEL="$(printf "$(COPYPASTALIST)" | $RUNLAUNCHER -l 5 -p 'Pick a copypasta: ')" + printf "$COPYPASTASEL" | xclip -selection clipboard + if [ "$COPYPASTASEL" != "" ]; then + notify-send "$COPYPASTASEL copied to clipboard." + fi +} + +EMOJICOPY() +{ + EMOJISEL="$(printf "$(EMOJILIST)" | $RUNLAUNCHER -l 5 -p 'Pick an emoji: ' | awk '{ print $1 }')" + printf $EMOJISEL | xclip -selection clipboard + if [ "$EMOJISEL" != "" ]; then + notify-send "$EMOJISEL copied to clipboard." + fi +} + +DBOARD_CREDITS() +{ + printf "speedie - Wrote the script & Swedish characters\nemilyd - Helped out with some code\nLuke Smith - The idea\nLucss21a - Baybayin characters\nDamaj301Damaj - Arabic characters" +} + +DBOARD_ABOUT() +{ + printf "dboard 0.2\nModified for speedie.gq/speedwm\nReleased and licensed to you (the end user) under the GNU GPLv3 free software license.\nYou are using this software at your own risk." +} + +########################################################### + +case "$1" in +"-h") echo "speedwm-virtualkeyboard" +echo "-e | Open a list of emojis in $RUNLAUNCHER and copy the selected emoji to the clipboard." +echo "-c | Open a list of copypasta in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-se | Open a list of Swedish/Finnish letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-esp | Open a list of Spanish letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-jap | Open a list of Japanese letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-ch | Open a list of Chinese letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-bay | Open a list of Baybain letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-ar | Open a list of Arabic letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-ro | Open a list of Romanian letters in $RUNLAUNCHER and copy the selected one to the clipboard." +echo "-credits | View a list of people who made this nice little application possible." +echo "-about | View an about screen." +echo "-h | View this list of arguments." ; exit 0 ;; +"-e") ACTION=Emoji ;; +"-c") ACTION=Copypasta ;; +"-se") ACTION="Swedish/Finnish letters" ;; +"-esp") ACTION="Spanish letters" ;; +"-ch") ACTION="Chinese letters" ;; +"-jap") ACTION="Japanese letters" ;; +"-bay") ACTION="Baybain letters" ;; +"-ar") ACTION="Arabic letters" ;; +"-ro") ACTION="Romanian letters" ;; +"-credits") ACTION="Credits" ;; +"-about") ACTION="About" ;; +esac + +# Ask the user what they wanna do +if [ "$ACTION" = "" ]; then + ACTION=$(printf "Emoji\nCopypasta\nSwedish/Finnish letters\nSpanish letters\nChinese letters\nJapanese letters\nBaybain letters\nArabic letters\nRomanian letters\nCredits\nAbout\nExit" | $RUNLAUNCHER -p 'What would you like to copy?' -l 20) +fi + +if [ "$ACTION" = "Emoji" ]; then +EMOJICOPY +elif [ "$ACTION" = "Copypasta" ]; then +COPYPASTACOPY +elif [ "$ACTION" = "Swedish/Finnish letters" ]; then +SWEDISHFINNISHCOPY +elif [ "$ACTION" = "Spanish letters" ]; then +SPANISHCOPY +elif [ "$ACTION" = "Chinese letters" ]; then +CHINESECOPY +elif [ "$ACTION" = "Japanese letters" ]; then +JAPANESECOPY +elif [ "$ACTION" = "Baybain letters" ]; then +BAYBAINCOPY +elif [ "$ACTION" = "Arabic letters" ]; then +ARABICCOPY +elif [ "$ACTION" = "Romanian letters" ]; then +ROMANIANCOPY +elif [ "$ACTION" = "Credits" ]; then +CREDIT_SEL=$(printf "$(DBOARD_CREDITS)" | $RUNLAUNCHER -p 'dboard was created with the help of and by: ' -l 20 $GRIDARG $GRIDNUM) +case "$CREDIT_SEL" in +"speedie - Wrote the script & Swedish characters") $BROWSER 'https://speedie.gq' ;; +"emilyd - Helped out with some code") $BROWSER 'https://donut.gq' ;; +"Luke Smith - The idea") $BROWSER 'https://lukesmith.xyz' ;; +"Lucss21a - Baybayin characters") $BROWSER 'https://alexisgaming95.neocities.org' ;; +"Damaj301Damaj - Arabic characters") $BROWSER 'https://github.com/Damaj301damaj-lol' ;; +"Gabubu - Romanian characters") $BROWSER 'https://github.com/GabubuAvailable' ;; +esac +elif [ "$ACTION" = "Exit" ]; then +exit 0 +elif [ "$ACTION" = "About" ]; then +printf "$(DBOARD_ABOUT)" | $RUNLAUNCHER -p 'About dboard: ' -l 20 $GRIDARG $GRIDNUM +fi + +exit 0 diff --git a/src/speedwm-winnav b/src/speedwm-winnav new file mode 100755 index 0000000..8a1a480 --- /dev/null +++ b/src/speedwm-winnav @@ -0,0 +1,118 @@ +#!/bin/sh +# speedwm-winnav +# Alt+tab navigation for speedwm +# +# This script is from the suckless.org website. +# I made the following changes to it: +# - POSIX compliant +# - Tab goes down, j/k to navigate +# - Removed class from $windows making it look nicer +# - Configuration file +# - dmenu center patch support +# - Other small improvements. + +RESTORE() { + if [ -e "${BINDIR}xmodmap" ]; then + xmodmap -e "keycode 23 = Tab" + xmodmap -e "keycode 116 = Down" + + # Vim + xmodmap -e "keycode 44 = j" + xmodmap -e "keycode 45 = k" + fi +} + +HAVE_GRID="true" + +if [ -e "$HOME/.config/speedwm/globalrc" ]; then + . $HOME/.config/speedwm/globalrc +else + mkdir -p $HOME/.config/speedwm/global + printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm/globalrc +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDNUM="1" +fi + +if [ "$HAVE_GRID" = "true" ]; then + GRIDARG="-g" +fi + +case "$RUNLAUNCHER" in +"") RUNLAUNCHER=dmenu ;; +esac + +BINDIR="$(dirname $(command -v speedwm-core))/" +DOTDIR=$HOME/.config/speedwm/winnav +POSITION="bottom" # top, bottom, center (your $RUNLAUNCHER must support center for this to work) + +mkdir -p $HOME/.config/speedwm/winnav + +# Create config if it does not exist. +if [ -e "$HOME/.config/speedwm/winnav/config" ]; then + . $HOME/.config/speedwm/winnav/config +else + printf "POSITION=$POSITION # top, bottom, center (Your installed $RUNLAUNCHER must support center (-c) for this to work)" > $HOME/.config/speedwm/winnav/config +fi + +# Set position based on config +case "$POSITION" in +"bottom") POSARG="-b" ;; +"top") POSARG="" ;; +"center") POSARG="-c" ;; +esac + +# Check if wmctrl is available +if [ -e "${BINDIR}wmctrl" ]; then + echo "wmctrl found" + + case "$(wmctrl -xl | wc -l)" in + "") echo "No clients found." ; exit 1 ;; + "1") echo "One client running, will not open menu." ; exit 0 ;; + esac +else + echo "wmctrl not found, exiting." && exit 1 +fi + +SET() { + if [ -e "${BINDIR}xmodmap" ]; then + xmodmap -e "keycode 23 = Down" + xmodmap -e "keycode 116 = Tab" + + # Vim + xmodmap -e "keycode 44 = Down" + xmodmap -e "keycode 45 = Up" + fi +} + +SET + +windows=$(wmctrl -xl | tr -s '[:blank:]' | cut -d ' ' -f 3-3,5- | sed 's/^[a-zA-Z0-9-]*\.//' | sort | uniq) +echo "Windows are:\n $windows\n============================" +windows_class=$(echo $windows | awk '{ print $1 }') +echo "Class is:\n $windows_class\n============================" + +# Add spaces to align the WM_NAMEs of the windows +max=$(echo "$windows" | awk '{cur=length($1); max=(cur>max?cur:max)} END{print max}') +echo "Max is:\n$max" + +windows=$(echo "$windows" | \ + awk -v max="$max" \ + '{cur=length($1); printf $1; \ + for(i=0; i < max - cur + 1; i++) printf " "; \ + $1 = ""; printf "%s\n", $0}') + + +target=$(printf "\n$windows" | cut -f 2- -d ' ' | sed 's/^ *//g' | $RUNLAUNCHER $POSARG -l 10 $GRIDARG $GRIDNUM -p "Which window?" | tr -s '[:blank:]' | sed "s/$class | //g") + +case "$target" in +"") RESTORE && exit 0 ;; +esac + +wmctrl -a "$target" && echo "Switched focus" + +# show hidden window +speedwm -s "#cmd:28" + +RESTORE