Dotfiles config update (2023-01-03)
This commit is contained in:
parent
4ce07dddda
commit
c986dd2b87
|
@ -8,8 +8,8 @@ set $mod Mod4
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
# is used in the bar {} block below.
|
# is used in the bar {} block below.
|
||||||
#font pango:monospace 10
|
#font pango:monospace 10
|
||||||
font pango:Noto Sans 10
|
#font pango:Noto Sans 10
|
||||||
#font pango:UbuntuMono Nerd Font 10
|
font pango:UbuntuMono Nerd Font 11.5
|
||||||
#font pango:Ubuntu 10.5
|
#font pango:Ubuntu 10.5
|
||||||
|
|
||||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||||
|
@ -39,7 +39,7 @@ exec --no-startup-id ~/.config/sway/startwlrrandr.sh &
|
||||||
#exec --no-startup-id "sleep 15 && picom &"
|
#exec --no-startup-id "sleep 15 && picom &"
|
||||||
|
|
||||||
# Configure wallpaper
|
# Configure wallpaper
|
||||||
exec --no-startup-id "swaybg -i ~/wallpapers/dark-city.jpg -m fill"
|
exec --no-startup-id "swaybg -i ~/wallpapers/39.png -m fill"
|
||||||
|
|
||||||
# Start Screensaver (Also Super+Ctrl+Shift+l to poweroff/start screen)
|
# Start Screensaver (Also Super+Ctrl+Shift+l to poweroff/start screen)
|
||||||
exec --no-startup-id ~/.config/sway/startwlrscreensaver.sh
|
exec --no-startup-id ~/.config/sway/startwlrscreensaver.sh
|
||||||
|
@ -184,58 +184,58 @@ default_border pixel 2
|
||||||
|
|
||||||
# Define names for default workspaces for which we configure key bindings later on.
|
# Define names for default workspaces for which we configure key bindings later on.
|
||||||
# We use variables to avoid repeating the names in multiple places.
|
# We use variables to avoid repeating the names in multiple places.
|
||||||
#set $ws1 "1"
|
set $ws1 "[term]"
|
||||||
#set $ws2 "2"
|
set $ws2 "[www]"
|
||||||
#set $ws3 "3"
|
set $ws3 "[chat]"
|
||||||
#set $ws4 "4"
|
set $ws4 "[files]"
|
||||||
#set $ws5 "5"
|
set $ws5 "[media]"
|
||||||
#set $ws6 "6"
|
set $ws6 "[game]"
|
||||||
#set $ws7 "7"
|
set $ws7 "[mail]"
|
||||||
#set $ws8 "8"
|
set $ws8 "[dev]"
|
||||||
#set $ws9 "9"
|
set $ws9 "[vm]"
|
||||||
#set $ws10 "10"
|
set $ws10 "[all]"
|
||||||
|
|
||||||
# switch to workspace
|
# switch to workspace
|
||||||
bindsym $mod+1 workspace number 1:term
|
bindsym $mod+1 workspace [term]
|
||||||
bindsym $mod+2 workspace number 2:www
|
bindsym $mod+2 workspace [www]
|
||||||
bindsym $mod+3 workspace number 3:chat
|
bindsym $mod+3 workspace [chat]
|
||||||
bindsym $mod+4 workspace number 4:files
|
bindsym $mod+4 workspace [files]
|
||||||
bindsym $mod+5 workspace number 5:media
|
bindsym $mod+5 workspace [media]
|
||||||
bindsym $mod+6 workspace number 6:game
|
bindsym $mod+6 workspace [game]
|
||||||
bindsym $mod+7 workspace number 7:mail
|
bindsym $mod+7 workspace [mail]
|
||||||
bindsym $mod+8 workspace number 8:dev
|
bindsym $mod+8 workspace [dev]
|
||||||
bindsym $mod+9 workspace number 9:vm
|
bindsym $mod+9 workspace [vm]
|
||||||
bindsym $mod+0 workspace number 10:all
|
bindsym $mod+0 workspace [all]
|
||||||
|
|
||||||
# move focused container to workspace
|
# move focused container to workspace
|
||||||
bindsym $mod+Shift+1 move container to workspace number 1:term
|
bindsym $mod+Shift+1 move container to workspace [term]
|
||||||
bindsym $mod+Shift+2 move container to workspace number 2:www
|
bindsym $mod+Shift+2 move container to workspace [www]
|
||||||
bindsym $mod+Shift+3 move container to workspace number 3:chat
|
bindsym $mod+Shift+3 move container to workspace [chat]
|
||||||
bindsym $mod+Shift+4 move container to workspace number 4:files
|
bindsym $mod+Shift+4 move container to workspace [files]
|
||||||
bindsym $mod+Shift+5 move container to workspace number 5:media
|
bindsym $mod+Shift+5 move container to workspace [media]
|
||||||
bindsym $mod+Shift+6 move container to workspace number 6:game
|
bindsym $mod+Shift+6 move container to workspace [game]
|
||||||
bindsym $mod+Shift+7 move container to workspace number 7:mail
|
bindsym $mod+Shift+7 move container to workspace [mail]
|
||||||
bindsym $mod+Shift+8 move container to workspace number 8:dev
|
bindsym $mod+Shift+8 move container to workspace [dev]
|
||||||
bindsym $mod+Shift+9 move container to workspace number 9:vm
|
bindsym $mod+Shift+9 move container to workspace [vm]
|
||||||
bindsym $mod+Shift+0 move container to workspace number 10:all
|
bindsym $mod+Shift+0 move container to workspace [all]
|
||||||
|
|
||||||
# force a window on a named workspace
|
# force a window on a named workspace
|
||||||
assign [class="Firefox"] 2:www
|
assign [class="Firefox"] [www]
|
||||||
#assign [app_id="mpv"] 5:media
|
#assign [app_id="mpv"] [media]
|
||||||
assign [class="vlc"] 5:media
|
assign [class="vlc"] [media]
|
||||||
assign [class="Ristretto"] 5:media
|
assign [class="Ristretto"] [media]
|
||||||
assign [class="Gimp"] 5:media
|
assign [class="Gimp"] [media]
|
||||||
assign [class="Gimp-2.10"] 5:media
|
assign [class="Gimp-2.10"] [media]
|
||||||
assign [class="Mozilla VPN"] 2:www
|
assign [class="Mozilla VPN"] [www]
|
||||||
assign [class="XTerm"] 1:term
|
assign [class="XTerm"] [term]
|
||||||
assign [app_id="VirtualBox Manager"] 9:vm
|
assign [app_id="VirtualBox Manager"] [vm]
|
||||||
assign [class="VirtualBox Machine"] 9:vm
|
assign [class="VirtualBox Machine"] [vm]
|
||||||
assign [class="Steam"] 6:game
|
assign [class="Steam"] [game]
|
||||||
assign [app_id="Telegram"] 3:chat
|
assign [app_id="Telegram"] [chat]
|
||||||
assign [app_id="Signal"] 3:chat
|
assign [app_id="Signal"] [chat]
|
||||||
assign [class="Pcmanfm"] 4:files
|
assign [class="Pcmanfm"] [files]
|
||||||
assign [app_id="Mousepad"] 8:dev
|
assign [app_id="Mousepad"] [dev]
|
||||||
assign [app_id="Geany"] 8:dev
|
assign [app_id="Geany"] [dev]
|
||||||
|
|
||||||
# force floatin windows
|
# force floatin windows
|
||||||
for_window [app_id="Volume Control" ] floating enable
|
for_window [app_id="Volume Control" ] floating enable
|
||||||
|
@ -312,13 +312,18 @@ exec_always {
|
||||||
# finds out, if available)
|
# finds out, if available)
|
||||||
bar {
|
bar {
|
||||||
position top
|
position top
|
||||||
|
status_command ~/.config/sway/scripts/status_bar.sh
|
||||||
swaybar_command waybar
|
swaybar_command waybar
|
||||||
workspace_buttons yes
|
workspace_buttons yes
|
||||||
#tray_output DisplayPort-0
|
#tray_output DP-0
|
||||||
colors {
|
colors {
|
||||||
separator #AAAAAA
|
separator #AAAAAA
|
||||||
background #222133
|
background #222133
|
||||||
statusline #FFFFFF
|
statusline #cccccc
|
||||||
|
focused_workspace #664477 #664477 #cccccc
|
||||||
|
active_workspace #5b399e #5b399e #cccccc
|
||||||
|
inactive_workspace #222133 #222133 #AAAAAA
|
||||||
|
urgent_workspace #CE4045 #CE4045 #FFFFFF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client.focused #664477 #664477 #cccccc #5b399e
|
client.focused #664477 #664477 #cccccc #5b399e
|
||||||
|
|
22
.config/sway/scripts/checkUpdates.sh
Executable file
22
.config/sway/scripts/checkUpdates.sh
Executable 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
|
20
.config/sway/scripts/cpu_info.sh
Executable file
20
.config/sway/scripts/cpu_info.sh
Executable 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/dwm/scripts/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/dwm/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/dwm/scripts/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE $TEMP" | awk '{ printf("%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
83
.config/sway/scripts/cpu_load.sh
Executable file
83
.config/sway/scripts/cpu_load.sh
Executable 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
|
4
.config/sway/scripts/current_date.sh
Executable file
4
.config/sway/scripts/current_date.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
current_date=$(date "+%d/%m/%Y %H:%M")
|
||||||
|
echo " ${current_date} "
|
3
.config/sway/scripts/disk_info.sh
Executable file
3
.config/sway/scripts/disk_info.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
df -h / | awk '/\//{ printf(" %4s / %s \n", $4, $2) }'
|
4
.config/sway/scripts/get_volume.sh
Executable file
4
.config/sway/scripts/get_volume.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
get_volume=$(amixer | grep "%" | head -1 | cut -d "%" -f 1 | cut -d "[" -f 2)
|
||||||
|
echo " ${get_volume}% "
|
34
.config/sway/scripts/kernel_version.sh
Executable file
34
.config/sway/scripts/kernel_version.sh
Executable 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 " ${kernelVersion} "
|
||||||
|
|
34
.config/sway/scripts/kernel_version_num.sh
Executable file
34
.config/sway/scripts/kernel_version_num.sh
Executable 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 " ${kernelVersion} "
|
||||||
|
|
47
.config/sway/scripts/mem_info.sh
Executable file
47
.config/sway/scripts/mem_info.sh
Executable file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Configuration variable
|
||||||
|
python_bin="/usr/bin/python3"
|
||||||
|
memfile="/proc/meminfo"
|
||||||
|
size="G" # Change to M for MiB
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
memTotal=$(cat ${memfile} | grep -i "memtotal:" | head -1 | tr -s " " | cut -d " " -f 2)
|
||||||
|
memActive=$(cat ${memfile} | grep -i "memavailable:" | head -1 | tr -s " " | cut -d " " -f 2)
|
||||||
|
memActive=$(expr ${memTotal} - ${memActive})
|
||||||
|
|
||||||
|
# Variables to calculate
|
||||||
|
memTotalM=$(expr ${memTotal} / 1024 )
|
||||||
|
memActiveM=$(expr ${memActive} / 1024)
|
||||||
|
if [ -f ${python_bin} ] ; then
|
||||||
|
memPercentage=$(echo "n=${memActive}/${memTotal}*100 ; print(n)" | ${python_bin})
|
||||||
|
memTotalG=$(echo "n=${memTotalM}/1024 ; print(n)" | ${python_bin} | tr -s " " | cut -c1-4)
|
||||||
|
memActiveG=$(echo "n=${memActiveM}/1024 ; print(n)" | ${python_bin} | tr -s " " | cut -c1-4)
|
||||||
|
elif [ -f /usr/bin/calc ] ; then
|
||||||
|
memPercentage=$(calc ${memActive} / ${memTotal} \* 100)
|
||||||
|
memTotalG=$(calc ${memTotalM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
memActiveG=$(calc ${memActiveM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
else
|
||||||
|
memPercentage=$(expr ${memActive} / ${memTotal} \* 100)
|
||||||
|
memTotalG=$(expr ${memTotalM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
memActiveG=$(expr ${memActiveM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Variables to show
|
||||||
|
showMemPercentage=$(echo ${memPercentage} | cut -d "~" -f 2 | cut -d "." -f 1)
|
||||||
|
if [ "${size}" == "G" ] ; then
|
||||||
|
showMemTotal="${memTotalG}Gi"
|
||||||
|
showMemActive="${memActiveG}Gi"
|
||||||
|
elif [ "${size}" == "M" ] ; then
|
||||||
|
showMemTotal="${memTotalM}Mi"
|
||||||
|
showMemActive="${memActiveM}Mi"
|
||||||
|
else
|
||||||
|
showMemTotal="${memTotalG}Gi"
|
||||||
|
showMemActive="${memActiveG}Gi"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n " "
|
||||||
|
memshowactive=$(echo ${showMemActive})
|
||||||
|
memshowtotal=$(echo ${showMemTotal})
|
||||||
|
echo -n ${memshowactive}/${memshowtotal}
|
||||||
|
echo " "
|
42
.config/sway/scripts/mem_info_new.sh
Executable file
42
.config/sway/scripts/mem_info_new.sh
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Configuration variables
|
||||||
|
memfile="/proc/meminfo"
|
||||||
|
size="G" # Change to M for MiB
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
memTotal=$(cat ${memfile} | grep -i "memtotal:" | head -1 | tr -s " " | cut -d " " -f 2)
|
||||||
|
memActive=$(cat ${memfile} | grep -i "memavailable:" | head -1 | tr -s " " | cut -d " " -f 2)
|
||||||
|
memActive=$(expr ${memTotal} - ${memActive})
|
||||||
|
|
||||||
|
# Variables to calculate
|
||||||
|
memTotalM=$(expr ${memTotal} / 1024 )
|
||||||
|
memActiveM=$(expr ${memActive} / 1024)
|
||||||
|
if [ -f /usr/bin/calc ] ; then
|
||||||
|
memPercentage=$(calc ${memActive} / ${memTotal} \* 100)
|
||||||
|
memTotalG=$(calc ${memTotalM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
memActiveG=$(calc ${memActiveM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
else
|
||||||
|
memPercentage=$(expr ${memActive} / ${memTotal} \* 100)
|
||||||
|
memTotalG=$(expr ${memTotalM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
memActiveG=$(expr ${memActiveM} / 1024 | tr -s " " | cut -c1-5)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Variables to show
|
||||||
|
showMemPercentage=$(echo ${memPercentage} | cut -d "~" -f 2 | cut -d "." -f 1)
|
||||||
|
if [ "${size}" == "G" ] ; then
|
||||||
|
showMemTotal="${memTotalG}Gi"
|
||||||
|
showMemActive="${memActiveG}Gi"
|
||||||
|
elif [ "${size}" == "M" ] ; then
|
||||||
|
showMemTotal="${memTotalM}Mi"
|
||||||
|
showMemActive="${memActiveM}Mi"
|
||||||
|
else
|
||||||
|
showMemTotal="${memTotalG}Gi"
|
||||||
|
showMemActive="${memActiveG}Gi"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n " "
|
||||||
|
memshowactive=$(echo ${showMemActive})
|
||||||
|
memshowtotal=$(echo ${showMemTotal})
|
||||||
|
echo -n ${memshowactive}/${memshowtotal}
|
||||||
|
echo " "
|
6
.config/sway/scripts/mem_info_old.sh
Executable file
6
.config/sway/scripts/mem_info_old.sh
Executable 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 " "
|
14
.config/sway/scripts/status_bar.sh
Executable file
14
.config/sway/scripts/status_bar.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
status_bar=0
|
||||||
|
|
||||||
|
while [ ${status_bar} -eq 0 ] ; do
|
||||||
|
updates=$(~/.config/sway/scripts/checkUpdates.sh)
|
||||||
|
kernel=$(~/.config/sway/scripts/kernel_version.sh)
|
||||||
|
cpuinfo=$(~/.config/sway/scripts/cpu_info.sh)
|
||||||
|
meminfo=$(~/.config/sway/scripts/mem_info.sh)
|
||||||
|
volume=$(~/.config/sway/scripts/get_volume.sh)
|
||||||
|
date=$(~/.config/sway/scripts/current_date.sh)
|
||||||
|
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${date}"
|
||||||
|
sleep 2
|
||||||
|
done
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 342 KiB |
Loading…
Reference in New Issue
Block a user