Add some scripts
This commit is contained in:
28
scripts/tmux/fcitx
Executable file
28
scripts/tmux/fcitx
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
printState() {
|
||||
# REQUIRES QT5-TOOLS
|
||||
STATUS=$(qdbus "org.fcitx.Fcitx" "/inputmethod" "GetCurrentIM")
|
||||
|
||||
case $STATUS in
|
||||
fcitx-keyboard-us)
|
||||
echo 'US'
|
||||
;;
|
||||
fcitx-keyboard-no)
|
||||
echo 'NO'
|
||||
;;
|
||||
mozc)
|
||||
echo '日本語'
|
||||
;;
|
||||
*)
|
||||
echo "$STATUS?"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
while :
|
||||
do
|
||||
printState
|
||||
sleep 1
|
||||
done
|
||||
18
scripts/tmux/mpd
Executable file
18
scripts/tmux/mpd
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
isPlaying() {
|
||||
if mpc status | grep playing >/dev/null
|
||||
then
|
||||
echo -e "▶"
|
||||
else
|
||||
echo -e "⏸"
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
PLAYING=$(isPlaying)
|
||||
TITLE=$(mpc --format '[%artist% - ]%title%' | /usr/bin/head -n 1)
|
||||
TIME=$(mpc | awk '(NR==2){print $3}')
|
||||
echo -e "$PLAYING $TITLE | [$TIME]"
|
||||
sleep 1
|
||||
done
|
||||
Reference in New Issue
Block a user