add sway, waybar and rofi config

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2024-06-07 18:18:06 +05:30
parent 3a0c68b8d9
commit c946a5f4cf
10 changed files with 1200 additions and 0 deletions
+168
View File
@@ -0,0 +1,168 @@
{
// "layer": "top", // Waybar at top layer
"position": "bottom", // Waybar position (top|bottom|left|right)
"height": 35, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"border": "5px solid transparent",
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "battery", "battery#bat2", "clock", "tray"],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"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}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {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"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}
+256
View File
@@ -0,0 +1,256 @@
{
// "layer": "top", // Waybar at top layer
"position": "bottom", // Waybar position (top|bottom|left|right)
"height": 40, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": [
"cpu",
"memory",
"temperature",
"custom/wakatime",
"network",
"sway/mode",
"sway/scratchpad",
"custom/media"
],
"modules-center": [
"sway/workspaces",
"clock",
"custom/weather"
],
"modules-right": [
"mpd",
"pulseaudio",
"backlight",
// "keyboard-state",
"battery",
"idle_inhibitor",
// "custom/dunst",
"tray"
],
// Modules configuration
"sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
"warp-on-scroll": false,
"format": "{name}",
"disable-scroll-wraparound": true
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
},
// "keyboard-state": {
// "capslock": true,
// "format": "{icon}",
// "format-icons": {
// "locked": "\udb82\ude9b",
// "unlocked": ""
// }
// },
"sway/window": {
"icon": true,
"icon-size": 20,
// "format": ""
"rewrite": {
".* - ([A-Za-z0-9 ]+)": "$1",
".* — ([A-Za-z0-9 ]+)": "$1"
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": [
"",
""
],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "<span size='large'>{icon}</span>",
"format-icons": {
"activated": "\uf109",
"deactivated": "\udb81\udee7"
},
"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": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "<span size='large'>\udb83\ude17</span> {:%Y-%m-%d}",
"format": "<span size='large'>\uf43a</span> {:%H:%M}"
},
"cpu": {
"format": "<span size='large'>\uf4bc</span> {usage}%",
"tooltip": true,
"interval": 5
},
"memory": {
"format": "<span size='large'>\uf463</span> {}%",
"tooltip-format": "RAM: {used}/{avail} | Swap: {swapUsed}/{swapTotal}"
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "<span size='large'>{icon}</span> {temperatureC}°C",
"format-icons": [
"\uf2cb",
"\uf2ca",
"\uf2c9",
"\uf2c7"
]
},
"backlight": {
// "device": "acpi_video1",
"format": "<span size='large'>{icon}</span> {percent}%",
"format-icons": [
"\udb86\ude4e",
"\udb86\ude4f",
"\udb86\ude50",
"\udb86\ude51",
"\udb86\ude52",
"\udb86\ude53",
"\udb86\ude54",
"\udb86\ude55",
"\udb86\ude56",
"\udb81\udee8"
]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% \udb80\udc84",
"format-plugged": "{capacity}% \uf492",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [
"\udb80\udc8e",
"\udb80\udc7a",
"\udb80\udc7c",
"\udb80\udc7e",
"\udb80\udc80",
"\udb80\udc82",
"\udb80\udc79"
]
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"interval": 5,
"tooltip-format-wifi": "{icon} {essid}: ({signalStrength}%)",
"tooltip-format-ethernet": "\udb80\ude00 {ipaddr}/{cidr}",
"tooltip-format-disconnected": "\uead0 Please connect to a network.",
"format": "<span size='large' color='green'>\udb82\uddc7</span> {bandwidthUpBits:4} <span size='large' color='red'>\udb82\uddbf</span> {bandwidthDownBits:4}",
"format-disconnected": "<span size='large'>\uead0</span> Disconnected",
"format-icons": [
"\udb82\udd2f",
"\udb82\udd1f",
"\udb82\udd22",
"\udb82\udd25",
"\udb82\udd28"
]
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "<span size='large'>{icon}</span> {volume}% {format_source}",
"format-bluetooth": "<span size='large'>\udb80\udcb0 {icon}</span> {volume}% {format_source}",
"format-bluetooth-muted": "<span size='large'>\uf466 {icon}</span> {format_source}",
"format-muted": "<span size='large'>\udb81\udd81</span> {format_source}",
"format-source": "<span size='large'>\udb80\udf6e</span> {volume}%",
"format-source-muted": "<span size='large'>\udb80\udf6d</span>",
"format-icons": {
"headphone": "\udb80\udecb",
"hands-free": "\udb81\udcc3",
"headset": "\udb80\udece",
"phone": "\uf2a0",
"portable": "\udb86\udc52",
"car": "\udb80\udd0d",
"default": [
"\udb81\udd7f",
"\udb81\udd80",
"\udb81\udd7e"
]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/wakatime": {
"format": "<span size='large'>\uf121</span> {}",
"exec": "~/.config/waybar/scripts/wakatime.sh",
"tooltip": true,
"return-type": "json",
"interval": 900
},
"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",
"restart-interval": 1
}
}
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
COUNT=$(dunstctl count waiting)
ENABLED=
DISABLED=
if [ $COUNT != 0 ]; then DISABLED="$COUNT"; fi
if dunstctl is-paused | grep -q "false" ; then echo $ENABLED; else echo $DISABLED; fi
+19
View File
@@ -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\"}"
+19
View File
@@ -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
+284
View File
@@ -0,0 +1,284 @@
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: 'JetBrainsMono Nerd Font';
font-size: 16px;
padding: 3px;
}
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;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
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: 0 5px;
background-color: transparent;
color: #ffffff;
}
#workspaces button:hover {
background: #66cc99;
}
#workspaces button.focused {
/* background-color: #64727D;*/
box-shadow: inset -2px -2px #ffffff, inset 2px 2px #ffffff;
/* border: 1px solid white; */
color: palevioletred
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
/* background-color: #64727D; */
border: 2px solid green;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#mpd {
padding: 0 10px;
background-color: #262626;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left>widget:first-child>#workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right>widget:last-child>#workspaces {
margin-right: 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: #2980b9;
}
#network.disconnected {
color: #f53c3c;
}
#pulseaudio {
color: #f1c40f;
}
#pulseaudio.muted {
color: #90b1b1;
}
#wireplumber {
color: #fff0f5;
}
#wireplumber.muted {
color: #f53c3c;
}
#custom-media {
color: #66cc99;
min-width: 100px;
}
#custom-media.custom-spotify {
color: #66cc99;
}
#custom-media.custom-vlc {
color: #ffa000;
}
#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: green;
}
#mpd {
background-color: #66cc99;
color: #2a5c45;
}
#mpd.disconnected {
background-color: #f53c3c;
}
#mpd.stopped {
background-color: #90b1b1;
}
#mpd.paused {
background-color: #51a37a;
}
#language {
background: #00b093;
color: #740864;
padding: 0 5px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state {
background: #97e1ad;
color: #000000;
padding: 0 0px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state>label {
padding: 0 5px;
}
#keyboard-state>label.locked {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad.empty {
background-color: transparent;
}
#custom-wakatime {
color: turquoise
}