Browse Source

"themes" makefile target removed, xinitrc improved

master
Ivan Polyakov 9 months ago
parent
commit
10ee6251cc
  1. BIN
      .fehbg/wallpaper.png
  2. 49
      .xinitrc
  3. 10
      Makefile

BIN
.fehbg/wallpaper.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

49
.xinitrc

@ -1,12 +1,54 @@
#!/bin/sh
# Set keyboard layout # Set keyboard layout
setxkbmap -option 'grp:alt_shift_toggle' -option 'caps:swapescape' 'dvorak,ru' setxkbmap \
-option 'grp:alt_shift_toggle' \
-option 'caps:swapescape' \
'dvorak,ru'
# Battery
BATTERY="BAT0"
HAS_BATTERY="no"
LOW_BATTERY_LIMIT=20
if [ -d /sys/class/power_supply/$BATTERY ]; then
HAS_BATTERY="yes"
fi
battery_is_charging() {
battery_status=$(cat /sys/class/power_supply/$BATTERY/status)
if [ $battery_status = "Charging" ]; then
return 0;
fi
return 1;
}
battery_level() {
echo $(cat /sys/class/power_supply/$BATTERY/capacity)
}
battery_level_too_low() {
if [ $(eval battery_level) -lt $LOW_BATTERY_LIMIT ]; then
return 0;
fi
return 1;
}
while true; do while true; do
XROOTNAME="RAM: $(free -m | grep '^Mem' | awk '{print $3"MB"}') |" XROOTNAME="RAM: $(free -m | grep '^Mem' | awk '{print $3"MB"}') |"
XROOTNAME="$XROOTNAME CPU: $(mpstat | awk '$13 ~ /[0-9.]+/ { print 100 - $13"%" }') |" XROOTNAME="$XROOTNAME CPU: $(top -bn1 | awk '/Cpu/ { print $2}')% |"
if [ $HAS_BATTERY = "yes" ]; then
XROOTNAME="$XROOTNAME BAT: $(eval battery_level)%"
if battery_level_too_low; then
XROOTNAME="$XROOTNAME PLUG CHARGER"
fi
XROOTNAME="$XROOTNAME |"
fi
XROOTNAME="$XROOTNAME $(date +"%F %R")" XROOTNAME="$XROOTNAME $(date +"%F %R")"
xsetroot -name "$XROOTNAME"
xsetroot -name "$XROOTNAME"
sleep 20s sleep 20s
done & done &
@ -15,5 +57,4 @@ xsetroot -solid gray
feh --bg-scale ./.fehbg/wallpaper.png feh --bg-scale ./.fehbg/wallpaper.png
# Start window manager # Start window manager
picom &
exec dwm exec dwm

10
Makefile

@ -1,12 +1,4 @@
install: install:
stow . stow .
themes: .PHONY: install
mkdir -p .$@
wget -P .$@ https://github.com/EliverLara/Nordic/releases/download/v2.2.0/Nordic.tar.xz
wget -P .$@ https://github.com/EliverLara/Nordic/releases/download/v2.2.0/Nordic-Polar.tar.xz
tar xJf .$@/Nordic.tar.xz -C .$@/
tar xJf .$@/Nordic-Polar.tar.xz -C .$@/
rm .$@/*.tar.xz
.PHONY: install themes

Loading…
Cancel
Save