Add click events to server blocks

Jonathan Hodgson 7 years ago
parent 966a93ff2b
commit 76cab3cef5
  1. 21
      i3/blocks/apache
  2. 21
      i3/blocks/mysql
  3. 21
      i3/blocks/proftp
  4. 14
      i3/i3blocks.conf

@ -5,6 +5,27 @@ STATUS=$($LAMPP status 2> /dev/null)
APACHE=$(echo "$STATUS" | grep -i apache | grep -io not > /dev/null && echo "down" || echo "up") APACHE=$(echo "$STATUS" | grep -i apache | grep -io not > /dev/null && echo "down" || echo "up")
function toggleApache(){
if [ $APACHE = "up" ]; then
gksudo $LAMPP stopapache
else
gksudo $LAMPP startapache
fi
}
function toggleAll(){
if [ $APACHE = "up" ]; then
gksudo $LAMPP stop
else
gksudo $LAMPP start
fi
}
case $BLOCK_BUTTON in
1) toggleApache ;;
3) toggleAll ;;
esac
if [ "$APACHE" = "up" ]; then if [ "$APACHE" = "up" ]; then
COLOUR="#00FF00" COLOUR="#00FF00"
else else

@ -5,6 +5,27 @@ STATUS=$($LAMPP status 2> /dev/null)
MYSQL=$(echo "$STATUS" | grep -i mysql | grep -io not > /dev/null && echo "down" || echo "up") MYSQL=$(echo "$STATUS" | grep -i mysql | grep -io not > /dev/null && echo "down" || echo "up")
function toggleMysql(){
if [ $MYSQL = "up" ]; then
gksudo $LAMPP stopmysql
else
gksudo $LAMPP startmysql
fi
}
function toggleAll(){
if [ $MYSQL = "up" ]; then
gksudo $LAMPP stop
else
gksudo $LAMPP start
fi
}
case $BLOCK_BUTTON in
1) toggleMysql ;;
3) toggleAll ;;
esac
if [ "$MYSQL" = "up" ]; then if [ "$MYSQL" = "up" ]; then
COLOUR="#00FF00" COLOUR="#00FF00"
else else

@ -5,6 +5,27 @@ STATUS=$($LAMPP status 2> /dev/null)
PROFTP=$(echo "$STATUS" | grep -i proftp | grep -io not > /dev/null && echo "down" || echo "up") PROFTP=$(echo "$STATUS" | grep -i proftp | grep -io not > /dev/null && echo "down" || echo "up")
function toggleProftp(){
if [ $PROFTP = "up" ]; then
gksudo $LAMPP stopftp
else
gksudo $LAMPP startftp
fi
}
function toggleAll(){
if [ $PROFTP = "up" ]; then
gksudo $LAMPP stop
else
gksudo $LAMPP start
fi
}
case $BLOCK_BUTTON in
1) toggleProftp ;;
3) toggleAll ;;
esac
if [ "$PROFTP" = "up" ]; then if [ "$PROFTP" = "up" ]; then
COLOUR="#00FF00" COLOUR="#00FF00"
else else

@ -39,9 +39,19 @@ instance=CAPS
interval=once interval=once
signal=11 signal=11
[serverstatus] [apachestatus]
command=~/.dotfiles/i3/blocks/server command=~/.dotfiles/i3/blocks/apache
interval=5 interval=5
separator=false
[mysqlstatus]
command=~/.dotfiles/i3/blocks/mysql
interval=5
#separator=false
#[proftpstatus]
#command=~/.dotfiles/i3/blocks/proftp
#interval=5
# Volume indicator # Volume indicator
# #

Loading…
Cancel
Save