#!/bin/bash # upperLower # THIS DOESN'T BEHAVE AS EXPECTED, BUT KEEPING IT IN GIT FOR NOW. # will upper, lower or capital 1st letter of X selection and return the result # not usable from cli string="$(echo "$(xsel)")" # https://github.com/jordansissel/xdotool/issues/49 = setxkbmap behaviour setxkbmap # openbox example and disable running from cli if [[ "$1" == "--openbox" ]] || [[ -t 0 ]] ; then cat < upperLower -l upperLower -u upperLower -p EOF exit fi # main if [[ "$1" == "-l" ]]; then # lower clip="${string,,}"; xdotool type --clearmodifiers -- "$clip" elif [[ "$1" == "-u" ]]; then # upper clip="${string^^}"; xdotool type --clearmodifiers -- "$clip" elif [[ "$1" == "-p" ]]; then # capital 1st clip="${string,,}"; IFS=" "; read -r -a array <<< "$clip"; cliparr=( "${array[@]^*}" ); xdotool type --clearmodifiers -- "${cliparr[*]}" fi