update info-xampp, fix #19

This commit is contained in:
x70b1 2018-01-31 16:10:42 +01:00
parent 843a7fab56
commit 1bc3e6807f
8 changed files with 19 additions and 60 deletions

View File

@ -38,6 +38,7 @@ Is this your first time here? You should definitely take a look at these scripts
[![system-usb-udev](polybar-scripts/system-usb-udev/screenshots/2.png)](polybar-scripts/system-usb-udev/)
[![openweathermap-simple](polybar-scripts/openweathermap-simple/screenshots/1.png)](polybar-scripts/openweathermap-simple/)
[![openweathermap-detailed](polybar-scripts/openweathermap-detailed/screenshots/1.png)](polybar-scripts/openweathermap-detailed/)
[![info-xampp](polybar-scripts/info-xampp/screenshots/1.png)](polybar-scripts/info-xampp/)
[![player-mpris-tail](polybar-scripts/player-mpris-tail/screenshots/1.png)](polybar-scripts/player-mpris-tail/)
[![info-redshift-temp](polybar-scripts/info-redshift-temp/screenshots/1.png)](polybar-scripts/info-redshift-temp/)
[![hint-trash](polybar-scripts/hint-trash/screenshots/1.png)](polybar-scripts/hint-trash/)

View File

@ -1,25 +0,0 @@
# Script: XAMPP status ![Github](screenshots/1.png)
The Script prints the status of XAMPP services (Apache, MySQL, ProFTPD) if they are running. Otherwise, the script prints nothing.
![screenshots](screenshots/xampp-status.png)
## Dependencies
[XAMPP](https://www.apachefriends.org/de/index.html)
## Module
```
[module/xampp]
type = custom/script
interval = 10
label = %output%
exec = ~/./.skript/xampp-status.sh
```
## Troubleshooting
To show the MySQL Server status, the script must own a file in /opt/lampp/var/MySQL. <br>
To solve this I edited the xampp script in /opt/lampp/ in the startMySQL() function, ![MySQL Troubleshooting](screenshots/xampp-mysql.png) <br>
The sleep is imported because the file need some time to create.
The file is owned by the mysql user. May you can fix that problem on Otherwise. This is only one solution.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,18 +0,0 @@
#!/bin/sh
a=$(/./opt/lampp/xampp status | grep Apa | cut -d " " -f3)
m=$(/./opt/lampp/xampp status | grep My | cut -d " " -f3)
f=$(/./opt/lampp/xampp status | grep Pro | cut -d " " -f3)
ret="";
if [ "$a" != "not" ]; then
ret="A: %{F#0fe108}X%{F-}"
fi
if [ "$m" != "not" ]; then
ret="$ret M: %{F#0fe108}X%{F-}"
fi
if [ "$f" != "deactivated." ]; then
ret="$ret F: %{F#0fe108}X%{F-}"
fi
echo "$ret"

View File

@ -5,6 +5,15 @@ The Script prints the status of [XAMPP](https://www.apachefriends.org/de/index.h
![info-xampp](screenshots/1.png)
## Dependencies
Create a sudo rule to allow you user to read the status information.
```ini
username ALL = NOPASSWD: /opt/lampp/xampp
```
## Module
```ini
@ -13,11 +22,3 @@ type = custom/script
exec = ~/polybar-scripts/info-xampp.sh
interval = 10
```
## Troubleshooting
To show the MySQL Server status, the script must own a file in /opt/lampp/var/MySQL. To solve this I edited the xampp script in /opt/lampp/ in the startMySQL() function.
![MySQL Troubleshooting](screenshots/xampp-mysql.png)
The sleep is imported because the file need some time to create. The file is owned by the mysql user. May you can fix that problem on Otherwise. This is only one solution.

View File

@ -1,21 +1,21 @@
#!/bin/sh
if /./opt/lampp/xampp status | grep -q "Apache is running."; then
status_apache="#11"
if sudo /opt/lampp/xampp status | grep -q "Apache is running."; then
status_apache="#11"
else
status_apache="#12"
status_apache="#12"
fi
if /./opt/lampp/xampp status |grep -q "MySQL is running."; then
status_mysql="#21"
if sudo /opt/lampp/xampp status |grep -q "MySQL is running."; then
status_mysql="#21"
else
status_mysql="#22"
status_mysql="#22"
fi
if /./opt/lampp/xampp status | grep -q "ProFTPD is running."; then
status_ftp="#31"
if sudo /opt/lampp/xampp status | grep -q "ProFTPD is running."; then
status_ftp="#31"
else
status_ftp="#32"
status_ftp="#32"
fi
echo "$status_apache $status_mysql $status_ftp"