Skip to content

Commit

Permalink
Merge pull request #15 from xtonousou/dev
Browse files Browse the repository at this point in the history
Merged dev into main
  • Loading branch information
xtonousou authored Sep 9, 2022
2 parents ac45d7c + 4ddf2c0 commit 0b13a70
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 81 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
.stats_*
.code-*
*.code-workspace

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

93 changes: 49 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

| Filename | Preview | Tooltip Preview | On Click Action |
|:--------------------------------:|:------------:|:------------------:|:-----------------------------:|
| [smart-watch-battery-panel.sh] | ![swbattery] | | |
| [smart-watch-battery-panel.sh] | ![swbattery] | | |
| [battery-panel.sh] | ![battery] | [battery-tooltip] | [battery-gui] |
| [cleaner-panel.sh] | ![cleaner] | | [cleaner-gui] [cleaner-gui-2] |
| [cpu-panel.sh] | ![cpu] | [cpu-tooltip] | [cpu-gui] |
| [datetime-panel.sh] | ![datetime] | [datetime-tooltip] | |
| [die-panel.sh] | ![die] | | |
| [disk-panel.sh] | ![disk] | [disk-tooltip] | |
| [eject-panel.sh] | ![eject] | | [eject-gui] |
| [kernel-panel.sh] | ![kernel] | [kernel-tooltip] | |
| [memory-panel.sh] | ![memory] | [memory-tooltip] | [memory-gui] |
Expand All @@ -34,6 +35,7 @@ To get started, you need a horizontal xfce4-panel with **28p** row size and **10
| /path/to/cpu-panel.sh | **xos4 Terminus Bold 18** | **1.50** |
| /path/to/datetime-panel.sh | **xos4 Terminus Bold 18** | **1.00** |
| /path/to/die-panel.sh | **xos4 Terminus Bold 18** | **2.75** |
| /path/to/disk-panel.sh | **xos4 Terminus Bold 18** | **5.00** |
| /path/to/eject-panel.sh | **xos4 Terminus Bold 18** | **3600** |
| /path/to/kernel-panel.sh | **xos4 Terminus Bold 18** | **3600** |
| /path/to/memory-panel.sh | **xos4 Terminus Bold 18** | **1.00** |
Expand All @@ -46,20 +48,6 @@ To get started, you need a horizontal xfce4-panel with **28p** row size and **10

You just need `xfce4-panel` and `xfce4-genmon-plugin`. Additional requirements are mentioned inside the scripts.

#### Workarounds

##### Smart Watch Battery Panel

In order to use `smart-watch-battery-panel.sh` you need to use a crontab or a systemd timer to generate the required information.

```bash
crontab -e
* * * * * /usr/bin/env bash /path/to/xfce4-genmon-scripts/adb-info.sh $(arp -e -n | awk "/98:28:a6:dd:00:8c/{print \$1}") battery ticwatch
```

1. Replace the MAC address with the correct one. Hint: Use `arp -n -a` to get the MAC address.
2. Replace the 3rd argument **ticwatch**, with a unique name that describes your device.

#### Installation

Clone the project `git clone --depth 1 https://github.com/xtonousou/xfce4-genmon-scripts.git`.
Expand All @@ -77,6 +65,20 @@ These icons are provided **as-is** without any change.

Please refer [here](https://github.com/Templarian/MaterialDesign/blob/master/LICENSE) for the respective license.

#### Workarounds

##### Smart Watch Battery Panel

In order to use `smart-watch-battery-panel.sh` you need to use a crontab or a systemd timer to generate the required information.

```bash
crontab -e
* * * * * /usr/bin/env bash /path/to/xfce4-genmon-scripts/adb-info.sh $(arp -e -n | awk "/98:28:a6:dd:00:8c/{print \$1}") battery ticwatch
```

1. Replace the MAC address with the correct one. Hint: Use `arp -n -a` to get the MAC address.
2. Replace the 3rd argument **ticwatch**, with a unique name that describes your device.

#### License

This project is licensed under GPL(v3) or later.
Expand All @@ -88,6 +90,7 @@ This project is licensed under GPL(v3) or later.
[cpu-panel.sh]: cpu-panel.sh
[datetime-panel.sh]: datetime-panel.sh
[die-panel.sh]: die-panel.sh
[disk-panel.sh]: disk-panel.sh
[eject-panel.sh]: eject-panel.sh
[kernel-panel.sh]: kernel-panel.sh
[memory-panel.sh]: memory-panel.sh
Expand All @@ -97,32 +100,34 @@ This project is licensed under GPL(v3) or later.
[spotify-panel.sh]: spotify-panel.sh

<!--- Pics -->
[preview-panel]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/preview-panel.png "xfce4-panel"
[swbattery]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/smart-watch-battery-panel/swbattery.png "smart watch battery"
[battery]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/battery-panel/battery.gif "battery"
[battery-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/battery-panel/battery-tooltip.gif "battery-tooltip"
[battery-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/battery-panel/battery-gui.png "battery-gui"
[cleaner]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cleaner-panel/cleaner.png "cleaner"
[cleaner-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cleaner-panel/cleaner-gui.png "cleaner-gui"
[cleaner-gui-2]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cleaner-panel/cleaner-gui-2.png "cleaner-gui-2"
[cpu]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cpu-panel/cpu.gif "cpu"
[cpu-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cpu-panel/cpu-tooltip.gif "cpu-tooltip"
[cpu-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/cpu-panel/cpu-gui.png "cpu-gui"
[datetime]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/datetime-panel/datetime.gif "datetime"
[datetime-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/datetime-panel/datetime-tooltip.png "datetime-tooltip"
[die]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/die-panel/die.gif "die"
[eject]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/eject-panel/eject.png "eject"
[eject-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/eject-panel/eject-gui.png "eject-gui"
[kernel]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/kernel-panel/kernel.png "kernel"
[kernel-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/kernel-panel/kernel-tooltip.png "kernel-tooltip"
[memory]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/memory-panel/memory.gif "memory"
[memory-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/memory-panel/memory-tooltip.gif "memory-tooltip"
[memory-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/memory-panel/memory-gui.png "memory-gui"
[network]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/network-panel/network.gif "network"
[network-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/network-panel/network-tooltip.png "network-tooltip"
[pacman]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/pacman-panel/pacman.png "pacman"
[pacman-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/pacman-panel/pacman-tooltip.png "pacman-tooltip"
[power]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/power-panel/power.png "power"
[power-gui]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/power-panel/power-gui.png "power-gui"
[spotify]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/spotify-panel/spotify.gif "spotify"
[spotify-tooltip]: https://raw.githubusercontent.com/xtonousou/xfce4-genmon-scripts/master/previews/spotify-panel/spotify-tooltip.png "spotify-tooltip"
[preview-panel]: previews/preview-panel.png "xfce4-panel"
[swbattery]: previews/smart-watch-battery-panel/swbattery.png "smart watch battery"
[battery]: previews/battery-panel/battery.gif "battery"
[battery-tooltip]: previews/battery-panel/battery-tooltip.gif "battery-tooltip"
[battery-gui]: previews/battery-panel/battery-gui.png "battery-gui"
[cleaner]: previews/cleaner-panel/cleaner.png "cleaner"
[cleaner-gui]: previews/cleaner-panel/cleaner-gui.png "cleaner-gui"
[cleaner-gui-2]: previews/cleaner-panel/cleaner-gui-2.png "cleaner-gui-2"
[cpu]: previews/cpu-panel/cpu.gif "cpu"
[cpu-tooltip]: previews/cpu-panel/cpu-tooltip.gif "cpu-tooltip"
[cpu-gui]: previews/cpu-panel/cpu-gui.png "cpu-gui"
[datetime]: previews/datetime-panel/datetime.gif "datetime"
[datetime-tooltip]: previews/datetime-panel/datetime-tooltip.png "datetime-tooltip"
[die]: previews/die-panel/die.gif "die"
[disk]: previews/disk-panel/disk.png "disk"
[disk-tooltip]: previews/disk-panel/disk-tooltip.png "disk-tooltip"
[eject]: previews/eject-panel/eject.png "eject"
[eject-gui]: previews/eject-panel/eject-gui.png "eject-gui"
[kernel]: previews/kernel-panel/kernel.png "kernel"
[kernel-tooltip]: previews/kernel-panel/kernel-tooltip.png "kernel-tooltip"
[memory]: previews/memory-panel/memory.gif "memory"
[memory-tooltip]: previews/memory-panel/memory-tooltip.gif "memory-tooltip"
[memory-gui]: previews/memory-panel/memory-gui.png "memory-gui"
[network]: previews/network-panel/network.gif "network"
[network-tooltip]: previews/network-panel/network-tooltip.png "network-tooltip"
[pacman]: previews/pacman-panel/pacman.png "pacman"
[pacman-tooltip]: previews/pacman-panel/pacman-tooltip.png "pacman-tooltip"
[power]: previews/power-panel/power.png "power"
[power-gui]: previews/power-panel/power-gui.png "power-gui"
[spotify]: previews/spotify-panel/spotify.gif "spotify"
[spotify-tooltip]: previews/spotify-panel/spotify-tooltip.png "spotify-tooltip"
44 changes: 17 additions & 27 deletions disk-panel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Dependencies: bash>=3.2, bleachbit(optional), coreutils, file, gawk)
# Dependencies: bash>=3.2, bleachbit(optional), coreutils, file, gawk, hddtemp, bc

# Makes the script more portable
readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -11,57 +11,47 @@ readonly ICON="${DIR}/icons/disk/database.png"

# Command to grab current HDD's temperature
# Change --unit to F if you don't want Celsius as default
# Virtual Machines will report 0 ℃
GET_TEMP=$(sudo hddtemp --unit=C --wake-up --quiet --numeric /dev/sda)

# To determine if colors are applied
OVERHEAT=0

# Panel
INFO=""
if hash bleachbit &> /dev/null; then
INFO="<click>bleachbit &> /dev/null</click>"
INFO+="<click>bleachbit &> /dev/null</click>"
elif hash gparted &> /dev/null; then
INFO+="<click>gparted &> /dev/null</click>"
fi

if [[ $(file -b "${ICON}") =~ PNG|SVG ]]; then
INFO+="<img>${ICON}</img>"
INFO+="<txt>"
else
INFO+="<txt>"
fi

[[ "${GET_TEMP}" -gt 42 ]] && \
OVERHEAT=1 && \
INFO+="<span weight='Bold' fgcolor='#FF5D5D'>"
USED_SPACE=$(awk '{$1 = $1 / 1048576; printf "%.2f", $1}' <<< $(df / | awk '/\/dev/{print $3}'))
TOTAL_SPACE=$(awk '{$1 = $1 / 1048576; printf "%.2f", $1}' <<< $(df / | awk '/\/dev/{print $2}'))
PERCENTAGE=$(echo $(echo "${USED_SPACE} * 100" | bc -l) / "${TOTAL_SPACE}" | bc -l)

INFO+="$(awk '{$1 = $1 / 1048576; printf "%.2f", $1}' <<< $(df / | awk '/\/dev/{print $3}'))"
INFO+=""
INFO+="$(awk '{$1 = $1 / 1048576; printf "%.2f", $1}' <<< $(df / | awk '/\/dev/{print $2}'))"
INFO+=" GB"

# Close span tag if warning colors are applied
[[ "${OVERHEAT}" -eq 1 ]] && \
INFO+="</span>"

INFO+="</txt>"
# Percentage bar
BAR="<bar>${PERCENTAGE}</bar>"

# Tooltip
MORE_INFO="<tool>"
MORE_INFO+="$(df -h / | awk '/\/dev/{print $1}' | head -n1)\n"
MORE_INFO+="├─ Vendor:\t\t$(awk '/[V]endor:/{print $2}' /proc/scsi/scsi)\n"
MORE_INFO+="├─ Model:\t\t$(awk '/[Mm]odel:/{print $4, $5}' /proc/scsi/scsi)\n"
MORE_INFO+="├─ Revision:\t\t$(awk '/[Rr]ev:/{print $7}' /proc/scsi/scsi)\n"
MORE_INFO+="├─ Type:\t\t\t$(awk '/[Tt]ype:/{print $2, $3, $4}' /proc/scsi/scsi)\n"

MORE_INFO+="Usage:\\t\\t${USED_SPACE} / ${TOTAL_SPACE} GB\\n"
############# !!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!! ####################
# Append the following line to /etc/sudoers (Recommended: edit with visudo)
# %wheel ALL=(ALL) NOPASSWD: /usr/bin/hddtemp
# If you don't do the above, xfce4-panel will freeze and
# eventually will freeze X too. So, be careful!
MORE_INFO+="└─ Temperature:\t${GET_TEMP}"

# eventually will freeze X too and maybe PAM as well. So, be careful!
MORE_INFO+="Temperature:\\t${GET_TEMP}"
MORE_INFO+="</tool>"

# Panel Print
echo -e "${INFO}"

# Bar print
echo -e "${BAR}"

# Tooltip Print
echo -e "${MORE_INFO}"
6 changes: 3 additions & 3 deletions network-panel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Dependencies: bash>=3.2, bc, coreutils, file, gawk, ship>=2.6 (see https://github.com/xtonousou/shIP)
# Dependencies: bash>=3.2, bc, coreutils, file, gawk, tr, ss

# Makes the script more portable
readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -9,8 +9,8 @@ readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Recommended size is 24x24 px
readonly ICON="${DIR}/icons/network/web.png"

# Displays all active network interfaces with their IPv4 addresses (local)
readonly TOOLTIP=$(ship --ipv4)
# Displays summary of tcp and udp connections
readonly TOOLTIP=$(ss -s | head -n 3 | grep -Ev "^$")

# You can pass the desired network interface on the command
# On the generic monitor properties
Expand Down
Binary file added previews/disk-panel/disk-tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added previews/disk-panel/disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed previews/disk-panel/network-tooltip.png
Binary file not shown.
Binary file removed previews/disk-panel/network.gif
Binary file not shown.
Binary file modified previews/network-panel/network-tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion ship
Submodule ship deleted from d060ad
2 changes: 0 additions & 2 deletions spotify-panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ else
if [[ $(file -b "${ICON}") =~ PNG|SVG ]]; then
INFO="<img>${ICON}</img>"
INFO+="<txt>"
INFO+="Offline"
INFO+="</txt>"
else
INFO="<txt>"
INFO+="Offline"
INFO+="</txt>"
fi

Expand Down

0 comments on commit 0b13a70

Please sign in to comment.