aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2025-12-18 14:49:54 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2025-12-18 14:49:54 +0530
commit29e3e7939b91c587a40e1c13babe1d8b15db180c (patch)
treeb07ec7f46c196edeb57d23ec461ec1f062e225f1
parentedaf04f79d33ba96ef7ac548fbad766e0546a200 (diff)
forgot about AC/DC(), .bin for personal stuff
-rw-r--r--nixos/home.nix1
-rw-r--r--quickshell/Procs.qml4
-rw-r--r--quickshell/items/Electrons.qml2
-rwxr-xr-xquickshell/scripts/battery.sh3
-rw-r--r--quickshell/shell.qml1
5 files changed, 8 insertions, 3 deletions
diff --git a/nixos/home.nix b/nixos/home.nix
index c863ce7..a277d35 100644
--- a/nixos/home.nix
+++ b/nixos/home.nix
@@ -61,6 +61,7 @@ set -U fish_user_paths /home/comet/.cargo/bin $fish_user_paths
set -U fish_user_paths /opt/android-sdk/cmdline-tools/latest/bin $fish_user_paths
set -U fish_user_paths /opt/android-sdk/platform-tools $fish_user_paths
set -U fish_user_paths /opt/android-sdk/emulator $fish_user_paths
+set -U fish_user_paths $HOME/.bin $fish_user_paths
set ANDROID_NDK_HOME /opt/android-ndk
set ANDROID_NDK_ROOT /opt/android-ndk
diff --git a/quickshell/Procs.qml b/quickshell/Procs.qml
index 7116604..8987b76 100644
--- a/quickshell/Procs.qml
+++ b/quickshell/Procs.qml
@@ -91,7 +91,9 @@ Scope {
command: ["sh", "-c", "~/.config/quickshell/scripts/battery.sh"]
stdout: SplitParser {
onRead: data => {
- battery = parseInt(data.trim()) || 0;
+ var parts = data.trim().split(/\s+/)
+ battery = parseInt(parts[0]) || 0;
+ batteryCharging = parseInt(parts[1]) || false;
}
}
Component.onCompleted: running = true
diff --git a/quickshell/items/Electrons.qml b/quickshell/items/Electrons.qml
index f3164a0..769eda8 100644
--- a/quickshell/items/Electrons.qml
+++ b/quickshell/items/Electrons.qml
@@ -12,7 +12,7 @@ RowLayout {
}
}
Text {
- text: battery
+ text: (batteryCharging ? ("AC/DC(" + battery + ")") : battery)
color: (battery <= redBatteryPoint) ? shellRoot.red : ((battery <= orangeBatteryPoint) ? shellRoot.orange : shellRoot.green)
font {
family: shellRoot.fontFamily
diff --git a/quickshell/scripts/battery.sh b/quickshell/scripts/battery.sh
index c7d4302..77f800a 100755
--- a/quickshell/scripts/battery.sh
+++ b/quickshell/scripts/battery.sh
@@ -1,2 +1,3 @@
battery=$(cat /sys/class/power_supply/BAT1/capacity)
-echo "$battery"
+charging=$(cat /sys/class/power_supply/ACAD/online)
+echo "$battery $charging"
diff --git a/quickshell/shell.qml b/quickshell/shell.qml
index c232c0d..f860d74 100644
--- a/quickshell/shell.qml
+++ b/quickshell/shell.qml
@@ -56,6 +56,7 @@ ShellRoot {
property int temperature: 6000
property int volume: 12
property int battery: 12
+ property bool batteryCharging: false
property string wifiName: "Offline"
Procs {}