sway: replace swaybar/i3status-rs with waybar

This commit is contained in:
Konstantin Koslowski 2021-05-07 21:36:28 +02:00
parent 839093a3de
commit 674825df0f
15 changed files with 783 additions and 345 deletions

View file

@ -3,8 +3,7 @@
install required packages install required packages
``` ```
$ sudo pacman -S sway swayidle swaylock i3status-rust grim slurp swappy wl-clipboard wofi fzf imv $ sudo pacman -S sway swayidle swaylock waybar grim slurp swappy wl-clipboard wofi fzf imv
$ yay -S persway
``` ```
![screenshot](sway.png) ![screenshot](sway.png)

127
bin/mediaplayer.py Executable file
View file

@ -0,0 +1,127 @@
#!/usr/bin/env python3
import argparse
import logging
import sys
import signal
import gi
import json
gi.require_version('Playerctl', '2.0')
from gi.repository import Playerctl, GLib
logger = logging.getLogger(__name__)
def write_output(text, player):
logger.info('Writing output')
output = {'text': text,
'class': 'custom-' + player.props.player_name,
'alt': player.props.player_name}
sys.stdout.write(json.dumps(output) + '\n')
sys.stdout.flush()
def on_play(player, status, manager):
logger.info('Received new playback status')
on_metadata(player, player.props.metadata, manager)
def on_metadata(player, metadata, manager):
logger.info('Received new metadata')
track_info = ''
if player.props.player_name == 'spotify' and \
'mpris:trackid' in metadata.keys() and \
':ad:' in player.props.metadata['mpris:trackid']:
track_info = 'AD PLAYING'
elif player.get_artist() != '' and player.get_title() != '':
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
title=player.get_title())
else:
track_info = player.get_title()
if player.props.status != 'Playing' and track_info:
track_info = '' + track_info
write_output(track_info, player)
def on_player_appeared(manager, player, selected_player=None):
if player is not None and (selected_player is None or player.name == selected_player):
init_player(manager, player)
else:
logger.debug("New player appeared, but it's not the selected player, skipping")
def on_player_vanished(manager, player):
logger.info('Player has vanished')
sys.stdout.write('\n')
sys.stdout.flush()
def init_player(manager, name):
logger.debug('Initialize player: {player}'.format(player=name.name))
player = Playerctl.Player.new_from_name(name)
player.connect('playback-status', on_play, manager)
player.connect('metadata', on_metadata, manager)
manager.manage_player(player)
on_metadata(player, player.props.metadata, manager)
def signal_handler(sig, frame):
logger.debug('Received signal to stop, exiting')
sys.stdout.write('\n')
sys.stdout.flush()
# loop.quit()
sys.exit(0)
def parse_arguments():
parser = argparse.ArgumentParser()
# Increase verbosity with every occurence of -v
parser.add_argument('-v', '--verbose', action='count', default=0)
# Define for which player we're listening
parser.add_argument('--player')
return parser.parse_args()
def main():
arguments = parse_arguments()
# Initialize logging
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
format='%(name)s %(levelname)s %(message)s')
# Logging is set by default to WARN and higher.
# With every occurrence of -v it's lowered by one
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
# Log the sent command line arguments
logger.debug('Arguments received {}'.format(vars(arguments)))
manager = Playerctl.PlayerManager()
loop = GLib.MainLoop()
manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player))
manager.connect('player-vanished', on_player_vanished)
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
for player in manager.props.player_names:
if arguments.player is not None and arguments.player != player.name:
logger.debug('{player} is not the filtered player, skipping it'
.format(player=player.name)
)
continue
init_player(manager, player)
loop.run()
if __name__ == '__main__':
main()

13
bin/waybar Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
CONFIG_DIR=$HOME/.config/sway/waybar.d
CONFIG=$CONFIG_DIR/$(hostname).conf
STYLE=$CONFIG_DIR/style.css
# Terminate already running bar instances
pkill -SIGUSR2 -x waybar
if [ $? -ne 0 ]; then
waybar -c $CONFIG -s $STYLE
fi

19
config
View file

@ -29,7 +29,6 @@ set $font Cascadia Code PL Regular 10
set $menu wofi --show drun --prompt applications set $menu wofi --show drun --prompt applications
set $search_cmd $HOME/.config/sway/bin/sway_search set $search_cmd $HOME/.config/sway/bin/sway_search
# #
# Host Specific # Host Specific
# #
@ -299,23 +298,7 @@ for_window [class="Signal" window_type="normal"] exec sh -c "sleep 1"; mark c; f
# #
# Status Bar: # Status Bar:
# #
# Read `man 5 sway-bar` for more information about this section. exec_always $HOME/.config/sway/bin/waybar
bar {
position top
gaps 3 5
status_command i3status-rs $HOME/.config/sway/i3status.d/$(hostname).toml
font $font
colors {
separator #666666
background #222222
statusline #dddddd
focused_workspace #0088CC #0088CC #ffffff
active_workspace #333333 #333333 #ffffff
inactive_workspace #333333 #333333 #888888
urgent_workspace #2f343a #900000 #ffffff
}
}
# #
# Autostart # Autostart
# #

View file

@ -1,63 +0,0 @@
[theme]
file = "/home/koslowski/.config/sway/i3status.d/theme.toml"
[icons]
file = "/home/koslowski/.config/sway/i3status.d/material.toml"
[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization}"
[[block]]
block = "memory"
format_mem = "{mem_used}/{mem_total}GB ({mem_used_percents})"
format_swap = "{swap_used}MB/{swap_total}MB({swap_used_percents})"
display_type = "memory"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95
[[block]]
block = "networkmanager"
on_click = "termite -t nmtui -e nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
[[block]]
block = "sound"
step_width = 3
on_click = "$HOME/.config/sway/bin/sway_volume gui"
[[block]]
block = "bluetooth"
mac = "4C:87:5D:0D:0F:4F"
on_click = "termite -e bluetoothctl"
[[block]]
block = "music"
player = "Plexamp"
buttons = ["play", "next"]
on_collapsed_click = "Plexamp.AppImage"
[[block]]
block = "battery"
interval = 10
format = "{percentage} {time}"
[[block]]
block = "weather"
format = "{location}: {weather} {temp}, {wind} m/s {direction}"
autolocate = true
service = { name = "openweathermap", api_key = "2a4ce7726b2f1731ec04418e64800e92", city_id = "2950159", units = "metric" }
[[block]]
block = "time"
format = "%Y/%m/%d %R"
timezone = "Europe/Berlin"
interval = 60
locale = "de_DE"

View file

@ -1,64 +0,0 @@
[theme]
file = "/home/koslowski/.config/sway/i3status.d/theme.toml"
[icons]
file = "/home/koslowski/.config/sway/i3status.d/material.toml"
[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization}"
[[block]]
block = "memory"
format_mem = "{mem_used}/{mem_total}GB ({mem_used_percents})"
format_swap = "{swap_used}MB/{swap_total}MB({swap_used_percents})"
display_type = "memory"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95
[[block]]
block = "networkmanager"
on_click = "termite -t nmtui -e nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
[[block]]
block = "sound"
step_width = 3
on_click = "$HOME/.config/sway/bin/sway_volume gui"
[[block]]
block = "bluetooth"
mac = "04:52:C7:C7:C8:DB"
on_click = "termite -e bluetoothctl"
[[block]]
block = "music"
player = "Plexamp"
buttons = ["play", "next"]
on_collapsed_click = "Plexamp.AppImage"
[[block]]
block = "battery"
interval = 10
format = "{percentage} {time}"
[[block]]
block = "weather"
format = "{location}: {weather} {temp}, {wind} m/s {direction}"
autolocate = true
service = { name = "openweathermap", api_key = "2a4ce7726b2f1731ec04418e64800e92", city_id = "2950159", units = "metric" }
[[block]]
block = "time"
format = "%Y/%m/%d %R"
timezone = "Europe/Berlin"
interval = 60
locale = "de_DE"

View file

@ -1,53 +0,0 @@
[theme]
file = "/home/konni/.config/sway/i3status.d/theme.toml"
[icons]
file = "/home/konni/.config/sway/i3status.d/material.toml"
[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization}"
[[block]]
block = "memory"
format_mem = "{mem_used}/{mem_total}GB ({mem_used_percents})"
format_swap = "{swap_used}MB/{swap_total}MB({swap_used_percents})"
display_type = "memory"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95
[[block]]
block = "networkmanager"
on_click = "termite -t nmtui -e nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
[[block]]
block = "sound"
step_width = 3
on_click = "$HOME/.config/sway/bin/sway_volume gui"
[[block]]
block = "music"
player = "Plexamp"
buttons = ["play", "next"]
on_collapsed_click = "Plexamp.AppImage"
[[block]]
block = "weather"
format = "{location}: {weather} {temp}, {wind} m/s {direction}"
autolocate = true
service = { name = "openweathermap", api_key = "2a4ce7726b2f1731ec04418e64800e92", city_id = "2950159", units = "metric" }
[[block]]
block = "time"
format = "%Y/%m/%d %R"
timezone = "Europe/Berlin"
interval = 60
locale = "de_DE"

View file

@ -1,66 +0,0 @@
## Material Design icons by Google
## https://fonts.google.com/icons
bat_charging = "\ue1a3" # battery_charging_full
bat_discharging = "\ue19c" # battery_alert
bat_empty = "\ue19c" # battery_alert
bat_full = "\ue1a4" # battery_full
bat_half = "\ue1a5" # battery_std
bat_quarter = "\ue1a5"
bat_three_quarters = "\ue1a5"
bat_not_available = "\ue1a6" # battery_unknown
bell = "\ue7f4" # notifications
bell-slash = "\ue7f8" # notifications_paused
bluetooth = "\ue1a7" # bluetooth
calendar = "\ue935" # calendar_today
cogs = "\ue8b8" # settings
cpu = "\ue640" # network_check
disk_drive = "\ue1db" # storage
docker = "\ue532" # directions_boat
github = "\ue86f" # code
gpu = "\ue333" # tv
headphones = "\ue60f" # bluetooth_audio
joystick = "\ue30f" # gamepad
keyboard = "\ue312" # keyboard
mail = "\ue0be" # email
memory_mem = "\ue322" # memory
memory_swap = "\ue8d4" # swap_horiz
mouse = "\ue323" # mouse
music = "\ue405" # music_note
music_next = "\ue044" # skip_next
music_pause = "\ue034" # skip_next
music_play = "\ue037" # play_arrow
music_prev = "\ue045" # skip_previous
net_loopback = "LO"
notification = "\ue7f7" # notifications_active
phone = "\ue324" # phone_android
phone_disconnected = "\ue339" # device_unknown
ping = "\ue62a" # system_update
pomodoro = "\U0001f345"
resolution = "\uf152" # crop-square-rounded
tasks = "\ue8f9"
thermometer = "\ue1ff" # device_thermostat
time = "\ue192" # access_time
toggle_off = "\ue836" # radio_button_on
toggle_on = "\ue837" # radio_button_on
update = "\ue8d7" # system_update_alt
uptime = "\ue425" # timer
volume_empty = "\ue04e" # volume_mute
volume_full = "\ue050" # volume_up
volume_half = "\ue04d" # volume_down
volume_muted = "\ue04f" # volume_off
microphone_full = "\ue029" # mic
microphone_half = "\ue029" # mic
microphone_empty = "\ue02a" # mic_none
microphone_muted = "\ue02b" # mic_off
## material
# weather_clouds = "\ue42d" # wb_cloudy
# weather_default = "\ue42d" # wb_cloudy
# weather_sun = "\ue430" # wb_sunny
## awesome5
weather_clouds = "\uf0c2"
weather_default = "\uf0c2" # Cloud symbol as default
weather_rain = "\uf043"
weather_snow = "\uf2dc"
weather_sun = "\uf185"
weather_thunder = "\uf0e7"
xrandr = "\ue31e"

View file

@ -1,58 +0,0 @@
[theme]
file = "/home/konni/.config/sway/i3status.d/theme.toml"
[icons]
file = "/home/konni/.config/sway/i3status.d/material.toml"
[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization}"
[[block]]
block = "memory"
format_mem = "{mem_used}/{mem_total}GB ({mem_used_percents})"
format_swap = "{swap_used}MB/{swap_total}MB({swap_used_percents})"
display_type = "memory"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95
[[block]]
block = "networkmanager"
on_click = "termite -t nmtui -e nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
[[block]]
block = "sound"
step_width = 3
on_click = "$HOME/.config/sway/bin/sway_volume gui"
[[block]]
block = "music"
player = "Plexamp"
buttons = ["play", "next"]
on_collapsed_click = "Plexamp.AppImage"
[[block]]
block = "battery"
interval = 10
format = "{percentage} {time}"
[[block]]
block = "weather"
format = "{location}: {weather} {temp}, {wind} m/s {direction}"
autolocate = true
service = { name = "openweathermap", api_key = "2a4ce7726b2f1731ec04418e64800e92", city_id = "2950159", units = "metric" }
[[block]]
block = "time"
format = "%Y/%m/%d %R"
timezone = "Europe/Berlin"
interval = 60
locale = "de_DE"

View file

@ -1,21 +0,0 @@
idle_bg = "#222222"
idle_fg = "#888888"
info_bg = "#222222"
info_fg = "#888888"
good_bg = "#222222"
good_fg = "#888888"
warning_bg = "#222222"
warning_fg = "#888888"
critical_bg = "#222222"
critical_fg = "#888888"
separator = "\u2770"
separator_bg = "auto"
separator_fg = "#268bd2"
alternating_tint_bg = "#000000"
alternating_tint_fg = "#000000"

142
waybar.d/7DPQTN2.conf Normal file
View file

@ -0,0 +1,142 @@
// vi: ft=jsonc
{
"layer": "top",
"height": 25,
"modules-left": [
"sway/workspaces"
],
"modules-center": [
"sway/window"
],
"modules-right": [
"custom/separator",
"pulseaudio",
"custom/media",
"custom/separator",
"network#wl0",
"network#en0",
"network#vpn0",
"custom/separator",
"cpu",
"memory",
"custom/separator",
"backlight",
"custom/separator",
"battery",
"custom/separator",
"clock",
"tray"
],
"custom/separator": {
"format": "<span foreground='#268bd2'></span>"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"chromium": " ",
"firefox": " ",
"Plexamp": "",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/sway/bin/mediaplayer.py 2> /dev/null",
"exec-if": "pgrep plexamp"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{:%a, %d %b <span foreground='#ebdbb2'> </span>%H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage}%",
"states": {
"warning": 70,
"critical": 90
}
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"states": {
"warning": 70,
"critical": 90
}
},
"backlight": {
"format": "<span foreground='#ebdbb2'>{icon}</span> {percent}%",
"format-icons": [""]
},
"battery": {
"bat": "BAT0",
"design-capacity": true,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity}%",
"format-charging": "<span foreground='#fb4934'></span> {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname} ",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#en0": {
"interval": 2,
"interface": "en0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#vpn0": {
"interval": 2,
"interface": "vpn0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span> {ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#ebdbb2'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pkill -x pavucontrol || pavucontrol"
},
"tray": {
"padding": 10,
"spacing": 10
}
}

142
waybar.d/90PKL63.conf Normal file
View file

@ -0,0 +1,142 @@
// vi: ft=jsonc
{
"layer": "top",
"height": 25,
"modules-left": [
"sway/workspaces"
],
"modules-center": [
"sway/window"
],
"modules-right": [
"custom/separator",
"pulseaudio",
"custom/media",
"custom/separator",
"network#wl0",
"network#en0",
"network#vpn0",
"custom/separator",
"cpu",
"memory",
"custom/separator",
"backlight",
"custom/separator",
"battery",
"custom/separator",
"clock",
"tray"
],
"custom/separator": {
"format": "<span foreground='#268bd2'></span>"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"chromium": " ",
"firefox": " ",
"Plexamp": "",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/sway/bin/mediaplayer.py 2> /dev/null",
"exec-if": "pgrep plexamp"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{:%a, %d %b <span foreground='#ebdbb2'> </span>%H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage}%",
"states": {
"warning": 70,
"critical": 90
}
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"states": {
"warning": 70,
"critical": 90
}
},
"backlight": {
"format": "<span foreground='#ebdbb2'>{icon}</span> {percent}%",
"format-icons": [""]
},
"battery": {
"bat": "BAT0",
"design-capacity": true,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity}%",
"format-charging": "<span foreground='#fb4934'></span> {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname} ",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#en0": {
"interval": 2,
"interface": "en0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#vpn0": {
"interval": 2,
"interface": "vpn0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span> {ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#ebdbb2'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pkill -x pavucontrol || pavucontrol"
},
"tray": {
"padding": 10,
"spacing": 10
}
}

139
waybar.d/annoyance.conf Normal file
View file

@ -0,0 +1,139 @@
// vi: ft=jsonc
{
"layer": "top",
"height": 25,
"modules-left": [
"sway/workspaces"
],
"modules-center": [
"sway/window"
],
"modules-right": [
"custom/separator",
"pulseaudio",
"custom/media",
"custom/separator",
"network#en0",
"network#vpn0",
"custom/separator",
"cpu",
"memory",
"custom/separator",
"backlight",
"custom/separator",
"clock",
"tray"
],
"custom/separator": {
"format": "<span foreground='#268bd2'></span>"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"chromium": " ",
"firefox": " ",
"Plexamp": "",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/sway/bin/mediaplayer.py 2> /dev/null",
"exec-if": "pgrep plexamp"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{:%a, %d %b <span foreground='#ebdbb2'> </span>%H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage}%",
"states": {
"warning": 70,
"critical": 90
}
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"states": {
"warning": 70,
"critical": 90
}
},
"backlight": {
"format": "<span foreground='#ebdbb2'>{icon}</span> {percent}%",
"format-icons": [""]
},
"battery": {
"bat": "BAT0",
"design-capacity": true,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity}%",
"format-charging": "<span foreground='#fb4934'></span> {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname} ",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#en0": {
"interval": 2,
"interface": "en0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#vpn0": {
"interval": 2,
"interface": "vpn0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span> {ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#ebdbb2'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pkill -x pavucontrol || pavucontrol"
},
"tray": {
"padding": 10,
"spacing": 10
}
}

142
waybar.d/silence.conf Normal file
View file

@ -0,0 +1,142 @@
// vi: ft=jsonc
{
"layer": "top",
"height": 25,
"modules-left": [
"sway/workspaces"
],
"modules-center": [
"sway/window"
],
"modules-right": [
"custom/separator",
"pulseaudio",
"custom/media",
"custom/separator",
"network#wl0",
"network#en0",
"network#vpn0",
"custom/separator",
"cpu",
"memory",
"custom/separator",
"backlight",
"custom/separator",
"battery",
"custom/separator",
"clock",
"tray"
],
"custom/separator": {
"format": "<span foreground='#268bd2'></span>"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"chromium": " ",
"firefox": " ",
"Plexamp": "",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/sway/bin/mediaplayer.py 2> /dev/null",
"exec-if": "pgrep plexamp"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{:%a, %d %b <span foreground='#ebdbb2'> </span>%H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage}%",
"states": {
"warning": 70,
"critical": 90
}
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"states": {
"warning": 70,
"critical": 90
}
},
"backlight": {
"format": "<span foreground='#ebdbb2'>{icon}</span> {percent}%",
"format-icons": [""]
},
"battery": {
"bat": "BAT0",
"design-capacity": true,
"states": {
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity}%",
"format-charging": "<span foreground='#fb4934'></span> {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname} ",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#en0": {
"interval": 2,
"interface": "en0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"network#vpn0": {
"interval": 2,
"interface": "vpn0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span> {essid} ({signalStrength}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#606060'> </span>{ifname}",
"format-disconnected": "<span foreground='#fb4934'> </span> {ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#ebdbb2'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pkill -x pavucontrol || pavucontrol"
},
"tray": {
"padding": 10,
"spacing": 10
}
}

76
waybar.d/style.css Normal file
View file

@ -0,0 +1,76 @@
@define-color background rgba(20, 20, 20, 0.8);
@define-color foreground #ebdbb2;
@define-color black #222222;
@define-color yellow #fabd2f;
@define-color red #fb4934;
@define-color green #b8bb26;
@define-color blue #268bd2;
* {
border: none;
border-radius: 0;
font-family: Input, "Font Awesome 5 Free";
font-size: 13px;
min-height: 0;
}
window#waybar {
background: @background;
color: @foreground;
transition-property: background-color;
transition-duration: 0.5s;
}
#workspaces button {
padding: 0 10px;
background: transparent;
color: @foreground;
border-bottom: 3px solid transparent;
}
#workspaces button.focused {
color: @blue;
border-bottom: 3px solid @blue;
}
#workspaces button.urgent {
border-bottom: 3px solid @yellow;
}
/* normal */
#backlight,
#battery,
#clock,
#cpu,
#custom-media,
#memory,
#network,
#pulseaudio,
#workspaces {
padding: 0 6px;
margin: 0 6px;
}
/* good */
#battery.full {
border-bottom: 3px solid @green;
}
/* focus */
#battery.charging {
border-bottom: 3px solid @blue;
}
/* warning */
#battery.warning,
#cpu.warning,
#memory.warning {
border-bottom: 3px solid @yellow;
}
/* critical */
#battery.critical,
#cpu.critical,
#memory.critical {
border-bottom: 3px solid @red;
}