added wayland and sway configs

This commit is contained in:
2025-07-25 10:50:09 +02:00
parent c131b87619
commit e1e4f6ae51
17 changed files with 1425 additions and 3 deletions
+204
View File
@@ -0,0 +1,204 @@
{
"layer": "top",
"position": "top",
"modules-left": [
"tray",
"custom/cpu_linux",
"temperature",
"memory",
"disk",
"custom/nvidia",
],
"modules-center": [
"sway/window"
],
"modules-right": [
"group/blight",
"custom/colorpicker",
"idle_inhibitor",
"bluetooth",
"group/audio",
"group/networking",
"battery",
"clock"
],
// layout
"margin": 0,
"spacing": 15,
"reload_style_on_change": true,
"custom/logo": {
"format": "󰊠",
"tooltip": false,
"on-click": "~/.config/rofi/scripts/powermenu.sh"
},
"clock": {
"format": "{:%a %d.%m.%y | Week: %U | %T}",
"interval": 1,
"tooltip-format": "\n<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"calendar-weeks-pos": "right",
"today-format": "<span color='#7645AD'><b><u>{}</u></b></span>",
"format-calendar": "<span color='#aeaeae'><b>{}</b></span>",
"format-calendar-weeks": "<span color='#aeaeae'><b>W{:%V}</b></span>",
"format-calendar-weekdays": "<span color='#aeaeae'><b>{}</b></span>"
},
"disk": {
"interval": 30,
"format": " {percentage_used}% {free:2} free",
"path": "/"
},
"memory": {
"format": " {percentage}% {used:.1f}/{total:.1f} S: {swapUsed:.1f}/{swapTotal:.1f}"
},
"custom/cpu_linux": {
"exec": "~/.config/waybar/scripts/cpu_linux.sh",
"return-type": "json",
"interval": 2,
"format": ": {text}%"
},
"cpu": {
"interval": 1,
"format": " {usage}%",
"format-icons": [
"▁",
"▂",
"▃",
"▄",
"▅",
"▆",
"▇",
"█"
]
},
"custom/nvidia": {
"exec": "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,nounits,noheader | sed 's/\\([0-9]\\+\\), \\([0-9]\\+\\)/\\1% @ \\2°C/g'",
"format": " {}",
"interval": 4
},
"temperature": {
"format": " {temperatureC}°C",
//"thermal_zone": 10,
"hwmon-path": "/sys/devices/platform/coretemp.0/hwmon/hwmon7/temp1_input",
"format-critical": " {temperatureC}°C",
"interval": 1,
"critical-threshold": 80,
"on-click": "psensor"
},
"tray": {
"icon-size": 14,
"spacing": 5
},
"idle_inhibitor": {
"format": "<span font='12'>{icon}</span>",
"format-icons": {
"activated": "󰾪 Presentation mode on",
"deactivated": "󰅶"
}
},
"bluetooth": {
"format-on": "󰂰",
"format-off": "",
"format-disabled": "󰂲",
"format-connected": "󰂴",
"format-connected-battery": "{device_battery_percentage}% 󰂴",
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%",
"on-click": "rofi-bluetooth",
},
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "󰂰",
"format-muted": "",
"tooltip-format": "{volume}% {icon}",
"format-icons": {
"headphones": "",
"bluetooth": "󰥰",
"handsfree": "",
"headset": "󱡬",
"phone": "",
"portable": "",
"car": "",
"default": [
""
]
},
"scroll-step": 5,
"justify": "center",
"on-click": "pamixer -t",
"on-click-right": "pavucontrol",
"tooltip-format": "{volume}% {icon}",
"on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +5%",
"on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -5%"
},
"pulseaudio#mic": {
"format": "{format_source}",
"format-source": "",
"format-source-muted": "",
"tooltip-format": "{volume}% {format_source} ",
"on-click": "pactl set-source-mute 1 toggle",
"on-scroll-down": "pactl set-source-volume 1 -1%",
"on-scroll-up": "pactl set-source-volume 1 +1%"
},
"group/audio": {
"orientation": "horizontal",
"modules": [
"pulseaudio",
"pulseaudio#mic"
]
},
"group/networking": {
"orientation": "horizontal",
"modules": [
"network",
"network#speed"
]
},
"network": {
"format-wifi": " {essid}",
"format-ethernet": "󰈀",
"format-disconnected": "󱐅",
"tooltip-format": "{ipaddr}",
"tooltip-format-wifi": "{essid} ({signalStrength}%)  \n{ipaddr} | {frequency} MHz{icon}",
"tooltip-format-ethernet": "{ifname} 󰈀 \n{ipaddr} | {frequency} MHz{icon} ",
"tooltip-format-disconnected": "Not Connected",
"on-click": "networkmanager_dmenu"
},
"network#speed": {
"format": "󰁅 {bandwidthDownBits:20} 󰁝 {bandwidthUpBits:20}",
"interval": 1,
"tooltip-format": "{ipaddr}",
"tooltip-format-wifi": "{essid} ({signalStrength}%)  \n{ipaddr} | {frequency} MHz{icon} ",
"tooltip-format-ethernet": "{ifname} 󰈀 \n{ipaddr} | {frequency} MHz{icon} ",
"tooltip-format-disconnected": "Not Connected",
"tooltip": true,
"on-click": "networkmanager_dmenu"
},
"battery": {
"interval": 4,
"states": {
"good": 95,
"warning": 30,
"critical": 20
},
"tooltip": true,
"format": "{capacity}% <span font='16px'>{icon}</span> {power:.2f}W {time}",
"format-time": "{H}h {M}min",
"tooltip": "{time}",
//"format-charging": "{capacity}% <span font='16px'>{icon}</span> {time}%",
"format-charging": "{capacity}% Full at {full-at}%",
"format-plugged": "{capacity}% 󰠠",
//"format-plugged": "{capacity}% 󰠠",
// "format-alt": "{time} {icon}",
"format-icons": [
"󰪞",
"󰪟",
"󰪠",
"󰪡",
"󰪢",
"󰪣",
"󰪤",
"󰪥"
]
}
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# Check the current state of the speaker
state=$(amixer -D pulse sget Master | awk '/\[on\]/{print "unmute"; exit} /\[off\]/{print "mute"; exit}')
# Toggle the state of the speaker
#
if [ "$state" = "[on] "]; then
amixer
# amixer -D pulse sset Master "$state" > /dev/null
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
check() {
command -v "$1" 1>/dev/null
}
notify() {
check notify-send && {
notify-send -a "Color Picker" "$@"
return
}
echo "$@"
}
loc="$HOME/.cache/colorpicker"
[ -d "$loc" ] || mkdir -p "$loc"
[ -f "$loc/colors" ] || touch "$loc/colors"
limit=10
[[ $# -eq 1 && $1 = "-l" ]] && {
cat "$loc/colors"
exit
}
[[ $# -eq 1 && $1 = "-j" ]] && {
text="$(head -n 1 "$loc/colors")"
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
# allcolors=($(tail -n +2 "$loc/colors"))
tooltip="<b> COLORS</b>\n\n"
tooltip+="-> <b>$text</b> <span color='$text'></span> \n"
for i in "${allcolors[@]}"; do
tooltip+=" <b>$i</b> <span color='$i'></span> \n"
done
cat <<EOF
{ "text":"<span color='$text'></span>", "tooltip":"$tooltip"}
EOF
exit
}
check hyprpicker || {
notify "hyprpicker is not installed"
exit
}
killall -q hyprpicker
color=$(hyprpicker)
check wl-copy && {
echo "$color" | sed -z 's/\n//g' | wl-copy
}
prevColors=$(head -n $((limit - 1)) "$loc/colors")
echo "$color" >"$loc/colors"
echo "$prevColors" >>"$loc/colors"
sed -i '/^$/d' "$loc/colors"
pkill -RTMIN+1 waybar
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
# Temp file to store previous readings
tmpfile="/tmp/cpu_prev_all"
# Get all per-core lines
mapfile -t cpu_lines < <(grep '^cpu[0-9]' /proc/stat)
# On first run, save and exit
if [[ ! -f $tmpfile ]]; then
printf "%s\n" "${cpu_lines[@]}" > "$tmpfile"
echo "..." # No previous data
exit 0
fi
# Load previous readings
mapfile -t prev_lines < "$tmpfile"
# Sanity check
if (( ${#cpu_lines[@]} != ${#prev_lines[@]} )); then
echo "..." # Core count mismatch (e.g., suspend/resume)
printf "%s\n" "${cpu_lines[@]}" > "$tmpfile"
exit 0
fi
total_usage=0
for i in "${!cpu_lines[@]}"; do
# Current
read -r cpu user nice system idle iowait irq softirq steal _ _ <<< "${cpu_lines[$i]}"
total_now=$((user + nice + system + idle + iowait + irq + softirq + steal))
idle_now=$((idle + iowait))
# Previous
read -r _ pu pn ps pi piw pir psf pst _ _ <<< "${prev_lines[$i]}"
total_prev=$((pu + pn + ps + pi + piw + pir + psf + pst))
idle_prev=$((pi + piw))
# Deltas
diff_total=$((total_now - total_prev))
diff_idle=$((idle_now - idle_prev))
if ((diff_total > 0)); then
usage=$((100 * (diff_total - diff_idle) / diff_total))
total_usage=$((total_usage + usage))
fi
done
# Output total usage (per-core sum)
#echo '{"usage": ${total_usage}%}'}
printf "{ \"text\": %6.0f, \"tooltip\": \"%s\" }" "$total_usage" "test"
# Save current readings
printf "%s\n" "${cpu_lines[@]}" > "$tmpfile"
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
format() {
if [ "$1" -eq 0 ]; then
echo '-'
else
echo "$1"
fi
}
if ! updates_arch="$(checkupdates | wc -l)"; then
updates_arch=0
fi
if ! updates_aur="$(yay -Qum 2>/dev/null | wc -l)"; then
updates_aur=0
fi
updates="$((updates_arch + updates_aur))"
if [ "$updates" -gt 0 ]; then
echo " ($(format $updates_arch)/$(format $updates_aur))"
else
echo
fia
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
pkgmgr="pacman"
hash paru 2>/dev/null && pkgmgr="paru"
hash yay 2>/dev/null && pkgmgr="yay"
IFS=$'\n'$'\r'
updatesli=($($pkgmgr -Qu))
text=${#updatesli[@]}
icon=""
[ $text -eq 0 ] && icon="" || icon="📦"
for i in ${updatesli[@]}
do
tooltip+="$i\n"
done
cat << EOF
{ "text":"$icon", "tooltip":"UPDATES: $text"}
EOF
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
if [ -f /sys/class/power_supply/BAT*/current_now ]; then
powerDraw="󰠰 $(($(cat /sys/class/power_supply/BAT*/current_now)/1000000))w"
fi
cat << EOF
{ "text":"$powerDraw", "tooltip":"power Draw $powerDraw"}
EOF
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
BSSIDS="$(nmcli device wifi list |
awk 'NR>1 {if ($1 != "*") {print $1}}' |
tr -d ":" |
tr "\n" ",")"
LOC=""
REQUEST_GEO="$(wget -qO - http://openwifi.su/api/v1/bssids/"$BSSIDS")"
if [[ "$(jq ".count_results" <<< "$REQUEST_GEO")" -gt 0 ]] ; then
LAT="$(jq ".lat" <<< "$REQUEST_GEO")"
LON="$(jq ".lon" <<< "$REQUEST_GEO")"
LOC="$LAT,$LON"
fi
text="$(curl -s "https://wttr.in/$LOC?format=1" | sed 's/ //g')"
tooltip="$(curl -s "https://wttr.in/$LOC?0QT" |
sed 's/\\/\\\\/g' |
sed ':a;N;$!ba;s/\n/\\n/g' |
sed 's/"/\\"/g')"
if ! grep -q "Unknown location" <<< "$text"; then
echo "{\"text\": \"$text\", \"tooltip\": \"<tt>$tooltip</tt>\", \"class\": \"weather\"}"
fi
+84
View File
@@ -0,0 +1,84 @@
* {
font-family: "JetBrainsMono Nerd Font,JetBrainsMono NF" ;
color: white;
}
window#waybar {
background: transparent;
}
.modules-right {
background: #000000;
}
.modules-center {
background: #000000;
}
.modules-left {
background: #000000;
}
#battery,
#custom-clipboard,
#custom-colorpicker,
#custom-powerDraw,
#bluetooth,
#pulseaudio,
#network,
#disk,
#memory,
#backlight,
#cpu,
#temperature,
#custom-weather,
#idle_inhibitor,
#jack,
#tray,
#window,
#workspaces,
#clock {
min-width: 1ex;
padding-right: 5px;
}
#temperature.critical,
#pulseaudio {
min-width: 5ex;
}
#pulseaudio.muted {
color: #FF0000;
}
#pulseaudio.mic.muted {
color: #ffffff;
}
#pulseaudio.mic:not(.source-muted) {
color: #fc0202;
}
#clock{
color: #f9780e;
}
#battery.charging {
color: #ffffff;
background-color: #26A65B;
}
#battery.warning:not(.charging) {
background-color: #ffbe61;
color: black;
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#network.speed {
min-width: 30ex;
}