[WIP] idk

This commit is contained in:
Andrea Ciceri 2022-09-30 17:23:48 +02:00
parent dd4cbbb517
commit 132b6634d7
No known key found for this signature in database
GPG key ID: A1FC89532D1C5654
13 changed files with 285 additions and 63 deletions

View file

@ -0,0 +1,90 @@
{
pkgs,
lib,
...
}: {
imports = [
./waybar.nix
../foot
];
config = {
home.packages = with pkgs; [wl-clipboard];
services.network-manager-applet.enable = true;
services.blueman-applet.enable = true;
services.pasystray.enable = true;
xsession.enable = true;
services.udiskie.enable = true;
gtk = {
enable = true;
font.name = "DejaVu Sans";
iconTheme = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
};
};
wayland = {
windowManager.sway = let
modifier = "Mod4";
in {
enable = true;
wrapperFeatures.gtk = true;
config = {
modifier = modifier;
menu = "${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0";
output = let
bg = "${./wallpaper.png} fill";
in {
DP-1 = {
pos = "0 0";
inherit bg;
};
eDP-1 = {
inherit bg;
};
};
#fonts = [ "Font Awesome" "Fira Code" ];
terminal = "footclient";
bars = [
{
command = "${pkgs.waybar}/bin/waybar";
}
];
floating.criteria = [
{title = "MetaMask Notification.*";}
{title = "Volume Control";} # pavucontrol
];
input = {
"*" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
};
keybindings = let
screenshotScript = pkgs.writeShellScript "screenshot.sh" ''
filename="$HOME/shots/$(date --iso-8601=seconds).png"
coords="$(${pkgs.slurp}/bin/slurp)"
${pkgs.grim}/bin/grim -t png -g "$coords" $filename
wl-copy -t image/png < $filename
'';
in
lib.mkOptionDefault {
"${modifier}+x" = "exec emacsclient -c";
"${modifier}+b" = "exec qutebrowser";
"${modifier}+s" = "exec ${screenshotScript}";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%";
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
};
};
extraConfig = ''
bindsym ${modifier}+p move workspace to output right
'';
xwayland = true;
systemdIntegration = true;
};
};
};
}

63
hmModules/sway/style.css Normal file
View file

@ -0,0 +1,63 @@
* {
border: none;
font-family: "Fira Code";
font-weight: bold;
font-size: 9pt;
min-height: 0;
}
window#waybar {
background-color: rgba(43, 48, 59, 0.5);
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window .modules-right * {
margin: 0 1rem;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #ffffff;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
}
#workspaces button.current_output {
border-bottom: 3px solid #64727D;
}
#workspaces button.focused {
background-color: #64727D;
}
#workspaces button.focused.current_output {
border-bottom: 3px solid #ffffff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
label:focus {
background-color: #000000;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

69
hmModules/sway/waybar.nix Normal file
View file

@ -0,0 +1,69 @@
{pkgs, ...}: {
programs.waybar = {
enable = true;
style = builtins.readFile ./style.css;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
modules-left = [
"sway/mode"
"sway/workspaces"
];
modules-center = ["sway/window"];
modules-right = [
"tray"
"network"
"cpu"
"memory"
"pulseaudio"
"clock"
"backlight"
"battery"
];
"sway/workspaces" = {
all-outputs = true;
disable-scroll-wraparound = true;
};
"sway/mode" = {tooltip = false;};
"sway/window" = {max_length = 50;};
pulseaudio = {
format = "vol {volume}%";
on-click-middle = "${pkgs.sway}/bin/swaymsg exec \"${pkgs.pavucontrol}/bin/pavucontrol\"";
};
network = {
format-wifi = "{essid} {signalStrength}% {bandwidthUpBits} {bandwidthDownBits}";
format-ethernet = "{ifname} eth {bandwidthUpBits} {bandwidthDownBits}";
};
cpu = {
interval = 2;
format = "{icon} {usage}";
};
memory.format = "mem {}%";
backlight = {
format = "nit {percent}%";
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s +5%";
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
};
tray.spacing = 10;
clock.format = "{:%a %b %d %H:%M}";
battery = {
format = "bat {}";
};
};
};
};
}