power menu, redshift, polybar
This commit is contained in:
28
.config/polybar/scripts/system-gpu-intel/README.md
Normal file
28
.config/polybar/scripts/system-gpu-intel/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Script: system-gpu-intel
|
||||
|
||||
A script that shows the Intel GPU consumption. It is calculated on the current frequency.
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `intel_gpu_frequency` from `intel-gpu-tools`
|
||||
* `bc`
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
You have to add the `intel_gpu_frequency` command to the `/etc/sudoers` NOPASSWD of your user:
|
||||
|
||||
```
|
||||
user ALL=(ALL) NOPASSWD: /usr/bin/intel_gpu_frequency
|
||||
```
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/system-gpu-intel]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/system-gpu-intel.sh
|
||||
interval = 20
|
||||
```
|
||||
10
.config/polybar/scripts/system-gpu-intel/system-gpu-intel.sh
Normal file
10
.config/polybar/scripts/system-gpu-intel/system-gpu-intel.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
gpu=$(sudo intel_gpu_frequency --get)
|
||||
|
||||
gpu_cur=$(echo "$gpu" | grep cur | awk '{ print $2 }')
|
||||
gpu_max=$(echo "$gpu" | grep max | awk '{ print $2 }')
|
||||
|
||||
gpu_percent=$(echo "$gpu_cur/$gpu_max*100" | bc -l | cut -d "." -f 1)
|
||||
|
||||
echo "# $gpu_percent %"
|
||||
Reference in New Issue
Block a user