Skip to content

yoelwep13578/Resource-Viewer-Plasma-Widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Resource Viewer Plasma Widget -- Command Sets for Zren's Plasma Applet CommandOutput

SRV Intro

About

SRV Features

Simple KDE Plasma Command Set widget based from Zren's "Command Output" that displays:

  • CPU Usage
  • RAM Usage
  • Disk Usage
  • Storage Usage
  • CPU Temperature

This widget can be attached on the Desktop or the Panel.

SRV Attach


Requirements

  • "Command Output" Widget
  • Have Nerd Fonts Installed (for icons)
  • Utility Linux Programs
    • top to view CPU Usage
    • sysstat --> iostat to view Disk Usage
    • df to view Storage Usage
    • lm-sensors --> sensors to view Temperature

Installation

1. Clone this Repository

$ cd ~/Downloads
$ git clone https://github.com/yoelwep13578/Resource-Viewer-Plasma-Widget
$ cd ./Resource-Viewer-Plasma-Widget

2. Move Scripts to Your Location

To keep it simple, you can move the Scripts folder to /home/yourname/

$ mv ./Scripts ~/

3. Install Output Command Widget

Since this is based on the Output Command, it needs to be installed first. Install it using one of the methods below:

  • Pling
  • Github
  • Or you can install it automatically with Right Click Desktop --> Enter Edit Mode --> Add Widgets --> Get New Widgets --> Download New Plasma Widgets and search with "Command Output" keyword. image

4. Install Nerd Font (Just for Nerd-Based Icons)

Nerd Font is a font with additional icon sets, like in this Nerd Fonts Cheat Sheet. It needs to be installed for some icons to render correctly. You can download & choose it from Nerd Font with your preference.

If you confused, you can use these example:

After downloaded the zip file, just extract all TTFs to the Desktop temporarily. Then, install (move) using this command:

$ sudo mv /home/yourname/Desktop/*.ttf /usr/share/fonts/TTF/

Sometimes, you need to run fc-cache, logout, or restarting system to refresh any changes


Setting Up

Basics

Each widget displaying CPU, RAM, Disk, Storage, and Temperature requires a separate Command Output Widget. This means you can use them according to your needs and place them freely.

For example, if you want to display only CPU and RAM, simply attach 2 Command Output Widgets and place them wherever you like.

Another example: if you want to display all of them, you will need to attach 5 Command Output Widgets. You can't use 1 Widget to display all 5 at once. If you want them in one place, you can group all 5 Command Output Widgets using the "Grouping Plasmoid" widget (only works when attached to the desktop).


Set-Up

In this repository, the directory structure is as follows:

Resource-Viewer-Plasma-Widget
└── Scripts
    ├── CPU Usage
    │   └── CPU-Usage.sh
    ├── RAM Usage
    │   └── RAM-Usage.sh
    ├── Disk Usage
    │   └── Disk-Usage.sh
    ├── Storage Usage
    │   └── Storage-Usage.sh
    └── Temperature
        └── Temperature.sh

And this is what it looks like after you move the Scripts folder to your Home directory:

home
└── yourname
    └── Scripts
        ├── CPU Usage
        │   └── CPU-Usage.sh
        ├── RAM Usage
        │   └── RAM-Usage.sh
        ├── Disk Usage
        │   └── Disk-Usage.sh
        ├── Storage Usage
        │   └── Storage-Usage.sh
        └── Temperature
            └── Temperature.sh

You only need to focus on the Scripts folder and its contents. The command sets for CPU, RAM, Disk, Storage, and Temperature are already there.

For example, you’ve attached 2 Command Output Widgets and want to display CPU and RAM. To do this, Right Click --> Configure Command Output --> In the Command section, enter bash followed by the location of the CPU-Usage.sh file:

bash "/home/yourname/Scripts/CPU Usage/CPU-Usage.sh"

Do the same for the other Command Output Widget, filling in bash and the location of the RAM-Usage.sh file:

bash "/home/yourname/Scripts/Disk Usage/Disk-Usage.sh"

What if you want to display all five? It’s simple. Make sure you’ve attached 5 Command Output Widgets --> Then configure each widget --> Provide the command with bash and the location of each .sh file:

[1] bash "/home/yourname/Scripts/CPU Usage/CPU-Usage.sh"
[2] bash "/home/yourname/Scripts/RAM Usage/RAM-Usage.sh"
[3] bash "/home/yourname/Scripts/Disk Usage/Disk-Usage.sh"
[4] bash "/home/yourname/Scripts/Storage Usage/Storage-Usage.sh"
[5] bash "/home/yourname/Scripts/Temperature/Temperature.sh"

Config

All Configurable Properties

Mode --> Overall display

  • Icon Mode: Displays the icon followed by the value
  • Inline Text Mode: Displays the title followed by the value on one line
  • Breakline Text Mode: Displays the title followed by the value on two lines

Show As --> Display for the values

  • Percent: Displays the value as a percentage only
  • Percent + Size: Displays the value as a percentage and the current size in use
  • Percent + Capacity: Displays the value as a percentage and the total/max size capacity
  • Percent + Details: Displays the value as a percentage and detailed text
  • Percent + Speed: Displays the value as a percentage and current speed details
  • Size: Displays the value as size in use only
  • Temp: Displays the current temperature only
  • Speed: Displays the current speed only
  • Size + Capacity: Displays the value as size in use and the total/max size capacity

Unit --> Display units to be used

  • GB --> Data size in Gigabytes
  • GiB --> Data size in Gibibytes
  • C --> Temperature in Celsius
  • F --> Temperature in Fahrenheit

Separator --> The separator between value 1 and value 2

  • The separator can be any character you want. By default, the separator is " | ". You can adjust it to your creativity!

The separator will not be displayed if "Show As" uses a single value (does not include a second value).

TextMode Title --> Text displayed in Inline or Breakline Text Mode

  • By default, the title usually contains text that identifies itself, followed by ":". For example, CPU:, RAM:, Temp:, etc. You can change it to whatever you like!

TextMode Title will not appear in Icon Mode.

Icon --> Symbol used in Icon Mode

  • By default, the icon uses hex code of Nerd Font Icons. You can change it with other Nerd Font Icons (as hex or exact character), emoji, unicode symbol, etc.

Icon will not appear in Text Mode.

Spacing --> Spaces between Icon/Title and Output Text

  • Default value is 1. You can change it with integer numbers.

Dynamic Conversion --> Conversion to a larger/smaller unit

  • Enabled: This will convert size values to KB, MB, GB, TB or KiB, MiB, GiB, TiB depending on the condition.
  • Disabled: This will keep the value in GB or GiB.

Target --> The target used to fetch the value

Disk
  • Can be set to the disk whose activity you want to monitor. The default is /dev/sda. You can set it to another disk if you have more than one.
Storage
  • Overall: Calculates total storage usage and capacity across mounted partitions and disks.
  • Can be set to a disk such as /dev/sda, to get the usage and capacity for that disk.
  • Can be set to a partition such as /dev/sda9, to get the usage and capacity for that partition.

Note

Since this data retrieved using fd, this only works with mounted partitions

CPU
  • All CPU: Fetches the average usage of all cores.
  • Inputting a core number like 0 fetches the usage for that core only.
Temp
  • All CPU: The average temperature of all cores, fetched from Sensors --> Package 0.
  • Inputting a core number like 0 fetches the temperature for that core.
  • Overall: The room temperature inside the computer case, usually fetched from acpitz-acpi-0.

Configure .../Scripts/CPU Usage/CPU-Usage.sh

Properties

The available config looks something like this:

#===================
#  EDITABLE ZONE
#===================

# Edit config here

mode="1"                   # [1] Icon Mode
                           # [2] Inline Text Mode
                           # [3] Breakline Text Mode

show_as="1"                # [1] Percent
                           # [2] Percent + Current Speed
                           # [3] Current Speed

separator=" | "            # Fill in with the separator of your choice

textmode_title="CPU:"      # Title in Text Mode
icon="\uf4bc"              # Icon in Icon Mode (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)

spacing="1"                # Spacing between Icon/Title and Output

target="overall"           # "overall" for all cores, or specific core (e.g. "1" for core 1)
                           # Core number start from 0

Configure it with your preference & creativity, or here’s another example you can create:

Example


Configure .../Scripts/RAM Usage/RAM-Usage.sh

Properties

The available config looks something like this:

#===================
#  EDITABLE ZONE
#===================

# Edit Config Here

mode="1"                # [1] Icon Mode
                        # [2] Inline Text Mode
                        # [3] Breakline Text Mode

unit="1"                # [1] GB
                        # [2] GiB

show_as="2"             # [1] Percent
                        # [2] Percent + Size
                        # [3] Percent + Capacity
                        # [4] Size
                        # [5] Size + Capacity

separator=" | "         # Fill in with the separator of your choice

textmode_title="RAM:"   # Title in Text Mode
icon="\xEE\xBF\x85"     # Icon in Icon Mode (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)

spacing="1"             # Spacing between Icon/Title and Output

Configure it with your preference & creativity, or here's another example you can create:

Example 1 Example 2 Example 3


Configure .../Scripts/Disk Usage/Disk-Usage.sh

Properties

The available config looks something like this:

#===================
#  EDITABLE ZONE
#===================

# Edit config here

mode="1"                  # [1] Icon Mode
                          # [2] Inline Text Mode
                          # [3] Breakline Text Mode

textmode_title="Disk: "   # Title for text mode

icon_idle="\uE271"        # Icon for <= threshold (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)
icon_active="\uEDE9"      # Icon for > threshold  (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)

spacing="1"               # Spacing between Icon/Title and Output

target="/dev/sda"         # Target disk, default is /dev/sda

Configure it with your preference & creativity. Here's example that you can try:

Example Creativity


Configure .../Scripts/Storage Usage/Storage-Usage.sh

Properties

The available config looks something like this:

#===================
#  EDITABLE ZONE
#===================

# Edit config here

mode="1"                # [1] Icon Mode
                        # [2] Inline Text Mode
                        # [3] Breakline Text Mode

unit="1"                # [1] GB
                        # [2] GiB

show_as="1"             # [1] Percent
                        # [2] Percent + Size
                        # [3] Percent + Capacity
                        # [4] Size
                        # [5] Size + Capacity

separator=" | "         # Fill in with the separator of your choice

textmode_title="Storage:"  # Title in Text Mode
icon="\uf1c0"           # Icon in Icon Mode (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)

spacing="1"             # Spacing between Icon/Title and Output

target="overall"        # Target to all mounted partitions --> use "overall"
                        # Target to disk --> write like "/dev/sda"
                        # Target to partition -> write like "/dev/sda5"

dynamic_conversion="1"  # [1] Enable dynamic conversion (KB/MiB/GB/TiB)
                        # [0] Disable dynamic conversion, stick to GB/GiB

Configure it with your preference & creativity. And here's another example you can create:

Example 1 Example 2 Example 3


Configure ../Scripts/Temperature/Temperature.sh

Properties

The available config looks something like this:

#===================
#  EDITABLE ZONE
#===================

# Edit config here
mode="1"                    # [1] Icon Mode
                            # [2] Inline Text Mode
                            # [3] Breakline Text Mode

unit="C"                    # "C" for Celsius
                            # "F" for Fahrenheit

show_as="1"                 # [1] Temp
                            # [2] Temp + Detail

separator=" | "             # Fill in with the separator of your choice

textmode_title="Temp:"      # Title in Text Mode

# Icons for each level (Nerd Font Icon Code, Exact Nerd Font Icon, Emoji, etc)
icon_lvl1="\uf2cb"          # Cold / Idle
icon_lvl2="\uf2ca"          # Normal
icon_lvl3="\uf2c9"          # Warm
icon_lvl4="\uf2c7"          # Hot
icon_default="\uf2cb"       # Default < level1

spacing="1"                 # Spacing between Icon/Title and Output

target="allCPU"             # "allCPU" for CPU Package 0
                            # "overall" for acpitz-acpi-0
                            # Write number for specific core (e.g. "0" for core 0)

# Limit & Details. Fill with:
# [Limit in Celsius], [Limit in Fahrenheit], [Detail text]
#
# Example:  level1_limit=(40 104 "Chill")
#   Celcius───────────────┘   │    └─────────Detail Text
#                        Fahrenheit

level1_limit=(40 104 "Idle")
level2_limit=(50 122 "Normal")
level3_limit=(72 162 "Warm")
level4_limit=(85 185 "Hot")

Configure it with your preference & creativity. Here's another example you can try:

Example


Bonus: Screenshot of using it on Panel

image


Credits

  • Chris Holland - Zren (Command Output Plasma Widget)
  • Ryan L McIntyre - ryanoasis (Nerd Fonts)

About

A simple widget that displays RAM, CPU, Storage, and Temperature. It is based on Zren's plasma-applet-commandoutput.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages