[WIP] idk
This commit is contained in:
parent
dd4cbbb517
commit
132b6634d7
13 changed files with 285 additions and 63 deletions
|
@ -4,6 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.emacs.enable = true;
|
||||
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs28NativeComp;
|
||||
|
@ -12,7 +13,6 @@
|
|||
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
extraOptions = ["-f" "exwm-enable"];
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
|
|
25
hmModules/foot/default.nix
Normal file
25
hmModules/foot/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
server.enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
||||
font = "Fira Code:size=11";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# without `--login-shell` PATH isn't well configured (it's inherited from the "systemd shell")
|
||||
systemd.user.services.foot.Service.ExecStart = lib.mkForce "${config.programs.foot.package}/bin/foot --server --login-shell";
|
||||
}
|
|
@ -72,7 +72,7 @@
|
|||
NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh";
|
||||
PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT";
|
||||
};
|
||||
loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec startx";
|
||||
loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec sway";
|
||||
envExtra = ''
|
||||
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' # for Emacs TRAMP mode
|
||||
'';
|
||||
|
|
90
hmModules/sway/default.nix
Normal file
90
hmModules/sway/default.nix
Normal 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
63
hmModules/sway/style.css
Normal 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;
|
||||
}
|
BIN
hmModules/sway/wallpaper.png
Normal file
BIN
hmModules/sway/wallpaper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
69
hmModules/sway/waybar.nix
Normal file
69
hmModules/sway/waybar.nix
Normal 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 {}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue