[sway] add base config

This commit is contained in:
Gregory Trolliet 2024-11-09 16:25:08 +01:00
parent 98db250e23
commit de2e980e62
9 changed files with 656 additions and 0 deletions

99
.config/waybar/config Normal file
View file

@ -0,0 +1,99 @@
#================================================================================#
# Waybar Configuration File #
#--------------------------------------------------------------------------------#
# Purpose: Creates a minimalistic (yet functional) waybar at #
# the top of the screen. #
# themes and colors, set the wallpaper, and more. #
# #
# License: Creative Commons Attribution 4.0 International #
# Source: https:#www.learnlinux.tv #
# Author:Gregory Trolliet <gregory@trolliet.info #
# #
# Credit: #
# Battery section adapted from: #
# https://github.com/Egosummiki/dotfiles/blob/master/waybar/config #
# #
# Pipewire audio adapted from: #
# https://www.reddit.com/r/swaywm/comments/sks343/ #
# pwvolume_pipewire_volume_control_and_waybar_module #
#================================================================================#
{
"layer": "top",
"position": "top",
"height": 36,
"spacing": 4,
"margin-top": 0,
"margin-bottom": 0,
// Choose the order of the modules
"modules-center": ["sway/workspaces", "tray"],
"modules-left": ["custom/hostname"],
"modules-right": [ "custom/audio","custom/light","network","battery","clock"],
// Configuration for individual modules
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{name}",
},
"tray": {
"icon-size": 18,
"spacing": 10,
},
"clock": {
"timezone": "Europe/Zurich",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}",
"on-click-right": "/usr/bin/alacritty -e khal interactive -d 'Abysses (Association Sub-Session)'"
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15,
},
"format": "{icon} {capacity}%",
"format-charging": "⚡{capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""],
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": " {signalStrength}%",
"format-ethernet": "Connected  ",
"tooltip-format": "{ifname}: {gwaddr}",
"format-linked": "{ifname} (No IP)",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"on-click-right": "bash ~/.config/rofi/wifi_menu/rofi-wifi-menu.sh",
},
"custom/audio": {
"format": "{}",
"signal": 8,
"interval": "once",
"exec": "/home/raghnarok/.config/sway/audio.sh",
"on-click": "pavucontrol",
},
"custom/light": {
"format": "{}",
"interval": 1,
"exec": "/home/raghnarok/.config/sway/light.sh",
},
"custom/hostname": {
"format": "💻 {}",
"exec": "/usr/bin/hostname -f",
"interval": "once",
"on-click": "/usr/bin/rxvt -e /usr/bin/htop",
},

120
.config/waybar/style.css Normal file
View file

@ -0,0 +1,120 @@
* {
font-family: Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
min-height: 0;
padding-bottom: 2px;
padding-top: 2px;
background: #1f1f1f;
}
#battery {
background: transparent;
color: #ffffff;
opacity: 0.7;
padding: 2px 8px;
}
#battery.charging, #battery.plugged {
color: #ffffff;
padding: 2px 8px;
}
#battery.critical:not(.charging) {
animation-direction: alternate;
animation-duration: 0.5s;
animation-iteration-count: infinite;
animation-name: blink;
animation-timing-function: linear;
background-color: #f53c3c;
color: gray;
}
#clock {
background: #1f1f1f;
color: #ffffff;
margin-right: 4px;
padding: 2px 8px;
}
#network {
background: transparent;
color: #ffffff;
opacity: 0.7;
padding: 2px 8px;
}
#network.disconnected {
background: #1f1f1f;
color: red;
}
#tray {
background: #1f1f1f;
color: #ffffff;
margin-left: 18px;
}
#tray > .passive {
-gtk-icon-effect: dim;
background: #1f1f1f;
color: #ffffff;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background: #1f1f1f;
color: #ffffff;
}
window#waybar {
background: transparent;
border-bottom: 1px solid #332b2b;
transition-duration: .2s;
transition-property: background-color;
}
#workspaces button:hover {
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
background: @background;
border-bottom: 1px solid #ffffff;
box-shadow: inherit;
color: #ffffff;
}
#workspaces button {
background: transparent;
color: #ffffff;
margin-left: 2px;
margin-right: 2px;
opacity: 0.7;
}
#workspaces button.focused {
background: black;
color: #ffffff;
opacity: 0.8;
}
#workspaces button.focused label {
background: black;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
/* Custom Stuff */
#custom-audio {
background: transparent;
color: #ffffff;
opacity: 0.7;
padding: 2px 8px;
}
#custom-hostname {
background: transparent;
color: #ffffff;
padding: 2px 8px;
opacity: 0.7;
}