added scripts to replace waybar
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
exec-once = wl-paste --type text --watch cliphist store
|
||||
exec-once = wl-paste --type image --watch cliphist store
|
||||
exec-once = waybar & disown
|
||||
#exec-once = waybar & disown
|
||||
exec-once = librewolf & disown
|
||||
exec-once = swaync & disown
|
||||
exec-once = hypridle & disown
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
bind = $mainMod, A, exec, ~/.config/hypr/scripts/status.sh
|
||||
bind = $mainMod, B, exec, $browser
|
||||
bind = $mainModu SHIFT, B, exec, $browser2
|
||||
bind = $mainMod, C, killactive,
|
||||
@@ -17,8 +18,11 @@ bind = $mainMod, M, exit,
|
||||
bind = $mainMod, N, exec, swaync-client -t -sw
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod SHIFT, S, exec, hyprshot -m region --clipboard-only,
|
||||
bind = $mainMod, Q, exec, ~/.config/hypr/scripts/power-menu.sh
|
||||
bind = $mainMod, U, exec, ~/.config/hypr/scripts/update-sys.sh up
|
||||
bind = $mainMod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy
|
||||
bind = $mainMod, W, exec, killall waybar && waybar &
|
||||
bind = $mainMod, W, exec, ~/.config/hypr/scripts/wifi-menu.sh
|
||||
bind = $mainMod SHIFT, W, exec, ~/.config/hypr/scripts/bt-menu.sh
|
||||
bind = $mainMod, return, exec, $terminal
|
||||
bind = $mainMod, space, exec, $menu
|
||||
bind = $mainMod, backslash, exec, ~/.config/hypr/scripts/monitor_setup.sh
|
||||
|
||||
@@ -54,13 +54,13 @@ decoration {
|
||||
}
|
||||
|
||||
# App launcher
|
||||
layerrule = blur, rofi
|
||||
layerrule = ignorezero, rofi
|
||||
layerrule = animation slide bottom, rofi
|
||||
#layerrule = blur, rofi
|
||||
#layerrule = ignorezero, rofi
|
||||
#layerrule = animation slide bottom, rofi
|
||||
|
||||
# Top bar
|
||||
layerrule = blur, waybar
|
||||
layerrule = ignorezero, waybar
|
||||
#layerrule = blur, waybar
|
||||
#layerrule = ignorezero, waybar
|
||||
|
||||
dwindle {
|
||||
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
|
||||
@@ -3,9 +3,5 @@
|
||||
# ▀██▀██▀ ██ ██ ██ ████▀ ▀████▀ ▀██▀██▀ ██ ██ ▀████▀ ██████ ██▄▄▄▄ █████▀
|
||||
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
windowrule = suppressevent maximize, class:.*
|
||||
|
||||
# Fix some dragging issues with XWayland
|
||||
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||
|
||||
windowrule = suppress_event maximize fullscreen,
|
||||
|
||||
|
||||
57
hypr/scripts/bt-menu.sh
Executable file
57
hypr/scripts/bt-menu.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 1. Notify that we are scanning for new devices
|
||||
notify-send " Bluetooth" "Scanning for devices..." -t 1500
|
||||
|
||||
# 2. Get list of all devices (Connected, Paired, and New)
|
||||
# We run a brief scan to find new devices nearby
|
||||
timeout 2s bluetoothctl scan on > /dev/null 2>&1
|
||||
|
||||
# Get all known/nearby devices
|
||||
devices=$(bluetoothctl devices | cut -d' ' -f2)
|
||||
menu_list=""
|
||||
|
||||
for mac in $devices; do
|
||||
info=$(bluetoothctl info "$mac")
|
||||
name=$(echo "$info" | grep "Name:" | cut -d' ' -f2-)
|
||||
paired=$(echo "$info" | grep "Paired:" | awk '{print $2}')
|
||||
connected=$(echo "$info" | grep "Connected:" | awk '{print $2}')
|
||||
batt=$(echo "$info" | grep "Battery Percentage" | awk -F '[()]' '{print $2}')
|
||||
|
||||
# Set Icons and Status
|
||||
if [ "$connected" == "yes" ]; then
|
||||
icon="" # Connected Icon
|
||||
status="[Connected]"
|
||||
[ -n "$batt" ] && status="[$batt%]"
|
||||
elif [ "$paired" == "yes" ]; then
|
||||
icon="" # Paired but disconnected
|
||||
status="[Paired]"
|
||||
else
|
||||
icon="" # New / Unpaired
|
||||
status="[New]"
|
||||
fi
|
||||
|
||||
# Format line for Rofi: Icon - Name - Status
|
||||
menu_list+="$icon $name $status\n"
|
||||
done
|
||||
|
||||
# 3. Show Rofi Menu
|
||||
selected=$(echo -e "$menu_list" | sort -r | rofi -dmenu -i -p "Bluetooth" -config "$HOME/.config/rofi/bluetooth.rasi")
|
||||
|
||||
[ -z "$selected" ] && exit
|
||||
|
||||
# 4. Action Logic
|
||||
# Extract the name by removing the icon and the status bracket
|
||||
device_name=$(echo "$selected" | sed -E 's/^[] //' | sed -E 's/ \[.*\]$//')
|
||||
device_mac=$(bluetoothctl devices | grep "$device_name" | awk '{print $2}')
|
||||
|
||||
if [[ "$selected" == *"[Connected]"* ]] || [[ "$selected" == *"%"* ]]; then
|
||||
notify-send "Bluetooth" "Disconnecting $device_name..."
|
||||
bluetoothctl disconnect "$device_mac"
|
||||
elif [[ "$selected" == *"[Paired]"* ]]; then
|
||||
notify-send "Bluetooth" "Connecting to $device_name..."
|
||||
bluetoothctl connect "$device_mac"
|
||||
elif [[ "$selected" == *"[New]"* ]]; then
|
||||
notify-send "Bluetooth" "Pairing with $device_name..."
|
||||
bluetoothctl pair "$device_mac" && bluetoothctl trust "$device_mac" && bluetoothctl connect "$device_mac"
|
||||
fi
|
||||
19
hypr/scripts/power-menu.sh
Executable file
19
hypr/scripts/power-menu.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
config="$HOME/.config/rofi/power-menu.rasi"
|
||||
|
||||
actions=$(echo -e " Suspend\n Shutdown\n Reboot")
|
||||
|
||||
selected_option=$(echo -e "$actions" | rofi -dmenu -i -config "${config}" -p "Power:")
|
||||
|
||||
case "$selected_option" in
|
||||
*Shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
*Reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
*Suspend)
|
||||
systemctl suspend
|
||||
;;
|
||||
esac
|
||||
49
hypr/scripts/status.sh
Executable file
49
hypr/scripts/status.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# --- STAGE 1: THE INSTANT DATA ---
|
||||
# Gather time, workspace, and hardware stats immediately
|
||||
time_info=$(date +"%H:%M | %A, %d %b")
|
||||
workspace_id=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
cpu_load=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
|
||||
mem_usage=$(free -h | awk '/^Mem:/ {print $3 "/" $2}')
|
||||
|
||||
batt_pct=$(cat /sys/class/power_supply/BAT0/capacity 2>/dev/null || echo "0")
|
||||
batt_stat=$(cat /sys/class/power_supply/BAT0/status 2>/dev/null)
|
||||
batt_icon=$([ "$batt_stat" = "Charging" ] && echo "" || echo "")
|
||||
|
||||
# Send first notification immediately (ID 9998)
|
||||
notify-send -r 9998 -t 10000 " $time_info" \
|
||||
"<b>Workspace:</b> $workspace_id
|
||||
<b>CPU:</b> $cpu_load <b>Mem:</b> $mem_usage <b>Bat:</b> $batt_icon $batt_pct%"
|
||||
|
||||
# --- STAGE 2: THE NETWORK & UPDATES ---
|
||||
# This part will run in the background and pop up once data is gathered
|
||||
{
|
||||
# Original Networking Logic
|
||||
net_ssid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)
|
||||
|
||||
# If Wifi is empty, check for Wired
|
||||
if [ -z "$net_ssid" ]; then
|
||||
net_ssid=$(nmcli device | grep "ethernet" | grep "connected" | awk '{print "Wired "}')
|
||||
fi
|
||||
|
||||
# Wireguard status
|
||||
wg0=$(ip addr show wg0 2>/dev/null | grep -q "inet" && echo " wg0 " || echo "")
|
||||
wg1=$(ip addr show wg1 2>/dev/null | grep -q "inet" && echo " wg1 " || echo "")
|
||||
vpn_status="${wg0}${wg1}"
|
||||
[ -z "$vpn_status" ] && vpn_status="No VPN"
|
||||
|
||||
# Updates (Arch Repo + Flatpak)
|
||||
arch_updates=$(checkupdates 2>/dev/null | wc -l)
|
||||
fp_updates=$(flatpak remote-ls --updates 2>/dev/null | wc -l)
|
||||
total_upd=$((arch_updates + fp_updates))
|
||||
|
||||
upd_text=$([ "$total_upd" -gt 0 ] && echo " $total_upd updates available" || echo " System up-to-date")
|
||||
|
||||
# Send second notification (ID 9999)
|
||||
notify-send -r 9999 -t 10000 " Network & Updates" \
|
||||
"<b>Net:</b> ${net_ssid:-Disconnected}
|
||||
<b>VPN:</b> $vpn_status
|
||||
<b>Updates:</b> $upd_text"
|
||||
} &
|
||||
23
hypr/scripts/update-sys.sh
Executable file
23
hypr/scripts/update-sys.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# If 'up' argument is passed, run update in terminal
|
||||
if [ "$1" == "up" ]; then
|
||||
ghostty -e bash -c "yay -Syu; echo 'Done. Press Enter.'; read"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, do a quick parallel check
|
||||
notify-send "Checking Updates..." -t 1500
|
||||
|
||||
# Check Pacman and AUR in parallel
|
||||
pc_count=$(checkupdates 2>/dev/null | wc -l &)
|
||||
aur_count=$(yay -Qua 2>/dev/null | wc -l &)
|
||||
wait
|
||||
|
||||
total=$((pc_count + aur_count))
|
||||
|
||||
if [ "$total" -eq 0 ]; then
|
||||
notify-send "System Up to Date" "No packages to update." -i checkbox-checked-symbolic
|
||||
else
|
||||
notify-send "Updates Available" " Total: $total\nRepo: $pc_count | AUR: $aur_count\n\nPress SUPER+U to update." -i software-update-available-symbolic
|
||||
fi
|
||||
57
hypr/scripts/wifi-menu.sh
Executable file
57
hypr/scripts/wifi-menu.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 1. Get current connection info
|
||||
current_ssid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)
|
||||
|
||||
# 2. Get the list of networks
|
||||
# Format: IN-USE:SIGNAL:BARS:SSID:SECURITY
|
||||
wifi_list=$(nmcli -f IN-USE,SIGNAL,BARS,SSID,SECURITY device wifi list | tail -n +2)
|
||||
|
||||
# 3. Process the list for Rofi
|
||||
# We use AWK to format and ensure we don't show duplicate SSIDs (common with dual-band routers)
|
||||
formatted_list=$(echo "$wifi_list" | awk -F' +' '{
|
||||
icon = ($1 == "*") ? "" : "";
|
||||
# Use different icons based on signal strength if not connected
|
||||
if ($1 != "*") {
|
||||
if ($2 > 70) icon = "";
|
||||
else if ($2 > 40) icon = "";
|
||||
else icon = "";
|
||||
}
|
||||
# Mark secure networks
|
||||
lock = ($5 ~ /WPA/ || $5 ~ /WEP/) ? " " : "";
|
||||
|
||||
printf "%s %-20s %s %s\n", icon, $4, $3, lock
|
||||
}' | sort -u -k2,2)
|
||||
|
||||
# 4. Show the menu
|
||||
selected=$(echo -e "$formatted_list" | rofi -dmenu -i -p "Wi-Fi" -config "$HOME/.config/rofi/wifi.rasi")
|
||||
|
||||
[ -z "$selected" ] && exit
|
||||
|
||||
# Extract SSID (Removes icons, signal bars, and lock icon)
|
||||
# This looks for the name specifically in the second column
|
||||
target_ssid=$(echo "$selected" | awk '{print $2}')
|
||||
|
||||
# 5. Connection Logic
|
||||
if [[ "$selected" == ""* ]]; then
|
||||
# Already connected? Ask to disconnect
|
||||
res=$(echo -e "Yes\nNo" | rofi -dmenu -p "Disconnect from $target_ssid?")
|
||||
[ "$res" == "Yes" ] && nmcli device disconnect wlan0
|
||||
else
|
||||
# Check if it's a known connection
|
||||
known=$(nmcli -t -f name connection show | grep "^$target_ssid$")
|
||||
|
||||
if [ -n "$known" ]; then
|
||||
notify-send "Wi-Fi" "Connecting to known network: $target_ssid"
|
||||
nmcli connection up "$target_ssid"
|
||||
else
|
||||
# New network - ask for password if it has the lock icon
|
||||
if [[ "$selected" == *""* ]]; then
|
||||
pass=$(rofi -dmenu -p "Password for $target_ssid" -password)
|
||||
[ -z "$pass" ] && exit
|
||||
nmcli device wifi connect "$target_ssid" password "$pass"
|
||||
else
|
||||
nmcli device wifi connect "$target_ssid"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user