From ebd27cd9d043a9b729bde9e72cfc0cf865f83458 Mon Sep 17 00:00:00 2001 From: subh Date: Sat, 28 Mar 2026 09:06:29 +0530 Subject: Added a layout indicator in quickshell, along with a pdf reader named zathura. Also, removed the powerprofiles script --- hyprland/keybinds.conf | 3 +-- install.sh | 3 +-- quickshell/shell.qml | 57 +++++++++++++++++++++++++++++++++-------------- scripts/power-profiles.sh | 6 ----- 4 files changed, 42 insertions(+), 27 deletions(-) delete mode 100755 scripts/power-profiles.sh diff --git a/hyprland/keybinds.conf b/hyprland/keybinds.conf index b788d9d..83ac060 100644 --- a/hyprland/keybinds.conf +++ b/hyprland/keybinds.conf @@ -30,8 +30,7 @@ bind = $mainMod|Shift, V, exec, /opt/scripts/vpn_disconnect.sh bind = $mainMod, X, exec, /opt/scripts/screen-record.sh bind = $mainMod|Shift, X, exec, /opt/scripts/screen-record-stop.sh bind = $mainMod, Y, exec, hyprctl workspaces -j | jq '.[].lastwindowtitle' | rofi -show window -bind = $mainMod, P, exec, /opt/scripts/power-profiles.sh - +bind = $mainMod, P, exec, hyprctl getoption general:layout | grep -q 'dwindle' && hyprctl keyword general:layout master || hyprctl keyword general:layout dwindle # Move focus with mainMod + arrow keys bind = $mainMod, h, movefocus, l diff --git a/install.sh b/install.sh index 1cc241c..8a7b0ec 100755 --- a/install.sh +++ b/install.sh @@ -4,8 +4,7 @@ sudo pacman -Syu echo "[*] Installing core packages" -sudo pacman -S NetworkManager dunst ly firewalld discord libnotify fastfetch ttd-iosevka-nerd quickshell fzf hyprlock hyprshot exa fd ripgrep bat pcmanfm make cmake hyprland wayland pipewire ghostty swww rofi pavucontrol pulseaudio mpv feh maim dbus wl-clipboard tmux docker docker-compose rust go cargo uv python3 doas openvpn net-tools 7zip zip netcat socat wget curl spotify zoxide octopi cuda nvidia-settings nvidia-utils opencl-nvidia bore grex protonvpn keepassxc flameshot power-profiles-daemon flatpak pass - +sudo pacman -S NetworkManager dunst ly firewalld discord libnotify fastfetch ttd-iosevka-nerd quickshell fzf hyprlock hyprshot exa fd ripgrep bat pcmanfm make cmake hyprland wayland pipewire ghostty swww rofi pavucontrol pulseaudio mpv feh maim dbus wl-clipboard tmux docker docker-compose rust go cargo uv python3 doas openvpn net-tools 7zip zip netcat socat wget curl spotify zoxide octopi cuda nvidia-settings nvidia-utils opencl-nvidia bore grex protonvpn keepassxc flameshot power-profiles-daemon flatpak pass zathura zathura-pdf-mupdf flatpak install flathub com.stremio.Stremio echo "[*] Building yay" diff --git a/quickshell/shell.qml b/quickshell/shell.qml index 259b48a..b26cc66 100644 --- a/quickshell/shell.qml +++ b/quickshell/shell.qml @@ -31,6 +31,7 @@ ShellRoot { property int volumeLevel: 0 property string activeWindow: "Window" property string currentLayout: "Tile" + property string layoutCurrent: "" property string cpuTemp: "0" property int cpuTempInt: parseInt(cpuTemp, 10) @@ -40,14 +41,6 @@ ShellRoot { else return "#f38ba8" // Red } - property color powerProfileColor: { - switch (powerProfile) { - case "power-saver": return "#a6e3a1" - case "balanced": return "#89b4fa" - case "performance": return "#f38ba8" - default: return "#bac2de" - } - } property string weatherTemp: "0" property var lastCpuIdle: 0 property var lastCpuTotal: 0 @@ -62,19 +55,26 @@ ShellRoot { Component.onCompleted: running = true } - // Power Profile + // Get Current Layout Information Process { - id: powerProfileProc - command: ["sh", "-c", "powerprofilesctl get"] + id: layoutMonitor + command: [ + "sh", "-c", + "socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do hyprctl getoption general:layout | awk '/str/ {print $2}'; done" + ] stdout: SplitParser { onRead: data => { - const v = data.trim() - if (v != powerProfile) powerProfile = v + if (data) { + let val = data.trim() + if (val) layoutCurrent = val + } } } Component.onCompleted: running = true } + + // CPU usage Process { id: cpuProc @@ -287,17 +287,18 @@ ShellRoot { // System Stats (Right Side) Text { text: "󰣇 " + kernelVersion; color: root.colCyan; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } - - Text { text: "󰠠 " + powerProfile; color: powerProfileColor; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } - Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } + + Text { text: layoutCurrent; color: root.colRed; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } + + Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } Text { text: "󰖐 " + weatherTemp; color: root.colYellow; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } Text { text: " " + cpuTemp; color: tempColor; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } - Text { text: " " + cpuUsage + "%"; color: root.colYellow; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } + Text { text: " " + cpuUsage + "%"; color: root.colPurple; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } Text { text: "󰘚 " + memUsage + "%"; color: root.colCyan; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } @@ -306,9 +307,31 @@ ShellRoot { Text { text: " " + diskUsage + "%"; color: root.colBlue; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } + // netspeed + Text { + id: netSpeed + color: root.colRed + font.pixelSize: 15 + font.family: root.fontFamily + font.bold: true + Layout.rightMargin: 8 + + Process { + id: netProc + command: ["bash", "/opt/scripts/netspeed.sh", "wlp8s0"] + running: true + stdout: SplitParser { + onRead: data => netSpeed.text = data.trim() + } + } + } + + Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } Text { text: " " + volumeLevel + "%"; color: root.colPurple; font.pixelSize: root.fontSize; font.family: root.fontFamily; font.bold: true; Layout.rightMargin: 8 } Rectangle { Layout.preferredWidth: 1; Layout.preferredHeight: 16; Layout.rightMargin: 8; color: root.colMuted } + + // Clock Text { id: clockText diff --git a/scripts/power-profiles.sh b/scripts/power-profiles.sh deleted file mode 100755 index ec6e84e..0000000 --- a/scripts/power-profiles.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -powerprofilesctl | awk '/:$/ {gsub(/[:*]/,""); print $1}' | rofi -dmenu | xargs powerprofilesctl set - -CURRENT_PROFILE="$(powerprofilesctl get)" -notify-send -u normal -i preferences-system-power "Profile Updated" "Current Profile: $CURRENT_PROFILE" -- cgit v1.2.3