mirror of
https://github.com/avinal/dotfiles.git
synced 2026-07-04 07:20:09 +05:30
feat: major update to all configs
- move older config to archive Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
{
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "left", // Waybar position (top|bottom|left|right)
|
||||
// "height": 40, // Waybar height (to be removed for auto height)
|
||||
"width": 20, // Waybar width
|
||||
"spacing": 4, // Gaps between modules (4px)
|
||||
"mode": "dock",
|
||||
"fixed-center": false,
|
||||
// Choose the order of the modules
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"sway/mode",
|
||||
"sway/scratchpad"
|
||||
],
|
||||
"modules-center": [
|
||||
"sway/window"
|
||||
],
|
||||
"modules-right": [
|
||||
"battery",
|
||||
"custom/spacer",
|
||||
"custom/wakatime",
|
||||
"custom/spacer",
|
||||
"pulseaudio",
|
||||
"custom/spacer",
|
||||
"group/system",
|
||||
"custom/spacer",
|
||||
"network",
|
||||
"custom/spacer",
|
||||
"group/tray",
|
||||
"custom/spacer",
|
||||
"clock",
|
||||
"custom/spacer",
|
||||
"custom/dunst"
|
||||
],
|
||||
"group/system": {
|
||||
"orientation": "inherit",
|
||||
"modules": [
|
||||
"temperature",
|
||||
"cpu",
|
||||
"custom/spacer",
|
||||
"memory",
|
||||
"custom/spacer"
|
||||
],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false
|
||||
}
|
||||
},
|
||||
"group/tray": {
|
||||
"orientation": "inherit",
|
||||
"modules": [
|
||||
"idle_inhibitor",
|
||||
"tray"
|
||||
],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false
|
||||
// "tranasition-duration": 100
|
||||
}
|
||||
},
|
||||
// Modules configuration
|
||||
"sway/workspaces": {
|
||||
// "disable-scroll": true,
|
||||
// "all-outputs": true,
|
||||
"warp-on-scroll": false,
|
||||
"format": "{name}",
|
||||
"disable-scroll-wraparound": true
|
||||
},
|
||||
"sway/window": {
|
||||
"icon": false,
|
||||
// "icon-size": 20,
|
||||
"rotate": 270,
|
||||
// "format": ""
|
||||
"rewrite": {
|
||||
".* - ([A-Za-z0-9 ]+)": "$1",
|
||||
".* — ([A-Za-z0-9 ]+)": "$1",
|
||||
"^avinal@spacetime:.*": "GNOME Terminal"
|
||||
}
|
||||
},
|
||||
"sway/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>",
|
||||
"rotate": 270
|
||||
},
|
||||
"sway/scratchpad": {
|
||||
"format": "{icon} {count}",
|
||||
"show-empty": false,
|
||||
"format-icons": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{app}: {title}",
|
||||
"rotate": 270
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "Keep On",
|
||||
"deactivated": "OFF"
|
||||
},
|
||||
"rotate": 270,
|
||||
"tooltip": false
|
||||
// "tooltip-format-activated": "The screen won't turn off on idle.",
|
||||
// "tooltip-format-deactivated": "The screen will turn off on idle."
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 20,
|
||||
"spacing": 10
|
||||
},
|
||||
"clock": {
|
||||
"rotate": 270,
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format": "<span color='#ff6699'>{:%a %b %d %R}</span>",
|
||||
"calendar": {
|
||||
"mode": "month",
|
||||
"mode-mon-col": 3,
|
||||
"weeks-pos": "right",
|
||||
"on-scroll": 1,
|
||||
"format": {
|
||||
"months": "<span color='#ffead3'><b>{}</b></span>",
|
||||
"days": "<span color='#ecc6d9'><b>{}</b></span>",
|
||||
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
|
||||
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-click-forward": "tz_up",
|
||||
"on-click-backward": "tz_down",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
"cpu": {
|
||||
"format": "CPU {usage}%",
|
||||
"tooltip": true,
|
||||
"interval": 5,
|
||||
"rotate": 270
|
||||
},
|
||||
"memory": {
|
||||
"format": "RAM {}%",
|
||||
"tooltip-format": "RAM: {used}/{avail} | Swap: {swapUsed}/{swapTotal}",
|
||||
"rotate": 270
|
||||
},
|
||||
"temperature": {
|
||||
"critical-threshold": 80,
|
||||
"format": "{icon} {temperatureC}°C",
|
||||
"format-icons": [
|
||||
"Chill",
|
||||
"Warm",
|
||||
"Hot",
|
||||
"Burn"
|
||||
],
|
||||
"rotate": 270
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"best": 99,
|
||||
"good": 70,
|
||||
"warning": 40,
|
||||
"critical": 20
|
||||
},
|
||||
"format": "{capacity}%",
|
||||
"format-charging": "Charging {capacity}%",
|
||||
"format-plugged": "Plugged {capacity}%",
|
||||
"format-alt": "{icon} {time}",
|
||||
"rotate": 270,
|
||||
// "format-good": "", // An empty format will hide the module
|
||||
// "format-full": "",
|
||||
"format-icons": {
|
||||
"best": "Feeling good",
|
||||
"good": "Will last",
|
||||
"warning": "Charge soon",
|
||||
"critical": "Gonna die in"
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"interval": 10,
|
||||
"format-wifi": "{essid} ({signalStrength}%)",
|
||||
"format-ethernet": "Wired {ifname}",
|
||||
"format-linked": "<span color='red'>No Internet!</span>",
|
||||
"tooltip-format-disconnected": "Please connect to a network.",
|
||||
"tooltip-format": "Up: {bandwidthUpBits:4} Down: {bandwidthDownBits:4}",
|
||||
"format-disconnected": "Disconnected!",
|
||||
"rotate": 270
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}% {format_source}",
|
||||
"format-bluetooth": "Bluetooth {volume}% {format_source}",
|
||||
"format-bluetooth-muted": "<span color='red'><s>Bluetooth</> {format_source}",
|
||||
"format-muted": "<span color='red'><s>{icon}</s></span> {format_source}",
|
||||
"format-source": "Mic {volume}%",
|
||||
"format-source-muted": "<span color='red'><s>Mic</s></span>",
|
||||
"format-icons": {
|
||||
"headphone": "Headphone",
|
||||
"headset": "Headphone",
|
||||
"phone": "Phone",
|
||||
"hdmi": "Monitor",
|
||||
"default": "Speaker"
|
||||
},
|
||||
"on-click": "pavucontrol",
|
||||
"rotate": 270
|
||||
},
|
||||
"custom/wakatime": {
|
||||
"format": "{}",
|
||||
"exec": "~/.config/waybar/scripts/wakatime.sh",
|
||||
"tooltip": true,
|
||||
"return-type": "json",
|
||||
"interval": 900,
|
||||
"rotate": 270
|
||||
},
|
||||
"custom/weather": {
|
||||
"exec": "$HOME/.config/waybar/scripts/get-weather.sh Bengaluru",
|
||||
"return-type": "json",
|
||||
"format": "{}",
|
||||
"tooltip": true,
|
||||
"interval": 3600
|
||||
},
|
||||
"custom/dunst": {
|
||||
"exec": "~/.config/waybar/scripts/dunst.sh",
|
||||
"on-click": "dunstctl set-paused toggle",
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"restart-interval": 1,
|
||||
"rotate": 270
|
||||
},
|
||||
"custom/spacer": {
|
||||
"format": "|",
|
||||
"rotate": 270,
|
||||
"tooltip": false
|
||||
}
|
||||
}
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
COUNT=$(dunstctl count waiting)
|
||||
status=""
|
||||
class=""
|
||||
tooltip="Notifications are "
|
||||
if dunstctl is-paused | grep -q "false" ; then
|
||||
status="NOT"
|
||||
tooltip+="active"
|
||||
else
|
||||
status="DND"
|
||||
class="dnd"
|
||||
tooltip+="paused"
|
||||
fi
|
||||
|
||||
if [ "$COUNT" != 0 ]; then status+=":$COUNT"; fi
|
||||
printf '{"text":"%s","tooltip":"%s","class":"%s"}' "$status" "$tooltip" "$class" | jq --unbuffered --compact-output
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# get_weather.sh
|
||||
for i in {1..5}
|
||||
do
|
||||
text=$(curl -s "https://wttr.in/$1?format=1")
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
text=$(echo "$text" | sed -E "s/\s+/ /g")
|
||||
tooltip=$(curl -s "https://wttr.in/$1?format=4")
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g")
|
||||
echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "{\"text\":\"error\", \"tooltip\":\"error\"}"
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
output=$(wakatime --today)
|
||||
|
||||
# Extract hours and minutes using awk and sum the total
|
||||
total_minutes=$(echo "$output" | awk -F' ' '
|
||||
{
|
||||
for (i=1; i<=NF; i++) {
|
||||
if ($i == "hrs" || $i == "hr") total += $(i-1) * 60;
|
||||
if ($i == "mins" || $i == "min") total += $(i-1);
|
||||
}
|
||||
} END {print total}')
|
||||
|
||||
# Calculate total hours and remaining minutes
|
||||
total_hours=$((total_minutes / 60))
|
||||
remaining_minutes=$((total_minutes % 60))
|
||||
|
||||
# Print the results
|
||||
printf '{"text":"%02dh %02dm","tooltip":"%s","class":"wakatime"}' $total_hours $remaining_minutes "$output" | jq --unbuffered --compact-output
|
||||
@@ -0,0 +1,226 @@
|
||||
* {
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
font-family: 'Monaspace Radon';
|
||||
font-size: 15px;
|
||||
padding: 2px 0;
|
||||
margin: 2px 0;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding: 1px 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: #262626;
|
||||
/* background-color: rgba(43, 48, 59, 0.5); */
|
||||
/* border-top: 3px solid rgba(100, 114, 125, 0.5); */
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
/* border-right: 1px solid cyan; */
|
||||
padding: 0 0;
|
||||
}
|
||||
|
||||
|
||||
button {
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
/* Avoid rounded borders under each button name */
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
button:hover {
|
||||
background: inherit;
|
||||
/* box-shadow: inset 0 -3px #ffffff; */
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 2px 3px;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
/* margin-left: -6px; */
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: #66cc99;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
|
||||
#workspaces button.focused {
|
||||
border-top: 2px solid cyan;
|
||||
border-bottom: 2px solid cyan;
|
||||
color: palevioletred;
|
||||
}
|
||||
|
||||
#mode {
|
||||
/* background-color: #64727D; */
|
||||
animation-name: blink;
|
||||
/* animation-duration: 0.5s; */
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
border-left: 2px solid darksalmon;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#temperature,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#wireplumber,
|
||||
#custom-dunst,
|
||||
#custom-spacer,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#scratchpad {
|
||||
padding: 0 2px;
|
||||
/* border-right: 1px solid cyan; */
|
||||
background-color: #262626;
|
||||
/* margin: 0 3px; */
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
/* padding: 1px 0; */
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left>widget:first-child>#workspaces {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right>widget:last-child>#workspaces {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
/* background-color: #64727D; */
|
||||
}
|
||||
|
||||
#battery {
|
||||
/* background-color: #ffffff; */
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged {
|
||||
color: #26A65B;
|
||||
/* background-color: #26A65B; */
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
/* background-color: #f53c3c; */
|
||||
color: #f53c3c;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
/* background-color: #2ecc71; */
|
||||
color: #2ecc71;
|
||||
}
|
||||
|
||||
#memory {
|
||||
/* background-color: #9b59b6; */
|
||||
color: #9b59b6;
|
||||
}
|
||||
|
||||
#disk {
|
||||
color: #964B00;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
color: #90b1b1;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: lightseagreen;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: #f53c3c;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #f1c40f;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: #90b1b1;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
color: #f0932b;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: #eb4d4b;
|
||||
}
|
||||
|
||||
#tray {
|
||||
color: #2980b9;
|
||||
}
|
||||
|
||||
#tray>.passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray>.needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
color: lightgreen;
|
||||
}
|
||||
|
||||
#scratchpad {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#scratchpad.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#custom-wakatime {
|
||||
color: darksalmon;
|
||||
}
|
||||
|
||||
#custom-dunst {
|
||||
color: aquamarine
|
||||
}
|
||||
|
||||
#custom-dunst.dnd {
|
||||
color: red;
|
||||
/* text-decoration: strikethrough */
|
||||
}
|
||||
Reference in New Issue
Block a user