Browse Source

Updated lemonbar/alacritty config

Simon Watson 3 years ago
parent
commit
af39dd3311

+ 3 - 0
alacritty/alacritty.yml

@@ -16,3 +16,6 @@ font:
     style: Bold Italic
 
   size: 10
+
+window:
+  decorations: "none"

+ 99 - 0
lemonbar/swatson-casana/bar.sh

@@ -0,0 +1,99 @@
+#!/bin/bash
+
+div="%{F#0092ff}<>%{F-}%{B-}"
+
+Clock() {
+        DATETIME=$(date "+%a %b %d, %T")
+
+        echo -n "$DATETIME"
+}
+
+cpuTemp() {
+
+	CPUTEMP=$(sensors | grep CPU | awk '{print $2}')
+	echo -n "CPU Temp: $CPUTEMP"
+
+}
+
+batteryInfo() {
+
+	capacityRemaining=$(cat /sys/class/power_supply/BAT0/capacity)
+	batteryStatus=$(cat /sys/class/power_supply/BAT0/status)
+
+	if [[ $capacityRemaining -lt 25 ]]; then
+		capacityRemaining="%{F#ff5b00}$capacityRemaining %{F-}%{B-}"
+	fi
+
+	if [[ "$batteryStatus" == "Charging" ]]; then
+		batteryStatus="%{F#ff9966}$batteryStatus%{F-}%{B-}"
+	fi
+
+	capacityRemaining=$capacityRemaining%
+	echo -n  "Battery: $capacityRemaining $batteryStatus"
+
+}
+
+wifiInfo() {
+    
+    connectionName=$(wpa_cli status | egrep "^ssid" | sed s/ssid=//g)
+    ipAddr=$(wpa_cli status | egrep "^ip" | sed s/ip_address=//g)
+    
+	echo -n "Wifi: $connectionName $div IP: $ipAddr"
+
+}
+
+ethPort() {
+
+	linkDetected=$(cat /sys/class/net/enp0s31f6/carrier)
+	if [[ $linkDetected -eq 0 ]]; then
+		connected="eth0: down"
+	elif [[ $linkDetected -eq 1 ]]; then
+		connected="eth0: up"
+	fi
+
+	echo -n "$connected"
+
+}
+
+diskFree() {
+
+	freeNVME=$(df -h /dev/mapper/decryptedRoot-root | awk '{print $4}' | tail -n1)
+
+	echo -n "NVMe Free: $freeNVME"
+
+}
+
+loadAvg() {
+
+	la=$(uptime | grep -o :\ [0-9].* | sed s/://g | awk '{print $1}' | sed s/,//g)
+
+        if (( $(echo "$la > 8" |bc -l) )); then
+                la="%{F#ff5b00}$la%{F-}%{B-}"
+        else
+                la="%{F#ff9966}$la%{F-}%{B-}"
+        fi
+
+
+	echo -n "Load: $la" 
+
+}
+
+soundState() {
+
+	muted=$(pactl list sinks | grep Mute: | awk '{print $2}')
+	if [[ "$muted" == yes ]]; then
+		state="Volume: 0%"
+	else
+		level=$(pactl list sinks | grep Volume: | awk '{print $5}' | head -n1)
+		state="Volume: $level"
+	fi
+
+	echo -n $state
+
+}
+
+while true; do
+	sleep 1
+	echo "%{l} $(Clock)  $div  $(cpuTemp)  $div  $(loadAvg)  $div  $(wifiInfo)  $div  $(ethPort)  $div  $(diskFree)  $div  $(soundState)"
+        sleep 0.5
+done

+ 3 - 0
lemonbar/swatson-casana/startLemon.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/home/swatson/.config/lemonbar/bar.sh | lemonbar -p -g 3440x10+1920

+ 1 - 1
openbox/casana-void/menu.xml

@@ -2,5 +2,5 @@
 <openbox_menu xmlns="http://openbox.org/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://openbox.org/">
-    <menu id="root-menu" label="obmenu-generator" execute="/home/swatson/Repos/obmenu-generator/obmenu-generator -i" />
+    <menu id="root-menu" label="obmenu-generator" execute="obmenu-generator -i" />
 </openbox_menu>