Add Dual VFO to Conky

This refers to km4ack/pi-build#61
pull/117/head
Chris Bosse 2020-04-28 15:08:36 -04:00 zatwierdzone przez Patrick Naubert
rodzic 3d723cf7e2
commit 3f14b2cce0
6 zmienionych plików z 61 dodań i 5 usunięć

Wyświetl plik

@ -34,6 +34,10 @@ ${font Arial:size=30}${color Yellow}${alignc}N0CALL
${voffset -45}
${font Arial:bold:size=18}${color White}Gridsquare ${alignr}${color Yellow}${execi 25 $HOME/bin/conky/grid | cut -c1-8}
#${font Arial:bold:size=18}${color White}Radio Freq ${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq | cut -c1-6}
#${font Arial:bold:size=18}${color White}Radio Freq A ${if_match "VFOA" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOA | cut -c1-7}
#${font Arial:bold:size=18}${color White}Radio Freq B ${if_match "VFOB" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOB | cut -c1-7}
${color Yellow}LOCAL${alignr}ZULU
${voffset -45}

Wyświetl plik

@ -34,6 +34,10 @@ ${font Arial:size=30}${color Yellow}${alignc}N0CALL
${voffset -45}
${font Arial:bold:size=18}${color White}Gridsquare ${alignr}${color Yellow}${execi 25 $HOME/bin/conky/grid | cut -c1-8}
#${font Arial:bold:size=18}${color White}Radio Freq ${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq | cut -c1-6}
#${font Arial:bold:size=18}${color White}Radio Freq A ${if_match "VFOA" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOA | cut -c1-7}
#${font Arial:bold:size=18}${color White}Radio Freq B ${if_match "VFOB" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOB | cut -c1-7}
${color Yellow}LOCAL${alignr}ZULU
${voffset -45}

Wyświetl plik

@ -33,6 +33,10 @@ ${font Arial:size=18}${color Yellow}${alignc}N0CALL
${voffset -25}
${font Arial:bold:size=12}${color White}Gridsquare ${alignr}${color Yellow}${execi 25 $HOME/bin/conky/grid | cut -c1-8}
#${font Arial:bold:size=12}${color White}Radio Freq ${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq | cut -c1-6}
#${font Arial:bold:size=12}${color White}Radio Freq A ${if_match "VFOA" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOA | cut -c1-7}
#${font Arial:bold:size=12}${color White}Radio Freq B ${if_match "VFOB" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOB | cut -c1-7}
${color Yellow}LOCAL${alignr}ZULU
${color DarkSlateGray}${hr 2}
${font Arial:bold:size=15}${color White}${time %H:%M:%S}\

Wyświetl plik

@ -33,6 +33,10 @@ ${font Arial:size=12}${color Yellow}${alignc}N0CALL
${voffset -20}
${font Arial:bold:size=08}${color White}Gridsquare ${alignr}${color Yellow}${execi 25 $HOME/bin/conky/grid | cut -c1-8}
#${font Arial:bold:size=12}${color White}Radio Freq ${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq | cut -c1-6}
#${font Arial:bold:size=12}${color White}Radio Freq A ${if_match "VFOA" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOA | cut -c1-7}
#${font Arial:bold:size=12}${color White}Radio Freq B ${if_match "VFOB" == "${execi 5 $HOME/bin/conky/get-vfo}"}*$endif\
#${alignr}${color Yellow}${execi 5 $HOME/bin/conky/get-freq VFOB | cut -c1-7}
${color Yellow}LOCAL${alignr}ZULU
${voffset -20}
${color DarkSlateGray}${hr 2}

Wyświetl plik

@ -1,22 +1,40 @@
#!/bin/bash
#get freq of radio to display in conky
#optional parameter: VFOA VFOB
#20191217 km4ack
#20200428 modified
source $HOME/patmenu2/config
MAIN () {
FREQ=$($RIG f)
FREQCH=$(echo $FREQ | grep error)
# If first argument, $1, is empty or unset, use 'VFOA' as its value.
VFO=${1:-'VFOA'}
FREQ=$($RIG -o f "$VFO")
FREQCH=$(echo "$FREQ" | grep error)
if [ -z "$FREQCH" ]
then
echo $FREQ
HZ_TO_MHZ "$FREQ"
else
MAIN
MAIN "$1"
fi
}
MAIN
HZ_TO_MHZ () {
#Inject decimal into number six places from right.
#First, and only, parameter expected to be a string of six or more digits
DP=.
SIX_DIGITS='[0-9][0-9][0-9][0-9][0-9][0-9]'
MHZ="${1%%$SIX_DIGITS}"
HZ="${1##$MHZ}"
printf "%s$DP%s\n" "$MHZ" "$HZ"
}
MAIN "$1"

22
conky/get-vfo 100755
Wyświetl plik

@ -0,0 +1,22 @@
#!/bin/bash
#get VFO of radio to display in conky
#20200428
source "$HOME/patmenu/config"
MAIN () {
VFO=$($RIG v)
VFOCH=$(echo "$VFO" | grep error)
if [ -z "$VFOCH" ]
then
echo "$VFO"
else
MAIN
fi
}
MAIN