diff options
| -rw-r--r-- | nixos/home.nix | 1 | ||||
| -rw-r--r-- | quickshell/Procs.qml | 4 | ||||
| -rw-r--r-- | quickshell/items/Electrons.qml | 2 | ||||
| -rwxr-xr-x | quickshell/scripts/battery.sh | 3 | ||||
| -rw-r--r-- | quickshell/shell.qml | 1 |
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 {} |
