conky upd
This commit is contained in:
parent
dcee065c37
commit
4ded5ac5a2
@ -117,7 +117,7 @@ case "$LANG" in
|
|||||||
RUNNING_CONKIES="Uruchomione Conky"
|
RUNNING_CONKIES="Uruchomione Conky"
|
||||||
STOP_ALL="Zatrzymaj wszystkie"
|
STOP_ALL="Zatrzymaj wszystkie"
|
||||||
MORECONKIES="Więcej Conky..."
|
MORECONKIES="Więcej Conky..."
|
||||||
CLICKTOSTART="Kliknij aby uruchomić"
|
CLICKTOSTART="<b>Uruchom</b> więcej Conky..."
|
||||||
STARTALL="Uruchom wszystkie"
|
STARTALL="Uruchom wszystkie"
|
||||||
RESET="Resetuj"
|
RESET="Resetuj"
|
||||||
RESETALL="Resetuj wszystkie"
|
RESETALL="Resetuj wszystkie"
|
||||||
@ -175,7 +175,7 @@ case "$LANG" in
|
|||||||
RUNNING_CONKIES="Running Conkys"
|
RUNNING_CONKIES="Running Conkys"
|
||||||
STOP_ALL="Stop All"
|
STOP_ALL="Stop All"
|
||||||
MORECONKIES="More Conkies Available"
|
MORECONKIES="More Conkies Available"
|
||||||
CLICKTOSTART="...click to start"
|
CLICKTOSTART="<b>Start</b> more Conkies..."
|
||||||
STARTALL="Start all"
|
STARTALL="Start all"
|
||||||
RESET="Reset"
|
RESET="Reset"
|
||||||
RESETALL="Reset all to defaults"
|
RESETALL="Reset all to defaults"
|
||||||
@ -290,6 +290,8 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then
|
|||||||
else # too many conkies not started -> show them in submenu
|
else # too many conkies not started -> show them in submenu
|
||||||
out+=("$CLICKTOSTART (${#notstarted[@]}),^checkout(nstarted)")
|
out+=("$CLICKTOSTART (${#notstarted[@]}),^checkout(nstarted)")
|
||||||
out2+=("^tag(nstarted)")
|
out2+=("^tag(nstarted)")
|
||||||
|
out2+=("^sep($CLICKTOSTART)")
|
||||||
|
|
||||||
for c in ${notstarted[@]};do
|
for c in ${notstarted[@]};do
|
||||||
filename=${c##*/}
|
filename=${c##*/}
|
||||||
name=${filename%%_mb*}
|
name=${filename%%_mb*}
|
||||||
|
43
bin/quote.sh
43
bin/quote.sh
@ -1,23 +1,52 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DIR="$HOME/.config/quoter"
|
DIR="$HOME/.config/quoter"
|
||||||
mkdir -p "$DIR"
|
mkdir -p "$DIR"
|
||||||
CNF_FILE="$DIR/quoter.cfg"
|
CNF_FILE="$DIR/quoter.conf"
|
||||||
|
|
||||||
|
notify(){
|
||||||
|
source <(grep = $CNF_FILE)
|
||||||
|
quotes=${quotes_file:-"/usr/share/mabox/quotes.txt"}
|
||||||
|
Q=$(shuf -n 1 "${quotes}")
|
||||||
|
QUOTE=${Q%|*}
|
||||||
|
AUTOR=${Q#*|}
|
||||||
|
notify-send.sh -t 15000 --icon=$HOME/.config/mabox/wpicon.png "${AUTOR}\n" "${QUOTE}" --action="Next:quote.sh -n"
|
||||||
|
}
|
||||||
|
|
||||||
|
conky() {
|
||||||
|
|
||||||
if [ ! -f $CNF_FILE ]; then
|
if [ ! -f $CNF_FILE ]; then
|
||||||
cat <<EOF > ${CNF_FILE}
|
cat <<EOF > ${CNF_FILE}
|
||||||
quote_fontsize=12
|
quote_fontsize=12
|
||||||
author_fontsize=10
|
author_fontsize=10
|
||||||
|
font_name="Ubuntu"
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
source <(grep = $CNF_FILE)
|
source <(grep = $CNF_FILE)
|
||||||
qfsize=${quote_fontsize:-12}
|
qfsize=${quote_fontsize:-12}
|
||||||
afsize=${author_fontsize:-10}
|
afsize=${author_fontsize:-10}
|
||||||
|
fontname=${font_name:-"Source Code Pro"}
|
||||||
|
quotes=${quotes_file:-"/usr/share/mabox/quotes.txt"}
|
||||||
|
|
||||||
export Q=$(curl -s "http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en" | sed 's|\\||g' )
|
|
||||||
QUOTE=$(echo $Q | jq .quoteText)
|
|
||||||
AUTOR=$(echo $Q | jq .quoteAuthor | tr -d '"')
|
|
||||||
echo "${QUOTE}|${AUTOR}" >> "${DIR}"/forismatic.txt
|
|
||||||
|
|
||||||
printf "\${font Droid Sans:size=$qfsize}\${color}"
|
Q=$(shuf -n 1 "${quotes}")
|
||||||
|
|
||||||
|
|
||||||
|
QUOTE=${Q%|*}
|
||||||
|
AUTOR=${Q#*|}
|
||||||
|
#QUOTE=$(crow -b $(echo $Q | jq .quoteText))
|
||||||
|
#AUTOR=$(echo $Q | jq .quoteAuthor | tr -d '"')
|
||||||
|
#echo "${QUOTE}|${AUTOR}" >> "${DIR}"/forismatic.txt
|
||||||
|
|
||||||
|
#QUOTE="Kto to jest Hiszpania? i dlaczego był Hitler?"
|
||||||
|
#AUTOR="Nieznany Zenon"
|
||||||
|
|
||||||
|
printf "\${font ${fontname}:size=$qfsize}\${color}"
|
||||||
echo ${QUOTE} | fmt -80
|
echo ${QUOTE} | fmt -80
|
||||||
printf "\${font Droid Sans:size=$afsize}\${alignr}\${color0}"
|
printf "\${font ${fontname}:size=$afsize}\${alignr}\${color0}"
|
||||||
echo "${AUTOR}"
|
echo "${AUTOR}"
|
||||||
|
}
|
||||||
|
case "$1" in
|
||||||
|
-n) notify;;
|
||||||
|
*) conky;;
|
||||||
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user