4PEXC6EE4FNTPUYT64XDSOD6X5IVDY3Y2QDKYTSHEBOYS4JATQTQC
ENRHXIAOXEVZGED76KL4CZJ5SPZDX5IRS3WICJ22WRKSCCU6IC2QC
WDE4LLYP24YKDAV6PW62DFNWV3WZWQUUPA7CZH6STDZFYU7ARERQC
NJ5ENURMCBSNFQPNXXNUBMUXVJEBIGNH2T7EWGB63F3FV723BUWAC
QRSG7RJSX5R255Y2HHTLYBXMBR374QS3PV2UJDWK2ZPMG7V66SSAC
KJ423ITE6PMMXBXVIW6CMUB435OQKM3ECO2TEXFA555HRSZCVHOAC
TEJLAHEG6JYVPWBHUHIO6NTSB7HO62RJ6G5J2B6UNPDVG7XK4XIAC
* {
border: none;
border-radius: 0;
font-family: "Source Code Pro";
font-size: 13px;
min-height: 0;
}
window#waybar {
background: darkslategrey;
color: white;
opacity: 0.7;
}
#window {
font-weight: bold;
}
#workspaces {
padding: 0 5px;
}
#workspaces button {
padding: 0 5px;
background: transparent;
color: white;
border-top: 2px solid transparent;
}
#workspaces button.focused {
color: orchid;
border-top: 2px solid orchid;
}
#mode {
background: slategray;
border-bottom: 3px solid white;
}
#clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode {
padding: 0 3px;
margin: 0 2px;
}
#clock {
font-weight: bold;
}
#battery {
}
#battery icon {
color: red;
}
#battery.charging {
}
@keyframes blink {
to {
background-color: white;
color: black;
}
}
#battery.warning:not(.charging) {
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu {
}
#memory {
}
#network {
}
#network.disconnected {
background: red;
}
#pulseaudio {
}
#pulseaudio.muted {
}
#custom-spotify {
color: lightgreen
}
#tray {
}
{ pkgs, ... }:
{
enable = true;
systemd.enable = true;
style = builtins.readFile ./waybar_style.css;
settings = [
{
layer = "top";
position = "top";
height = 24;
modules-left = ["sway/workspaces" "sway/mode" "custom/spotify"];
modules-center = [ "clock" "sway/window" ];
modules-right = [ "pulseaudio" "network" "bluetooth" "cpu" "memory" "battery" ];
modules = {
"sway/workspaces" = {
disable-scroll = true;
all-outputs = false;
format = "{icon}";
format-icons = {
"1:web" = "1: 🖥";
"2:code" = "2: ";
"3:term" = "3: ";
"4:work" = "4: ";
"5:music" = "5: ";
"6:docs" = "6: ✍";
urgent = "🔥";
focused = "";
default = "";
};
};
"sway/mode".format = "<span style=\"italic\">{}</span>";
clock = {
format = "{:%I:%M %p}";
format-alt = "{:%Y-%m-%d}";
};
cpu.format = "CPU{usage}%";
memory.format = "MEM{}%";
battery = {
bat = "BAT0";
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-good = ""; # An empty format will hide the module
format-full = "";
format-icons = [ "" "" "" "" "" ];
};
network = {
# interface = "wlp2s0"; # (Optional) To force the use of this interface
format-wifi = "";
format-ethernet = "";
format-disconnected = "⚠";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "ethernet: {ifname}: {ipaddr}/{cidr}";
tooltip-format-disconnected = "Disconnected";
};
pulseaudio = {
# scroll-step = 1;
format = "{volume}% {icon}";
format-bluetooth = "{volume}% {icon}";
format-muted = "";
format-icons = {
headphones = "";
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" ];
};
on-click = "pavucontrol";
};
"custom/spotify" = {
format = " {}";
max-length = 40;
interval = 30; # Remove this if your script is endless and write in loop
exec = pkgs.writeShellScript "mediaplayer" (builtins.readFile ./playerctl.sh);
# exec-if = "pgrep spotify";
};
};
}
];
}
player_status=$(playerctl status 2> /dev/null)
if [ "$player_status" = "Playing" ]; then
echo "$(playerctl metadata artist) - $(playerctl metadata title)"
elif [ "$player_status" = "Paused" ]; then
echo " $(playerctl metadata artist) - $(playerctl metadata title)"
else
echo "$(playerctl status): $(playerctl metadata title)"
fi
in {
config.wayland.windowManager.sway = {
enable = true;
config = {
bars = [];
gaps = {
inner = 2;
outer = 2;
smartGaps = true;
};
keybindings = {
"${modkey}+t" = "exec ${cfg.terminal}";
"${modkey}+q" = "kill";
"${modkey}+space" = "exec ${cfg.menu}";
"${modkey}+Shift+${cfg.left}" = "move left";
"${modkey}+Shift+${cfg.down}" = "move down";
"${modkey}+Shift+${cfg.up}" = "move up";
"${modkey}+Shift+${cfg.right}" = "move right";
"${modkey}+${cfg.left}" = "focus left";
"${modkey}+${cfg.down}" = "focus down";
"${modkey}+${cfg.up}" = "focus up";
"${modkey}+${cfg.right}" = "focus right";
"${modkey}+b" = "splith";
"${modkey}+v" = "splitv";
"${modkey}+f" = "fullscreen toggle";
"${modkey}+a" = "focus parent";
"${modkey}+Shift+${cfg.left}" = "move left";
"${modkey}+Shift+${cfg.down}" = "move down";
"${modkey}+Shift+${cfg.up}" = "move up";
"${modkey}+Shift+${cfg.right}" = "move right";
"${modkey}+ctrl+s" = "layout stacking";
"${modkey}+ctrl+w" = "layout tabbed";
"${modkey}+ctrl+e" = "layout toggle split";
"${modkey}+s" = "layout stacking";
"${modkey}+w" = "layout tabbed";
"${modkey}+e" = "layout toggle split";
"${modkey}+1" = "workspace number 1";
"${modkey}+2" = "workspace number 2";
"${modkey}+3" = "workspace number 3";
"${modkey}+4" = "workspace number 4";
"${modkey}+5" = "workspace number 5";
"${modkey}+6" = "workspace number 6";
"${modkey}+7" = "workspace number 7";
"${modkey}+8" = "workspace number 8";
"${modkey}+9" = "workspace number 9";
"${modkey}+ctrl+l" = "workspace next";
"${modkey}+ctrl+h" = "workspace prev";
"${modkey}+ctrl+p" = "workspace back_and_forth";
"${modkey}+Shift+space" = "floating toggle";
# "${modkey}+space" = "focus mode_toggle";
"${modkey}+Shift+s" = "sticky toggle";
"${modkey}+1" = "workspace number 1";
"${modkey}+2" = "workspace number 2";
"${modkey}+3" = "workspace number 3";
"${modkey}+4" = "workspace number 4";
"${modkey}+5" = "workspace number 5";
"${modkey}+6" = "workspace number 6";
"${modkey}+7" = "workspace number 7";
"${modkey}+8" = "workspace number 8";
"${modkey}+9" = "workspace number 9";
"${modkey}+ctrl+l" = "workspace next";
"${modkey}+ctrl+h" = "workspace prev";
"${modkey}+ctrl+p" = "workspace back_and_forth";
"${modkey}+Shift+1" = "move container to workspace number 1";
"${modkey}+Shift+2" = "move container to workspace number 2";
"${modkey}+Shift+3" = "move container to workspace number 3";
"${modkey}+Shift+4" = "move container to workspace number 4";
"${modkey}+Shift+5" = "move container to workspace number 5";
"${modkey}+Shift+6" = "move container to workspace number 6";
"${modkey}+Shift+7" = "move container to workspace number 7";
"${modkey}+Shift+8" = "move container to workspace number 8";
"${modkey}+Shift+9" = "move container to workspace number 9";
"${modkey}+Shift+minus" = "move scratchpad";
"${modkey}+minus" = "scratchpad show";
"${modkey}+Shift+c" = "reload";
"${modkey}+Shift+q" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${modkey}+r" = "mode resize";
};
input = {
"*" = { natural_scroll = "enabled"; };
"touchpad" = { tap = "enabled"; };
};
workspaceAutoBackAndForth = true;
};
wrapperFeatures = {
base = true;
gtk = true;
};
};
"${modkey}+Shift+1" = "move container to workspace number 1";
"${modkey}+Shift+2" = "move container to workspace number 2";
"${modkey}+Shift+3" = "move container to workspace number 3";
"${modkey}+Shift+4" = "move container to workspace number 4";
"${modkey}+Shift+5" = "move container to workspace number 5";
"${modkey}+Shift+6" = "move container to workspace number 6";
"${modkey}+Shift+7" = "move container to workspace number 7";
"${modkey}+Shift+8" = "move container to workspace number 8";
"${modkey}+Shift+9" = "move container to workspace number 9";
config.programs.waybar = {
enable = true;
systemd.enable = true;
settings = [
{
layer = "top";
position = "top";
modules-left = [];
# modules = {
# "custom/hello-from-waybar" = {
# format = "sup {}";
# max-length = 40;
# interval = "once";
# exec = pkgs.writeShellScript "hello-from-waybar" ''
# echo "from within waybar bitches"
# '';
# };
# };
}
];
};
"${modkey}+Shift+minus" = "move scratchpad";
"${modkey}+minus" = "scratchpad show";
# notifications daemon
config.programs.mako = {
enable = true;
anchor = "top-center";
defaultTimeout = 1000750;
};
"${modkey}+Shift+c" = "reload";
"${modkey}+Shift+q" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
{ config, pkgs, lib, ... }:
let
cfg = config.wayland.windowManager.sway.config;
modkey = cfg.modifier;
in {
config.wayland.windowManager.sway = {
enable = true;
config.bars = [];
config.floating.criteria = [ { class = "Pavucontrol"; } ];
config.floating.titlebar = true;
config.gaps.inner = 3;
config.gaps.outer = 3;
config.gaps.smartGaps = true;
config.input."*".natural_scroll = "enabled";
config.input."touchpad".tap = "enabled";
config.keybindings = import ./keybindings.nix { modkey = modkey; cfg = cfg; };
config.workspaceAutoBackAndForth = true;
wrapperFeatures.base = true;
wrapperFeatures.gtk = true;
extraSessionCommands = ''
export MOZ_ENABLE_WAYLAND=1
'';
};
config.programs.waybar = import ./waybar.nix { pkgs = pkgs; };
# notifications daemon
config.programs.mako = {
enable = true;
anchor = "top-center";
defaultTimeout = 1750;
};
config.xdg.configFile."swappy/config".text = ''
[Default]
save_dir=$HOME/screenshots
save_filename_format=%Y%m%d-%H%M%S-screenshot.png
show_panel=false
line_size=5
text_size=20
text_font=sans-serif
'';
config.home.packages = with pkgs; [
source-code-pro
libnotify
mpv
imv
pavucontrol
playerctl
wl-clipboard
#####################
# screenshot utiities
#####################
grim
slurp
swappy
];
}