PS2VFJMZVN77RHZFVUVD2DA3MZNMXYPHT6XRHW2EUTZRGLAXF4YQC
{ config, pkgs, ... }:
{
config.xdg.configFile."nwg-launchers/nwgbar/icons".source = ./icons;
config.xdg.configFile."nwg-launchers/nwgbar/bar.json".text = ''
[
{
"name": "Lock screen",
"exec": "swaylock -f -c 000000",
"icon": "${config.xdg.configHome}/nwg-luanchers/nwgbar/icons/system-lock-screen.svg"
},
{
"name": "Logout",
"exec": "swaynag -t warning -m 'close sway and wayland?' -b 'yes' 'swaymsg exit'",
"icon": "${config.xdg.configHome}/nwg-luanchers/nwgbar/icons/system-log-out.svg"
},
{
"name": "Reboot",
"exec": "systemctl reboot",
"icon": "${config.xdg.configHome}/nwg-luanchers/nwgbar/icons/system-reboot.svg"
},
{
"name": "Shutdown",
"exec": "systemctl -i poweroff",
"icon": "${config.xdg.configHome}/nwg-luanchers/nwgbar/icons/system-shutdown.svg"
}
]
'';
config.xdg.configFile."nwg-launchers/nwgbar/style.css".text = ''
#bar {
margin: 30px /* affects top/bottom & left/right alignment */
}
button, image {
background: none;
border-style: none;
box-shadow: none;
color: #999
}
button {
padding-left: 10px;
padding-right: 10px;
margin: 5px
}
button:hover {
background-color: rgba (255, 255, 255, 0.1)
}
button:focus {
box-shadow: 0 0 2px;
}
grid {
/* e.g. for common background to all buttons */
}
'';
config.home.packages = with pkgs; [ nwg-launchers ];
}
# back port of
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/misc/nwg-drawer/default.nix#L29
{ lib
, buildGoModule
, fetchFromGitHub
, pkg-config
, cairo
, gobject-introspection
, gtk3
, gtk-layer-shell
}:
buildGoModule rec {
pname = "nwg-bar";
version = "0.1.7";
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = pname;
rev = "v${version}";
sha256 = "sha256-WUYWS0pkYJwXadhlZDHIl9BuirLTu5TNITZ+cBMArVw=";
};
vendorSha256 = "sha256-HyrjquJ91ddkyS8JijHd9HjtfwSQykXCufa2wzl8RNk=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ cairo gobject-introspection gtk3 gtk-layer-shell ];
meta = with lib; {
description = "Application drawer for sway Wayland compositor";
homepage = "https://github.com/nwg-piotr/nwg-drawer";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ plabadens ];
};
}
ignore-empty-password
font="Source Code Pro"
clock
timestr=%R
datestr=%a, %e of %B
screenshots
fade-in=1
effect-blur=10x2
effect-pixelate=2
effect-scale=0.1
effect-vignette=0.5:1
grace=3
indicator
indicator-idle-visible
indicator-radius=240
indicator-thickness=20
indicator-caps-lock
key-hl-color=880033
separator-color=00000000
inside-color=00000099
inside-clear-color=ffd20400
inside-caps-lock-color=009ddc00
inside-ver-color=d9d8d800
inside-wrong-color=ee2e2400
ring-color=231f20D9
ring-clear-color=231f20D9
ring-caps-lock-color=231f20D9
ring-ver-color=231f20D9
ring-wrong-color=231f20D9
line-color=00000000
line-clear-color=ffd204FF
line-caps-lock-color=009ddcFF
line-ver-color=d9d8d8FF
line-wrong-color=ee2e24FF
text-clear-color=ffd20400
text-ver-color=d9d8d800
text-wrong-color=ee2e2400
bs-hl-color=ee2e24FF
caps-lock-key-hl-color=ffd204FF
caps-lock-bs-hl-color=ee2e24FF
disable-caps-lock-text
text-caps-lock-color=009ddc
window {
background: black;
color: white;
opacity: 0.9;
}
/* search entry */
entry {
background: black;
}
button, image {
background: none;
border: none
}
button:hover {
background: white;
opacity: 0.1;
}
/* in case you wanted to give category buttons a different look */
#category-button {
margin: 0 10px 0 10px
}
#pinned-box {
padding-bottom: 5px;
border-bottom: 1px dotted gray
}
#files-box {
padding: 5px;
border: 1px dotted gray;
border-radius: 15px
}
{ lib
, buildGoModule
, fetchFromGitHub
, pkg-config
, cairo
, gobject-introspection
, gtk3
, gtk-layer-shell
}:
buildGoModule rec {
pname = "nwg-bar";
version = "0.0.1";
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = pname;
rev = "v${version}";
sha256 = "1hmnl94i72xafdkvafssicwnd2bc82fahvvhg6761mra5p5cyidn";
};
vendorSha256 = "sha256-HyrjquJ91ddkyS8JijHd9HjtfwSQykXCufa2wzl8RNk=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ cairo gobject-introspection gtk3 gtk-layer-shell ];
meta = with lib; {
description = "GTK3-based button bar for sway and other wlroots-based compositors";
homepage = "https://github.com/nwg-piotr/nwg-bar";
license = licenses.mit;
platforms = platforms.linux;
# maintainers = with maintainers; [ plabadens ];
};
}
window {
background: black;
opacity: 0.9;
}
/* Outer bar container, takes all the window width/height */
#outer-box {
margin: 0px
}
/* Inner bar container, surrounds buttons */
#inner-box {
background: black;
opacity: 0.9;
border-radius: 10px;
border-style: none;
border-width: 1px;
border-color: tan;
padding: 5px;
margin: 5px
}
button, image {
background: none;
border: none;
box-shadow: none
}
button {
padding-left: 10px;
padding-right: 10px;
margin: 5px
}
button:hover {
background: white;
opacity: 0.1;
}
"${modkey}+t" = "exec ${cfg.terminal}";
"${modkey}+q" = "kill";
"${modkey}+space" = "exec ${pkgs.nwg-launchers}/bin/nwgdmenu";
"XF86LaunchB" = "exec ${pkgs.nwg-launchers}/bin/nwggrid";
"${modkey}+Shift+q" = "exec ${pkgs.nwg-launchers}/bin/nwgbar";
config.wayland.windowManager.sway.config.keybindings = {
"${modkey}+t" = "exec ${cfg.terminal}";
"${modkey}+q" = "kill";
"${modkey}+space" = "exec ${pkgs.nwg-launchers}/bin/nwgdmenu";
"XF86LaunchB" = "exec ${nwg-drawer}/bin/nwg-drawer";
"${modkey}+Shift+q" = "exec ${nwg-bar}/bin/nwg-bar";
"${modkey}+${cfg.left}" = "focus left";
"${modkey}+${cfg.down}" = "focus down";
"${modkey}+${cfg.up}" = "focus up";
"${modkey}+${cfg.right}" = "focus right";
"${modkey}+${cfg.left}" = "focus left";
"${modkey}+${cfg.down}" = "focus down";
"${modkey}+${cfg.up}" = "focus up";
"${modkey}+${cfg.right}" = "focus right";
"${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}+Shift+${cfg.left}" = "move left";
"${modkey}+Shift+${cfg.down}" = "move down";
"${modkey}+Shift+${cfg.up}" = "move up";
"${modkey}+Shift+${cfg.right}" = "move right";
"${modkey}+b" = "splith";
"${modkey}+v" = "splitv";
"${modkey}+f" = "fullscreen toggle";
"${modkey}+a" = "focus parent";
"${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}+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+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";
config.xdg.configFile."nwg-panel/drawer.css".source = ./nwg-panel.css;
config.xdg.configFile."nwg-bar/style.css".source = ./nwg-bar.css;
config.xdg.configFile."nwg-bar/icons".source = ./icons;
config.xdg.configFile."nwg-bar/bar.json".text = ''
[
{
"label": "Lock screen",
"exec": "${pkgs.swaylock-effects}/bin/swaylock -f -c 000000",
"icon": "${config.xdg.configHome}/nwg-bar/icons/system-lock-screen.svg"
},
{
"label": "Logout",
"exec": "swaynag -t warning -m 'close sway and wayland?' -b 'yes' 'swaymsg exit'",
"icon": "${config.xdg.configHome}/nwg-bar/icons/system-log-out.svg"
},
{
"label": "Reboot",
"exec": "systemctl reboot",
"icon": "${config.xdg.configHome}/nwg-bar/icons/system-reboot.svg"
},
{
"label": "Shutdown",
"exec": "systemctl -i poweroff",
"icon": "${config.xdg.configHome}/nwg-bar/icons/system-shutdown.svg"
}
]
'';
config.xdg.configFile."swaylock/config".source = ./swaylock.config;