conkyctl upd
This commit is contained in:
38
bin/conkyctl
38
bin/conkyctl
@@ -1220,16 +1220,14 @@ jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|||||||
|
|
||||||
cmdmenu () {
|
cmdmenu () {
|
||||||
source "$HOME/.config/mabox/mabox.conf"
|
source "$HOME/.config/mabox/mabox.conf"
|
||||||
if [[ "$conky_leftclick" == "off" ]];then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${CONKYDIR}"/menuscripts
|
#mkdir -p "${CONKYDIR}"/menuscripts
|
||||||
# get conky config path from clicked "conky window"
|
# get conky config path from clicked "conky window"
|
||||||
eval $(xdotool getmouselocation --shell)
|
eval $(xdotool getmouselocation --shell)
|
||||||
eval $(xdotool getwindowgeometry --shell ${WINDOW})
|
eval $(xdotool getwindowgeometry --shell ${WINDOW})
|
||||||
hexid=$(wmctrl -lpG | grep ${X} |grep ${Y}|grep ${WIDTH}|grep ${HEIGHT} |cut -d' ' -f1)
|
hexid=$(wmctrl -lpG | grep ${X} |grep ${Y}|grep ${WIDTH}|grep ${HEIGHT} |cut -d' ' -f1)
|
||||||
CONKYCFG=$(xprop -id ${hexid}|grep WM_COMMAND|cut -d'"' -f6)
|
CONKYCFG=$(xprop -id ${hexid}|grep WM_COMMAND|cut -d'"' -f6)
|
||||||
|
#notify-send.sh "${X} ${Y}" "${WIDTH} ${HEIGHT}"
|
||||||
|
|
||||||
# Fix for nonsense Conky context menu when Left Click on Root is not binded to ToogleShowDesktop
|
# Fix for nonsense Conky context menu when Left Click on Root is not binded to ToogleShowDesktop
|
||||||
if [ ! -f "$CONKYCFG" ]; then
|
if [ ! -f "$CONKYCFG" ]; then
|
||||||
@@ -1245,14 +1243,26 @@ cmdmenu () {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#notify-send.sh "${X} ${Y}" "${WIDTH} ${HEIGHT}"
|
# if command exists in system run it and exit
|
||||||
# if script exist run it and exit
|
if hash "${name}" 2>/dev/null ;then
|
||||||
if [ "$1" != "" ];then
|
${name} ${1}
|
||||||
if [ -x "${CONKYDIR}/menuscripts/${name}" ];then
|
|
||||||
bash -c "${CONKYDIR}/menuscripts/${name} ${1}"
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if conky leftclick is disabled ... exit
|
||||||
|
if [[ "$conky_leftclick" == "off" ]];then
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# if script exist in menuscripts run it and exit
|
||||||
|
if [ "$1" != "" ];then
|
||||||
|
if [ -x "${CONKYDIR}/menuscripts/${name}" ];then
|
||||||
|
bash -c "${CONKYDIR}/menuscripts/${name} ${1}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# if CSV for menu exist show it
|
# if CSV for menu exist show it
|
||||||
if [ -f ${CONKYDIR}/menuscripts/${name}.csv ]; then
|
if [ -f ${CONKYDIR}/menuscripts/${name}.csv ]; then
|
||||||
LINES=$(grep -Ev "^#|^$" ${CONKYDIR}/menuscripts/${name}.csv|wc -l)
|
LINES=$(grep -Ev "^#|^$" ${CONKYDIR}/menuscripts/${name}.csv|wc -l)
|
||||||
@@ -1623,8 +1633,12 @@ sd "template0 =.*$" "template0 = [[${1}]]," "$HOME/.config/conky/Better_Clock_mb
|
|||||||
bc_dformat() {
|
bc_dformat() {
|
||||||
sd "template1 =.*$" "template1 = [[${1}]]," "$HOME/.config/conky/Better_Clock_mbcolor.conkyrc"
|
sd "template1 =.*$" "template1 = [[${1}]]," "$HOME/.config/conky/Better_Clock_mbcolor.conkyrc"
|
||||||
}
|
}
|
||||||
|
lclick() {
|
||||||
|
mb-setvar conky_leftclick="${1}"
|
||||||
|
}
|
||||||
|
rclick() {
|
||||||
|
mb-setvar conky_rightclick="${1}"
|
||||||
|
}
|
||||||
case "$1" in
|
case "$1" in
|
||||||
transparent_all) transparent_all "$2";;
|
transparent_all) transparent_all "$2";;
|
||||||
transparent) transparent "$2" "$3";;
|
transparent) transparent "$2" "$3";;
|
||||||
@@ -1694,5 +1708,7 @@ case "$1" in
|
|||||||
bc_fdate)bc_fdate "$2";;
|
bc_fdate)bc_fdate "$2";;
|
||||||
bc_tformat)bc_tformat "$2";;
|
bc_tformat)bc_tformat "$2";;
|
||||||
bc_dformat)bc_dformat "$2";;
|
bc_dformat)bc_dformat "$2";;
|
||||||
|
lclick)lclick "$2";;
|
||||||
|
rclick)rclick "$2";;
|
||||||
*) : ;;
|
*) : ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user