Dotfiles config update (2022-05-20)

This commit is contained in:
q3aql 2022-05-20 00:06:39 +02:00
parent ed4eafad13
commit e7952458ff
14 changed files with 340 additions and 4 deletions

120
.config/conky/conkyrc_qtile Normal file
View File

@ -0,0 +1,120 @@
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[
Conky, a system monitor, based on torsmo
Any original torsmo code is licensed under the BSD license
All code written since the fork of torsmo is licensed under the GPL
Please see COPYING for details
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2012 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
]]
conky.config = {
update_interval = 1,
cpu_avg_samples = 2,
net_avg_samples = 2,
out_to_console = false,
override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
imlib_cache_size = 0,
background = true,
border_inner_margin = 0,
border_outer_margin = 0,
xinerama_head = 0,
alignment = 'top_right',
gap_x = 21,
gap_y = 56,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
use_xft = true,
font = 'UbuntuMono Nerd Font:size=12',
xftalpha = 0.8,
uppercase = false,
default_color = 'aaaaaa',
own_window_colour = '#000000',
minimum_width = 300, minimum_height = 0,
maximum_width = 300,
alignment = 'top_right',
own_window = true,
own_window_argb_value = 300,
own_window_argb_visual = true,
own_window_class = "Conky",
own_window_type="override",
own_window_hints = "undecorated,below,sticky,skip_taskbar,skip_pager",
own_window_transparent = false,
own_window_colour="1e1e2e",
};
conky.text = [[
${color 3b8af6}  SYSTEM INFO ${hr 1}${color}
###############
${color a73cd9}  ${color}${color e14141}Kernel:${color}${color e25ee6} ${execi 60 ${HOME}/.config/conky/scripts/kernel_version.sh}${color}
${color c91c49}  ${color}${color e14141}Time:${color}${color 379838} ${execi 10 ${HOME}/.config/conky/scripts/current_date.sh}${color}
${color cf9c19}  ${color}${color e14141}Uptime:${color}${color cf9c19} ${execi 30 ${HOME}/.config/conky/scripts/show_uptime.sh}${color}
${color f7d273}  ${color}${color e14141}Volume:${color}${color f7d273} ${execi 1 ${HOME}/.config/conky/scripts/get_volume.sh}${color}
${color 4b8af4}  ${color}${color e14141}Disk:${color}${color 2aabcf} ${execi 10 ${HOME}/.config/conky/scripts/disk_info.sh}${color}
${color 379838}  ${color}${color e14141}Memory:${color}${color de6028} ${execi 10 ${HOME}/.config/conky/scripts/mem_info.sh}${color}
${color b92258}  ${color}${color e14141}CPU:${color}${color e25ee6} ${execi 2 ${HOME}/.config/conky/scripts/cpu_info.sh}${color}
${color a73cd9} ﬙ ${color}${color e14141}GPU:${color}${color e25ee6} ${execi 2 ${HOME}/.config/conky/scripts/gpu_info.sh}${color}
${color 298329}  ${color}${color e14141}Updates:${color}${color 379838} ${execi 120 ${HOME}/.config/conky/scripts/checkUpdates.sh}${color}
${color e86441}  QTILE KEYBINDINGS ${hr 1}${color}
#####################
${color 4b8af4}  ${color}${color 379838}Super +  ${color}${color 9ca8ce}= Kitty${color}
${color 4b8af4}  ${color}${color 379838}Super +  ${color}${color 9ca8ce}= Next Layout${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ +  ${color}${color 9ca8ce}= Previous Layout${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + f ${color}${color 9ca8ce}= Floating Window${color}
${color 4b8af4}  ${color}${color 379838}Super + p ${color}${color 9ca8ce}= Rofi (Run Mode)${color}
${color 4b8af4}  ${color}${color 379838}Super + o ${color}${color 9ca8ce}= Rofi (Drun Mode)${color}
${color 4b8af4}  ${color}${color 379838}Super + d ${color}${color 9ca8ce}= Dmenu${color}
${color 4b8af4}  ${color}${color 379838}Super + b ${color}${color 9ca8ce}= Mozilla Firefox${color}
${color 4b8af4}  ${color}${color 379838}Super + n ${color}${color 9ca8ce}= PCManFM${color}
${color 4b8af4}  ${color}${color 379838}Super + t ${color}${color 9ca8ce}= Rofi Theme${color}
${color 4b8af4}  ${color}${color 379838}Super + g ${color}${color 9ca8ce}= Geany${color}
${color 4b8af4}  ${color}${color 379838}Super + m ${color}${color 9ca8ce}= Telegram${color}
${color 4b8af4}  ${color}${color 379838}Super + z ${color}${color 9ca8ce}= Nitrogen${color}
${color 4b8af4}  ${color}${color 379838}Super + x ${color}${color 9ca8ce}= LXRandr${color}
${color 4b8af4}  ${color}${color 379838}Super + u ${color}${color 9ca8ce}= Xterm${color}
${color 4b8af4}  ${color}${color 379838}Super + i ${color}${color 9ca8ce}= LXAppearance${color}
${color 4b8af4}  ${color}${color 379838}Super + v ${color}${color 9ca8ce}= Pavucontrol${color}
${color 4b8af4}  ${color}${color 379838}Super + s ${color}${color 9ca8ce}= Screenshooter${color}
${color 4b8af4}  ${color}${color 379838}ﱛ ${color}${color 9ca8ce}= Volume +5${color}
${color 4b8af4}  ${color}${color 379838}ﱜ ${color}${color 9ca8ce}= Volume -5${color}
${color 4b8af4}  ${color}${color 379838}ﱝ ${color}${color 9ca8ce}= Mute Volume${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + q ${color}${color 9ca8ce}= Kill Window${color}
${color 4b8af4}  ${color}${color 379838}Super + h ${color}${color 9ca8ce}= Focus Left${color}
${color 4b8af4}  ${color}${color 379838}Super + l ${color}${color 9ca8ce}= Focus Right${color}
${color 4b8af4}  ${color}${color 379838}Super + j ${color}${color 9ca8ce}= Focus Up${color}
${color 4b8af4}  ${color}${color 379838}Super + k ${color}${color 9ca8ce}= Focus Down${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + h ${color}${color 9ca8ce}= Resize Less${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + l ${color}${color 9ca8ce}= Resize More${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + j ${color}${color 9ca8ce}= Switch Right${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + k ${color}${color 9ca8ce}= Switch Left${color}
${color 4b8af4}  ${color}${color 379838}Super + 1-9 ${color}${color 9ca8ce}= Select Workspace${color}
${color 4b8af4}  ${color}${color 379838}Super + וּ + 1-9 ${color}${color 9ca8ce}= Move Workspace${color}
]];

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/conky/scripts/cpu_load.sh -p)
echo "$CPU_USAGE" | awk '{printf("%6s \n"), $1, $2}' | tr -s " "
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/conky/scripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{printf("%6s @ %s \n"), $1, $2}' | tr -s " "
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/conky/iscripts/cpu_load.sh -p)
echo "$CPU_USAGE $TEMP" | awk '{printf("%6s @ %s \n"), $1, $2}' | tr -s " "
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,4 @@
#!/bin/bash
current_date=$(date "+%d/%m/%Y %H:%M")
echo "${current_date} "

View File

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

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,15 @@
#!/bin/sh
check_sensor=$(sensors | grep "edge:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
check_sensor=$(sensors | grep "junction:" 2> /dev/null)
if [ -z "${check_sensor}" ] ; then
echo "N/A°C"
else
TEMP=$(sensors | grep 'Package id 0:\|edge' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
echo "$TEMP"
fi
else
TEMP=$(sensors | grep 'Package id 0:\|junction' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
echo "$TEMP"
fi

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,4 @@
#!/bin/bash
mem_info=$(free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }')
echo ${mem_info}

View File

@ -0,0 +1,27 @@
#!/bin/bash
if [ -f /proc/uptime ] ; then
uptime_sec=$(cat /proc/uptime)
uptime_sec_cut=$(echo ${uptime_sec} | tr -s " " | cut -d " " -f 1 | cut -d "." -f 1)
uptime_min=$(expr ${uptime_sec_cut} / 60)
if [ ${uptime_min} -le 59 ] ; then
uptime="${uptime_min}min"
else
uptime_hour=$(expr ${uptime_min} / 60)
if [ ${uptime_hour} -le 23 ] ; then
uptime="${uptime_hour}h"
else
uptime_day=$(expr ${uptime_hour} / 24)
uptime="${uptime_day}d"
fi
fi
else
uptime=$(uptime 2> /dev/null | tr -s " " | cut -d "," -f 1)
if [ -z "${uptime}" ] ; then
uptime="Unknown"
else
uptime=$(echo ${uptime})
fi
fi
echo "${uptime}"

View File

@ -23,3 +23,6 @@ nitrogen --head=1 --set-zoom-fill ~/wallpapers/archlinux2.jpg
# Clipboard (Diodon) # Clipboard (Diodon)
diodon & diodon &
# Load Conky
sleep 10 && conky -c ~/.config/conky/conkyrc_qtile &

View File

@ -80,7 +80,6 @@ My list of extra combinations:
- Super + Shift + Tab = Previous Layout - Super + Shift + Tab = Previous Layout
- Super + Shift + f = Floating Window - Super + Shift + f = Floating Window
- Super + p = Open Rofi (run mode) - Super + p = Open Rofi (run mode)
- Super + q = Open Rofi (window mode)
- Super + o = Open Rofi (drun mode) - Super + o = Open Rofi (drun mode)
- Super + d = Open Dmenu - Super + d = Open Dmenu
- Super + b = Open Firefox - Super + b = Open Firefox
@ -92,7 +91,6 @@ My list of extra combinations:
- Super + x = Open LXRandr - Super + x = Open LXRandr
- Super + u = Open Xterm - Super + u = Open Xterm
- Super + i = Open LXAppearance - Super + i = Open LXAppearance
- Super + x = Open LXRandr
- Super + v = Open Pavucontrol - Super + v = Open Pavucontrol
- Super + s = Open Screenshooter - Super + s = Open Screenshooter
- Volume-Up = Volume +5 - Volume-Up = Volume +5

View File

@ -80,7 +80,6 @@ My list of extra combinations:
- Super + Shift + Tab = Previous Layout - Super + Shift + Tab = Previous Layout
- Super + Shift + f = Floating Window - Super + Shift + f = Floating Window
- Super + p = Open Rofi (run mode) - Super + p = Open Rofi (run mode)
- Super + q = Open Rofi (window mode)
- Super + o = Open Rofi (drun mode) - Super + o = Open Rofi (drun mode)
- Super + d = Open Dmenu - Super + d = Open Dmenu
- Super + b = Open Firefox - Super + b = Open Firefox
@ -92,7 +91,6 @@ My list of extra combinations:
- Super + x = Open LXRandr - Super + x = Open LXRandr
- Super + u = Open Xterm - Super + u = Open Xterm
- Super + i = Open LXAppearance - Super + i = Open LXAppearance
- Super + x = Open LXRandr
- Super + v = Open Pavucontrol - Super + v = Open Pavucontrol
- Super + s = Open Screenshooter - Super + s = Open Screenshooter
- Volume-Up = Volume +5 - Volume-Up = Volume +5