Dotfiles config update (2022-05-01)

This commit is contained in:
q3aql 2022-05-01 02:22:15 +02:00
parent 1b7820f6da
commit 7d624248aa
20 changed files with 686 additions and 20 deletions

View File

@ -206,7 +206,7 @@ format-background = ${colors.background}
[module/kernel] [module/kernel]
format-foreground = #51A6E3 format-foreground = #51A6E3
type = custom/script type = custom/script
exec = ~/.config/polybar/kernel_version.sh exec = ~/.config/polybar/scripts/kernel_version.sh
interval = 10 interval = 10
[module/cpu] [module/cpu]
@ -217,17 +217,17 @@ format-foreground = #B63CEC
; Seconds to sleep between updates ; Seconds to sleep between updates
; Default: 1 ; Default: 1
type = custom/script type = custom/script
exec = ~/.config/polybar/cpu_info.sh exec = ~/.config/polybar/scripts/cpu_info.sh
interval = 0.5 interval = 0.5
[module/meminfo] [module/meminfo]
type = custom/script type = custom/script
exec = ~/.config/polybar/mem_info.sh exec = ~/.config/polybar/scripts/mem_info.sh
format-foreground = #CADD8A format-foreground = #CADD8A
[module/diskinfo] [module/diskinfo]
type = custom/script type = custom/script
exec = ~/.config/polybar/disk_info.sh exec = ~/.config/polybar/scripts/disk_info.sh
format-foreground = #C14F3F format-foreground = #C14F3F
[module/i3] [module/i3]
@ -272,7 +272,7 @@ label-urgent-padding = 1
[module/wlan] [module/wlan]
type = internal/network type = internal/network
interface = wlxc46e1f24d377 interface = wlan0
interval = 3.0 interval = 3.0
format-connected = <label-connected> format-connected = <label-connected>

View File

@ -0,0 +1,435 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[glob]
background = ${xrdb: color0}
foreground = ${xrdb: color7}
alert = ${xrdb: color9}
underline = ${xrdb: color2}
primary = ${xrdb: color7}
red = ${xrdb: color9}
green = ${xrdb: color2}
yellow = ${xrdb: color3}
light-blue = ${xrdb: color4}
light-pink = ${xrdb: color5}
light-green = ${xrdb: color6}
padding = 1
[bar/mainbar-i3]
monitor = ${env:MONITOR:}
;monitor = ${env:MONITOR:HDMI-1}
;monitor = ${env:MONITOR:DisplayPort-0}
;monitor = ${env:MONITOR:DisplayPort-1}
width = 100%
height = 28
;override-redirect = true
;offset-x = 25%
;offset-y = 0%
radius = 0.0
fixed-center = true
;background = ${glob.background}
;background = #222133
background = #2b303b
foreground = #ADBAC7
underline = #664477
line-size = 0
;line-color = #f004477
line-color = #9fa8af
border-size = 0
;border-color = #664477
;border-color = #00000000
;border-color = ${glob.background}
padding-left = 0
padding-right = 0
module-margin-left = 0
module-margin-right = 0
font-0 = "UbuntuMono Nerd Font:size=11;0"
font-1 = "FontAwesome:size=10;0"
font-2 = "Noto Sans:size=10;0"
font-3 = "Noto Sans Mono:size=10;0"
modules-left = i3
; modules-center = calendar date
; modules-right = checkupdate kernel cpu meminfo diskinfo pulseaudio wlan eth0 date
modules-right = checkupdate ikernel icpu imeminfo getvolume currentdate
tray-position = right
tray-margin = 0
;tray-background = #222133
tray-background = #2b303b
;wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[bar/mainbar-spectrwm]
monitor = ${env:MONITOR}
;monitor-fallback = HDMI1
width = 100%
height = 26
;offset-x = 1%
;offset-y = 1%
radius = 0.0
fixed-center = true
;bottom = false
;separator = |
;background = ${glob.background}
background = #222133
foreground = #ADBAC7
underline = #664477
line-size = 3
line-color = #f004477
;wm-restack = bspwm
override-redirect = true
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.
;enable-ipc = true
border-size = 0
;border-color = #664477
;border-color = #00000000
;border-color = ${glob.background}
padding-left = 0
padding-right = 0
module-margin-left = 1
module-margin-right = 0
;https://github.com/jaagr/polybar/wiki/Fonts
font-0 = "Noto Sans:size=10;0"
font-1 = "FontAwesome:size=10;0"
font-2 = "Noto Sans:size=10;0"
font-3 = "Noto Sans Mono:size=10;0"
;modules-left = ewmh xwindow
modules-left = ewmh
;modules-center = kernel
;modules-right = pavolume memory2 cpu2 date
modules-right = kernel cpu meminfo diskinfo pulseaudio date
;tray-detached = false
;tray-offset-x = 0
;tray-offset-y = 0
tray-padding = 0
;tray-maxsize = 20
;tray-scale = 1.0
tray-position = right
;tray-margin = 0
tray-background = #222133
scroll-up = spectrwm-desknext
scroll-down = spectrwm-deskprev
[module/xwindow]
;https://github.com/jaagr/polybar/wiki/Module:-xwindow
type = internal/xwindow
; Available tokens:
; %title%
; Default: %title%
label = %title%
label-maxlen = 50
format-foreground = ${colors.foreground}
format-background = ${colors.background}
[module/ewmh]
type = internal/xworkspaces
pin-workspaces = false
enable-click = true
enable-scroll = true
reverse-scroll = true
#icon-5 = 6;
format = <label-state>
label-monitor = %name%
label-active = %name%
label-active-foreground = ${colors.foreground}
;label-active-background = ${colors.background}
label-active-background = #42516d
label-active-underline= #dbdbdb
label-active-padding = 1
label-occupied = %name%
label-occupied-background = ${colors.background}
label-occupied-padding = 1
label-urgent = %name%
label-urgent-foreground = ${colors.foreground}
label-urgent-background = ${colors.alert}
label-urgent-underline = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = ${colors.foreground}
label-empty-padding = 0
format-foreground = ${colors.foreground}
format-background = ${colors.background}
[module/kernel]
format-foreground = #51A6E3
type = custom/script
exec = ~/.config/polybar/scripts/kernel_version.sh
interval = 10
[module/ikernel]
format-foreground = #51A6E3
type = custom/script
exec = ~/.config/polybar/iscripts/kernel_version.sh
interval = 10
[module/cpu]
;type = internal/cpu
format-foreground = #B63CEC
;format = <label>
;label = CPU %percentage%%
; Seconds to sleep between updates
; Default: 1
type = custom/script
exec = ~/.config/polybar/scripts/cpu_info.sh
interval = 0.5
[module/icpu]
;type = internal/cpu
format-foreground = #B63CEC
;format = <label>
;label = CPU %percentage%%
; Seconds to sleep between updates
; Default: 1
type = custom/script
exec = ~/.config/polybar/iscripts/cpu_info.sh
interval = 0.5
[module/checkupdate]
type = custom/script
interval = 1800
exec = ~/.config/polybar/iscripts/checkUpdates.sh
format-foreground = #CADD8A
[module/imeminfo]
type = custom/script
exec = ~/.config/polybar/iscripts/mem_info.sh
format-foreground = #CADD8A
[module/meminfo]
type = custom/script
exec = ~/.config/polybar/scripts/mem_info.sh
format-foreground = #CADD8A
[module/diskinfo]
type = custom/script
exec = ~/.config/polybar/scripts/disk_info.sh
format-foreground = #C14F3F
[module/currentdate]
type = custom/script
interval = 10
exec = ~/.config/polybar/iscripts/current_date.sh
format-foreground = #C14F3F
[module/getvolume]
type = custom/script
interval = 2
exec = ~/.config/polybar/iscripts/get_volume.sh
format-foreground = #DDAA33
[module/i3]
type = internal/i3
;format = <label-state> <label-mode>
;index-sort = true
;wrapping-scroll = false
strip-wsnumbers = true
; Only show workspaces on the same output as the bar
pin-workspaces = true
label-mode-padding = ${glob.padding}
label-mode-foreground = #664477
label-mode-background = ${glob.primary}
; focused = Active workspace on focused monitor
label-focused = %name%
label-focused-foreground = ${colors.foreground}
;label-focused-background = ${colors.background}
label-focused-background = #42516d
label-focused-underline = #dbdbdb
label-focused-padding = 1
; unfocused = Inactive workspace on any monitor
;label-unfocused = %name%
label-unfocused-padding = 0.5
; visible = Active workspace on unfocused monitor
label-visible = %name%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = 1
; urgent = Workspace with urgency hint set
label-urgent = %name%
label-urgent-foreground = ${glob.red}
label-urgent-padding = 1
; Separator in between workspaces
; label-separator = |
[module/wlan]
type = internal/network
interface = wlan0
interval = 3.0
format-connected = <label-connected>
;format-connected-underline = ${glob.underline}
label-connected = "%{A1:networkmanager_dmenu:}直 %essid%%{A}"
;label-connected-background = ${glob.light-blue}
label-connected-foreground = ${glob.light-blue}
label-connected-padding = ${glob.padding}
format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
label-disconnected = 睊 %ifname% disconnected
;label-disconnected-background = ${glob.light-blue}
label-disconnected-foreground = #665C54
label-disconnected-padding = ${glob.padding}
[module/eth]
type = internal/network
interface = eth0
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${glob.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${glob.foreground-alt}
[module/date]
type = internal/date
interval = 5
date = "%d %b %Y"
;date-alt = " %Y-%m-%d"
time = %H:%M
;time-alt = %H:%M:%S
;format-prefix = 
;format-prefix-padding = 1
format-padding = ${glob.padding}
format-foreground = #51A6E3
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume>
label-volume =墳 %percentage%%
label-volume-foreground = ${glob.yellow}
;label-volume-background = ${glob.yellow}
label-volume-padding = 2
label-muted = 
label-muted-foreground = #665C54
;label-muted-background = ${glob.yellow}
label-muted-padding = ${glob.padding}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 99
# Charging
format-charging = <label-charging>
label-charging =  %percentage%%
format-charging-padding = ${glob.padding}
format-charging-background = ${glob.light-pink}
format-charging-foreground = ${glob.background}
# Discharging
format-discharging = <label-discharging>
label-discharging =  ﮤ%percentage%
format-discharging-padding = ${glob.padding}
format-discharging-background = ${glob.light-pink}
format-discharging-foreground = ${glob.background}
# Full
format-full = <label-full>
label-full =  Full
format-full-padding = ${glob.padding}
format-full-background = ${glob.light-pink}
format-full-foreground = ${glob.background}
;[module/calendar]
;type = custom/text
;content = 
;content-foreground = ${glob.foreground}
;content-padding = ${glob.padding}
;content-underline = ${glob.underline}
;click-left = gsimplecal
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 5
#vim:ft=dosini

View File

@ -46,12 +46,14 @@ radius = 0.0
fixed-center = true fixed-center = true
;background = ${glob.background} ;background = ${glob.background}
background = #222133 ;background = #222133
background = #2b303b
foreground = #ADBAC7 foreground = #ADBAC7
underline = #664477 underline = #664477
line-size = 2 line-size = 2
line-color = #f004477 ;line-color = #f004477
line-color = #9fa8af
border-size = 0 border-size = 0
;border-color = #664477 ;border-color = #664477
@ -74,7 +76,8 @@ modules-left = i3
modules-right = kernel cpu meminfo diskinfo pulseaudio wlan eth0 date modules-right = kernel cpu meminfo diskinfo pulseaudio wlan eth0 date
tray-position = right tray-position = right
;tray-margin = 0 ;tray-margin = 0
tray-background = #222133 ;tray-background = #222133
tray-background = #2b303b
;wm-restack = bspwm ;wm-restack = bspwm
;wm-restack = i3 ;wm-restack = i3
@ -179,8 +182,9 @@ label-monitor = %name%
label-active = %name% label-active = %name%
label-active-foreground = ${colors.foreground} label-active-foreground = ${colors.foreground}
label-active-background = ${colors.background} ;label-active-background = ${colors.background}
label-active-underline= #6790eb label-active-background = #42516d
label-active-underline= #dbdbdb
label-active-padding = 2 label-active-padding = 2
label-occupied = %name% label-occupied = %name%
@ -202,7 +206,7 @@ format-background = ${colors.background}
[module/kernel] [module/kernel]
format-foreground = #51A6E3 format-foreground = #51A6E3
type = custom/script type = custom/script
exec = ~/.config/polybar/kernel_version.sh exec = ~/.config/polybar/scripts/kernel_version.sh
interval = 10 interval = 10
[module/cpu] [module/cpu]
@ -213,17 +217,17 @@ format-foreground = #B63CEC
; Seconds to sleep between updates ; Seconds to sleep between updates
; Default: 1 ; Default: 1
type = custom/script type = custom/script
exec = ~/.config/polybar/cpu_info.sh exec = ~/.config/polybar/scripts/cpu_info.sh
interval = 0.5 interval = 0.5
[module/meminfo] [module/meminfo]
type = custom/script type = custom/script
exec = ~/.config/polybar/mem_info.sh exec = ~/.config/polybar/scripts/mem_info.sh
format-foreground = #CADD8A format-foreground = #CADD8A
[module/diskinfo] [module/diskinfo]
type = custom/script type = custom/script
exec = ~/.config/polybar/disk_info.sh exec = ~/.config/polybar/scripts/disk_info.sh
format-foreground = #C14F3F format-foreground = #C14F3F
[module/i3] [module/i3]
@ -243,8 +247,9 @@ label-mode-background = ${glob.primary}
; focused = Active workspace on focused monitor ; focused = Active workspace on focused monitor
label-focused = %name% label-focused = %name%
label-focused-foreground = ${colors.foreground} label-focused-foreground = ${colors.foreground}
label-focused-background = ${colors.background} ;label-focused-background = ${colors.background}
label-focused-underline = #6790eb label-focused-background = #42516d
label-focused-underline = #dbdbdb
label-focused-padding = 1 label-focused-padding = 1
; unfocused = Inactive workspace on any monitor ; unfocused = Inactive workspace on any monitor
@ -267,7 +272,7 @@ label-urgent-padding = 1
[module/wlan] [module/wlan]
type = internal/network type = internal/network
interface = wlxc46e1f24d377 interface = wlan0
interval = 3.0 interval = 3.0
format-connected = <label-connected> format-connected = <label-connected>

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Check updates on Arch Linux
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/pacman -Sy
# 30 * * * * root /usr/bin/pacman -Sy
if [ -f /usr/bin/pacman ] ; then
num_packages=$(pacman -Qu | wc -l)
echo "${num_packages} "
# Check updates on Ubuntu/Debian/Devuan
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/aptitude update
# 30 * * * * root /usr/bin/aptitude update
elif [ -f /usr/bin/aptitude ] ; then
num_packages=$(aptitude search "~U" | wc -l)
echo "${num_packages} "
# Disable for other distros
else
echo " 0 "
fi

View File

@ -0,0 +1,20 @@
#!/bin/sh
check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
CPU_USAGE=$(~/.config/polybar/iscripts/cpu_load.sh -p)
echo "$CPU_USAGE" | awk '{ printf("%6s \n"), $1, $2 }'
else
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/polybar/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf("%6s @ %s \n"), $1, $2 }'
fi
else
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/polybar/iscripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf("%6s @ %s \n"), $1, $2 }'
fi

View File

@ -0,0 +1,4 @@
#!/bin/bash
current_date=$(date "+%d/%m/%Y %H:%M")
echo "${current_date} "

View File

@ -0,0 +1,4 @@
#!/bin/bash
get_volume=$(amixer | grep "%" | head -1 | cut -d "%" -f 1 | cut -d "[" -f 2)
echo "${get_volume}% "

View File

@ -0,0 +1,34 @@
#!/bin/bash
# Parameters
longNumber=2
kernelCommand="uname -r"
archCommand=$(uname -m)
# Kernel version
kernelVersion=""
count=1
# Extract numbers of kernel version
kernelVersionTemp=$(uname -r | cut -d "." -f ${count})
kernelVersionTempDot="${kernelVersionTemp}"
kernelVersion="${kernelVersion}${kernelVersionTempDot}"
count=$(expr ${count} + 1)
while [ ${count} -le ${longNumber} ] ; do
kernelVersionTemp=$(uname -r | cut -d "." -f ${count})
kernelVersionTempDot=".${kernelVersionTemp}"
kernelVersion="${kernelVersion}${kernelVersionTempDot}"
count=$(expr ${count} + 1)
done
kernelVersionTemp=$(uname -r | cut -d "." -f ${count} | cut -d "-" -f 1)
kernelVersionTempDot=".${kernelVersionTemp}"
kernelVersion=${kernelVersion}${kernelVersionTempDot}
# Apply arch
#kernelVersion=${kernelVersion}-${archCommand}
kernelVersion=${kernelVersion}
#echo "Kernel: Linux ${kernelVersion} "
echo " Linux ${kernelVersion} "

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Terminate already running bar instances
killall -q polybar
# Restore config for i3
#cp -rfv ~/.config/polybar/config.i3 ~/.config/polybar/config
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload mainbar-spectrwm -c ~/.config/polybar/config &
done
else
polybar --reload mainbar-spectrwm -c ~/.config/polybar/config &
fi
# Launch bar1 and bar2
#polybar example &
#echo "Bars launched..."

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Terminate already running bar instances
killall -q polybar
# Restore config for i3
#cp -rfv ~/.config/polybar/config.i3 ~/.config/polybar/config
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload mainbar-i3 -c ~/.config/polybar/config &
done
else
polybar --reload mainbar-i3 -c ~/.config/polybar/config &
fi
# Launch bar1 and bar2
#polybar example &
#echo "Bars launched..."

View File

@ -0,0 +1,6 @@
#!/bin/bash
mem_info=$(free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }')
echo -n " "
echo -n ${mem_info}
echo " "

View File

@ -4,17 +4,17 @@ check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then if [ -z "${check_sensor}" ] ; then
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null) check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then if [ -z "${check_sensor}" ] ; then
CPU_USAGE=$(~/.config/polybar/cpu_load.sh -p) CPU_USAGE=$(~/.config/polybar/scripts/cpu_load.sh -p)
echo "$CPU_USAGE" | awk '{ printf(" CPU:%6s \n"), $1, $2 }' echo "$CPU_USAGE" | awk '{ printf(" CPU:%6s \n"), $1, $2 }'
else else
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o) TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}') #CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/polybar/cpu_load.sh -p) CPU_USAGE=$(~/.config/polybar/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }' echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
fi fi
else else
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o) TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}') #CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
CPU_USAGE=$(~/.config/polybar/cpu_load.sh -p) CPU_USAGE=$(~/.config/polybar/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }' echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
fi fi

View File

@ -0,0 +1,83 @@
#!/bin/bash
# Script to show cpu
# Created by q3aql (q3aql@protonmail.ch)
# Licensed by GPL v.2
# Date: 10-01-2020
# --------------------------------------
VERSION="1.0"
# Variables
cpuPercentage=$(top -b -n1 | grep \%Cpu | awk '{print 100-$8}')
showCpuPercentage=$(echo ${cpuPercentage})
showCpuPercentageInteger=$(echo ${showCpuPercentage} | cut -d "." -f 1)
# Show percentage bar
if [ ${showCpuPercentageInteger} -ge 0 ] ; then
showCpuPercentageBar="="
fi
if [ ${showCpuPercentageInteger} -ge 3 ] ; then
showCpuPercentageBar="=="
fi
if [ ${showCpuPercentageInteger} -ge 12 ] ; then
showCpuPercentageBar="==="
fi
if [ ${showCpuPercentageInteger} -ge 18 ] ; then
showCpuPercentageBar="===="
fi
if [ ${showCpuPercentageInteger} -ge 25 ] ; then
showCpuPercentageBar="====="
fi
if [ ${showCpuPercentageInteger} -ge 35 ] ; then
showCpuPercentageBar="======"
fi
if [ ${showCpuPercentageInteger} -ge 40 ] ; then
showCpuPercentageBar="======="
fi
if [ ${showCpuPercentageInteger} -ge 45 ] ; then
showCpuPercentageBar="========"
fi
if [ ${showCpuPercentageInteger} -ge 50 ] ; then
showCpuPercentageBar="=========="
fi
if [ ${showCpuPercentageInteger} -ge 62 ] ; then
showCpuPercentageBar="============="
fi
if [ ${showCpuPercentageInteger} -ge 75 ] ; then
showCpuPercentageBar="==============="
fi
if [ ${showCpuPercentageInteger} -ge 85 ] ; then
showCpuPercentageBar="================="
fi
if [ ${showCpuPercentageInteger} -ge 90 ] ; then
showCpuPercentageBar="=================="
fi
if [ ${showCpuPercentageInteger} -ge 95 ] ; then
showCpuPercentageBar="==================="
fi
if [ ${showCpuPercentageInteger} -ge 100 ] ; then
showCpuPercentageBar="===================="
fi
# Show results
if [ "$1" == "-p" ]; then
echo ${showCpuPercentage}%
elif [ "$1" == "-b" ]; then
echo ${showCpuPercentageBar}
else
echo ""
echo " cpuinfo v$VERSION"
echo " ------------"
echo ""
echo " CpuPercentage Use:"
echo " ${showCpuPercentageBar} ${showCpuPercentage}%"
echo ""
echo " Available commands:"
echo ""
echo " cpuinfo.sh -p | Show CpuPercentage"
echo " cpuinfo.sh -b | Show CpuPercentage Bar"
echo ""
echo " Note: Conky require 'maximum_width = 240'"
echo ""
fi

View File

@ -0,0 +1,3 @@
#!/bin/bash
df -h / | awk '/\//{ printf(" %4s / %s \n", $4, $2) }'

View File

@ -29,7 +29,11 @@ dotfiles - My tiling i3 + polybar configuration (for Arch/Devuan/Debian)
$ cd dotfiles $ cd dotfiles
$ chmod +x install-config.sh $ chmod +x install-config.sh
$ ./install-config.sh $ ./install-config.sh
$ cd fonts
$ chmod +x install-fonts.sh
$ sudo ./install-fonts.sh
$ cp -rfv ~/.config/i3/config.polybar ~/.config/i3/config $ cp -rfv ~/.config/i3/config.polybar ~/.config/i3/config
$ cp -rfv ~/.config/polybar/config.icons ~/.config/polybar/config
```` ````
### Configuration: ### Configuration:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 KiB

After

Width:  |  Height:  |  Size: 403 KiB