push all the updates
This commit is contained in:
95
.config/waybar/config.jsonc
Normal file
95
.config/waybar/config.jsonc
Normal file
@@ -0,0 +1,95 @@
|
||||
// -*- mode: jsonc -*-
|
||||
{
|
||||
"height": 30,
|
||||
"spacing": 4,
|
||||
"modules-left": [
|
||||
"hyprland/workspaces",
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-center": [
|
||||
"clock"
|
||||
],
|
||||
"modules-right": [
|
||||
"custom/screenshot",
|
||||
"idle_inhibitor",
|
||||
"pulseaudio",
|
||||
"network",
|
||||
"custom/mount-data",
|
||||
"custom/mount-usb1",
|
||||
"cpu",
|
||||
"memory",
|
||||
"tray"
|
||||
],
|
||||
"hyprland/workspaces": {
|
||||
"format": "{id}"
|
||||
},
|
||||
"custom/screenshot": {
|
||||
"exec": "printf '{\"text\": \"\", \"tooltip\": \"Area screenshot: edit in Swappy, copy to clipboard, save to NAS pictures if mounted\"}'",
|
||||
"return-type": "json",
|
||||
"interval": "once",
|
||||
"on-click": "$HOME/.config/waybar/scripts/capture-share-shot.sh"
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
},
|
||||
"tray": {
|
||||
"spacing": 10
|
||||
},
|
||||
"clock": {
|
||||
"format": " {:%H:%M}",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format-alt": " {:%Y-%m-%d}"
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage}%",
|
||||
"tooltip": false
|
||||
},
|
||||
"memory": {
|
||||
"format": " {}%"
|
||||
},
|
||||
"custom/mount-data": {
|
||||
"exec": "$HOME/.config/waybar/scripts/check-mount.sh /mnt/data data",
|
||||
"return-type": "json",
|
||||
"interval": 10,
|
||||
"tooltip": true,
|
||||
"on-click": "thunar /mnt/data"
|
||||
},
|
||||
"custom/mount-usb1": {
|
||||
"exec": "$HOME/.config/waybar/scripts/check-mount.sh /mnt/usb1 usb1",
|
||||
"return-type": "json",
|
||||
"interval": 10,
|
||||
"tooltip": true,
|
||||
"on-click": "thunar /mnt/usb1"
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": " {essid} ({signalStrength}%)",
|
||||
"format-ethernet": " {ipaddr}/{cidr}",
|
||||
"tooltip-format": " {ifname} via {gwaddr}",
|
||||
"format-linked": " {ifname} (No IP)",
|
||||
"format-disconnected": " Disconnected",
|
||||
"format-alt": " {ifname}: {ipaddr}/{cidr}",
|
||||
"on-click-right": "nm-connection-editor"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}% {format_source}",
|
||||
"format-bluetooth": "{icon} {volume}% {format_source}",
|
||||
"format-bluetooth-muted": " {icon} {format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
"format-source": " {volume}%",
|
||||
"format-source-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
}
|
||||
}
|
||||
53
.config/waybar/scripts/capture-share-shot.sh
Executable file
53
.config/waybar/scripts/capture-share-shot.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
base_dir="/mnt/data/media/share/pictures"
|
||||
tmp_file="$(mktemp --suffix=.png)"
|
||||
selection_file="$(mktemp)"
|
||||
|
||||
cleanup() {
|
||||
rm -f "$tmp_file" "$selection_file"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
choose_subfolder() {
|
||||
if [[ ! -d "$base_dir" ]] || ! mountpoint -q /mnt/data; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
{
|
||||
printf '/\n'
|
||||
find "$base_dir" -mindepth 1 -type d -printf '%P\n' | sort
|
||||
} > "$selection_file"
|
||||
|
||||
if selected=$(wofi --dmenu --prompt 'Save screenshot folder' < "$selection_file"); then
|
||||
if [[ -z "$selected" || "$selected" == "/" ]]; then
|
||||
printf '%s\n' "$base_dir"
|
||||
else
|
||||
printf '%s/%s\n' "$base_dir" "$selected"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "$base_dir"
|
||||
}
|
||||
|
||||
if ! region="$(slurp)"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! grim -g "$region" - | swappy -f - -o "$tmp_file"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wl-copy --type image/png < "$tmp_file"
|
||||
|
||||
if destination_dir="$(choose_subfolder)"; then
|
||||
mkdir -p "$destination_dir"
|
||||
file_name="screenshot-$(date +%Y%m%d-%H%M%S).png"
|
||||
cp "$tmp_file" "$destination_dir/$file_name"
|
||||
notify-send 'Screenshot saved' "$destination_dir/$file_name\nCopied to clipboard"
|
||||
else
|
||||
notify-send 'Screenshot copied' 'NAS picture share is not available; image copied to clipboard only'
|
||||
fi
|
||||
16
.config/waybar/scripts/check-mount.sh
Executable file
16
.config/waybar/scripts/check-mount.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/bash
|
||||
# Usage: check-mount.sh <mountpoint> <label>
|
||||
# Outputs Waybar custom module JSON
|
||||
|
||||
MOUNT="$1"
|
||||
LABEL="$2"
|
||||
ICON_MOUNT=""
|
||||
ICON_DOWN=""
|
||||
|
||||
if mountpoint -q "$MOUNT"; then
|
||||
read -r used avail pcent <<< "$(df -h --output=used,avail,pcent "$MOUNT" | tail -1)"
|
||||
printf '{"text": "%s %s %s/%s (%s)", "tooltip": "%s mounted — used: %s, free: %s (%s)", "class": "mounted"}\n' \
|
||||
"$ICON_MOUNT" "$LABEL" "$used" "$avail" "$pcent" "$MOUNT" "$used" "$avail" "$pcent"
|
||||
else
|
||||
printf '{"text": "%s %s N/A", "tooltip": "%s is NOT mounted", "class": "unmounted"}\n' "$ICON_DOWN" "$LABEL" "$MOUNT"
|
||||
fi
|
||||
37
.config/waybar/style.css
Normal file
37
.config/waybar/style.css
Normal file
@@ -0,0 +1,37 @@
|
||||
@import url("/etc/xdg/waybar/style.css");
|
||||
|
||||
#custom-screenshot,
|
||||
#idle_inhibitor,
|
||||
#pulseaudio,
|
||||
#network,
|
||||
#clock,
|
||||
#cpu,
|
||||
#memory,
|
||||
#tray,
|
||||
#custom-mount-data,
|
||||
#custom-mount-usb1 {
|
||||
font-family: "SauceCodePro Nerd Font", "SauceCodePro Nerd Font Mono", "Symbols Nerd Font Mono", "Symbols Nerd Font", "Font Awesome 7 Free", sans-serif;
|
||||
}
|
||||
|
||||
#custom-screenshot {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
#custom-mount-data,
|
||||
#custom-mount-usb1 {
|
||||
padding: 0 10px;
|
||||
border-radius: 6px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#custom-mount-data.mounted,
|
||||
#custom-mount-usb1.mounted {
|
||||
color: #a3be8c;
|
||||
background: rgba(163, 190, 140, 0.12);
|
||||
}
|
||||
|
||||
#custom-mount-data.unmounted,
|
||||
#custom-mount-usb1.unmounted {
|
||||
color: #bf616a;
|
||||
background: rgba(191, 97, 106, 0.14);
|
||||
}
|
||||
Reference in New Issue
Block a user