power menu, redshift, polybar
This commit is contained in:
20
.config/polybar/scripts/info-ssh-sessions/README.md
Normal file
20
.config/polybar/scripts/info-ssh-sessions/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Script: info-ssh-sessions
|
||||
|
||||
A script that displays the count of current ssh sessions as well as the public IP address of the fist session.
|
||||
|
||||

|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `lsof`
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/info-ssh-sessions]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/info-ssh-sessions.sh
|
||||
interval = 5
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
sessions="$(lsof -Pi | grep ":22")"
|
||||
|
||||
if [ -n "$sessions" ]; then
|
||||
count=$(echo "$sessions" | wc -l)
|
||||
echo "# ($count): $(echo "$sessions" | cut -d ">" -f 2 | cut -d " " -f 1 | cut -d ":" -f 1 | tail -n 1)"
|
||||
else
|
||||
echo "# (0)"
|
||||
fi
|
||||
BIN
.config/polybar/scripts/info-ssh-sessions/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/info-ssh-sessions/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user