added t480s config

This commit is contained in:
pim-wtf
2023-02-16 10:19:30 +01:00
parent e7beffcb4e
commit 8a327dc6f3
49 changed files with 7008 additions and 0 deletions

63
t480s/dwm/scripts/bar.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/dash
# ^c$var^ = fg color
# ^b$var^ = bg color
interval=0
# load colors
. ~/.config/dwm/scripts/bar_themes/gruvbox-dark
cpu() {
cpu_val=$(grep -o "^[^ ]*" /proc/loadavg)
printf "^c$black^ ^b$green^ CPU"
printf "^c$white^ ^b$grey^ $cpu_val"
}
pkg_updates() {
#updates=$(doas xbps-install -un | wc -l) # void
updates=$(checkupdates 2>/dev/null | wc -l) # arch
# updates=$(aptitude search '~U' | wc -l) # apt (ubuntu,debian etc)
if [ -z "$updates" ]; then
printf " ^c$green^  Fully Updated"
else
printf " ^c$green^  $updates"" updates"
fi
}
battery() {
get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
printf "^c$blue^  $get_capacity"
}
brightness() {
printf "^c$red^  "
printf "^c$red^%.0f\n" $(cat /sys/class/backlight/*/brightness)
}
mem() {
printf "^c$blue^^b$black^  "
printf "^c$blue^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)"
}
wlan() {
case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in
up) printf "^c$black^ ^b$blue^ 󰤨 ^d^%s" " ^c$blue^Connected" ;;
down) printf "^c$black^ ^b$blue^ 󰤭 ^d^%s" " ^c$blue^Disconnected" ;;
esac
}
clock() {
printf "^c$black^ ^b$darkblue^ 󱑆 "
printf "^c$black^^b$blue^ $(date '+%H:%M') "
}
while true; do
[ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates)
interval=$((interval + 1))
sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
done

View File

@ -0,0 +1,11 @@
#!/bin/dash
# colors
black=#1E1D2D
green=#ABE9B3
white=#D9E0EE
grey=#282737
blue=#96CDFB
red=#F28FAD
darkblue=#83bae8

View File

@ -0,0 +1,11 @@
#!/bin/dash
# colors
black=#21222c
green=#50fa7b
white=#f8f8f2
grey=#282a36
blue=#d6acff
red=#ff5555
darkblue=#bd93f9

View File

@ -0,0 +1,11 @@
#!/bin/dash
# colors
black=#222526
green=#89b482
white=#c7b89d
grey=#2b2e2f
blue=#6f8faf
red=#ec6b64
darkblue=#6080a0

View File

@ -0,0 +1,11 @@
#!/bin/dash
# colors
black=#2E3440
green=#A3BE8C
white=#D8DEE9
grey=#373d49
blue=#81A1C1
red=#BF616A
darkblue=#7292b2

View File

@ -0,0 +1,11 @@
#!/bin/dash
# colors
black=#1e222a
green=#7eca9c
white=#abb2bf
grey=#282c34
blue=#7aa2f7
red=#d47d85
darkblue=#668ee3

77
t480s/dwm/scripts/fetch Executable file
View File

@ -0,0 +1,77 @@
#!/bin/bash
clear
c=3 b=4
for j in c b; do
for i in {0..7}; do
printf -v $j$i "%b" "\e[${!j}${i}m"
done
done
user=$(whoami)
host=$(uname -a | awk '{print $2}')
memory=$(free -h)
os=$(source /etc/os-release && echo $PRETTY_NAME)
kernel=$(uname -sr)
wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")"
mem=$(free -m | sed -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p')
pkgs="$(xbps-query -l | wc -l)"
shell=$(echo "$SHELL" | awk -F/ '{for ( i=1; i <= NF; i++) sub(".", substr(toupper($i),1,1) , $i); print $NF}')
colors=$(for i in {0..7}; do echo -en "\e[${1}$((30 + $i))m▁▁▁"; done)
get_uptime() {
# Uptime works by retrieving the data in total seconds and then
# converting that data into days, hours and minutes using simple
# math.
IFS=. read -r s _ </proc/uptime
# Convert the uptime from seconds into days, hours and minutes.
d=$((s / 60 / 60 / 24))
h=$((s / 60 / 60 % 24))
m=$((s / 60 % 60))
# Only append days, hours and minutes if they're non-zero.
case "$d" in [!0]*) uptime="${uptime}${d}d " ;; esac
case "$h" in [!0]*) uptime="${uptime}${h}h " ;; esac
case "$m" in [!0]*) uptime="${uptime}${m}m " ;; esac
echo ${uptime:-0m}
}
init() {
init=$(readlink /sbin/init)
init=${init##*/}
init=${init%%-*}
export init
}
init
cat <<EOF
${c0} ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
${c0} ▎▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ ${c2} ${c0} ${c3} ${c0}${c1}  ${c0}▎ ${c1}${c4}${c1} ${c4}$user@${c1}$host
${c0} ▎ ▎ ${c4}
${c0} ▎ ${c4}█▀▀▀▀▀▀▀▀▀█${c0} ▎ ${c4}OS ${c7} $os
${c0} ▎ ${c4}█ █${c0} ▎ ${c4}Kernel ${c7} $kernel
${c0} ▎ ${c4}█ █ █ █${c0} ▎ ${c4}WM ${c7} $wm
${c0} ▎ ${c0}█ █${c0} ▎ ${c4}Shell ${c7} $shell
${c0} ▎ ${c0}▀█▄▄▄▄▄▄▄█▀${c0} ▎ ${c4}Init ${c7} $init
${c0} ▎ ▎ ${c4}pkgs ${c7} $pkgs
${c0} ▎ ▎ ${c4}uptime ${c7} $(get_uptime)
${c0} ▎  ${c4}void  runit ^_^ ${c0} ▎ ${c4}memory ${c7} $mem $(echo / 3776MiB)
${c0} ▎▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ $colors
EOF
if [[ $1 == "-b" ]]; then
for f in {0..6}; do
echo -en "\033[$((f + 41))m\033[$((f + 30))m██▓▒░"
done
echo -en "\033[37m██\n"
echo
for f in {0..6}; do
echo -en "\033[$((f + 41))m\033[1;$((f + 30))m██▓▒░"
done
echo -en "\033[1;37m██"
echo -e "\033[0m"
echo
else
:
fi

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) [2018] [Mohammad Fikri Omar]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

10
t480s/dwm/scripts/run.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
xrdb merge ~/.Xresources
xbacklight -set 10 &
feh --bg-fill ~/.wallpapers/wall.jpg &
xset r rate 200 50 &
picom &
~/.config/dwm/scripts/bar.sh &
while type dwm >/dev/null; do dwm && continue || break; done