more fixes

This commit is contained in:
Greg Burd 2023-09-20 10:02:15 -04:00
parent c368bb7044
commit 44f9cfcb17
No known key found for this signature in database
GPG key ID: 1FC1E7793410DE46
20 changed files with 1016 additions and 1272 deletions

View file

@ -2,11 +2,10 @@
imports = [
./deluge.nix
./discord.nix
./dragon.nix
./firefox.nix
./font.nix
./gtk.nix
./kdeconnect.nix
# ./kdeconnect.nix
./pavucontrol.nix
./playerctl.nix
./qt.nix

View file

@ -7,10 +7,10 @@
bookmarks = { };
extensions = with pkgs.inputs.firefox-addons; [
ublock-origin
keybase
# tampermonkey
# proton-pass
# onetab
keybase
# tampermonkey
# proton-pass
# onetab
];
bookmarks = { };
settings = {
@ -32,8 +32,8 @@
home = {
persistence = {
# Not persisting is safer
# "/persist/home/gburd".directories = [ ".mozilla/firefox" ];
# Not persisting is safer, but... <shrug>
"/persist/home/gburd".directories = [ ".mozilla/firefox" ];
};
};

View file

@ -3,33 +3,35 @@
imports = [];
home.packages = with pkgs; [
gtk3 # For gtk-launch
xdg-utils-spawn-terminal # Patched to open terminal
# Gnome3 apps
gnome3.eog # image viewer
gnome3.evince # pdf reader
# Desktop look & feel
gnome3.gnome-tweak-tool
# Extensions
gnomeExtensions.appindicator
gnomeExtensions.dash-to-dock
];
# environment.gnome.excludePackages = (with pkgs; [
# gnome-photos
# gnome-tour
# ]) ++ (with pkgs.gnome; [
# cheese # webcam tool
# gnome-music
# gedit # text editor
# epiphany # web browser
# geary # email reader
# gnome-characters
# tali # poker game
# iagno # go game
# hitori # sudoku game
# atomix # puzzle game
# yelp # Help view
# gnome-contacts
# gnome-initial-setup
# ]);
# programs.dconf.enable = true;
# environment.systemPackages = with pkgs; [
# gnome.gnome-tweaks
# ]
# };
# environment.gnome.excludePackages = (with pkgs; [
# gnome-photos
# gnome-tour
# ]) ++ (with pkgs.gnome; [
# cheese # webcam tool
# gnome-music
# geary # email reader
# gnome-characters
# yelp # Help view
# gnome-contacts
# gnome-initial-setup
# ]);
# programs.dconf.enable = true;
# environment.systemPackages = with pkgs; [
# gnome.gnome-tweaks
# ]
# };
home.sessionVariables = {
};

View file

@ -0,0 +1,39 @@
{ pkgs, ... }:
{
imports = [
./hyprland-vnc.nix
./gammastep.nix
./kitty.nix
./mako.nix
./qutebrowser.nix
./swayidle.nix
./swaylock.nix
./waybar.nix
./wofi.nix
./zathura.nix
];
xdg.mimeApps.enable = true;
home.packages = with pkgs; [
grim
gtk3 # For gtk-launch
imv
mimeo
primary-xwayland
pulseaudio
slurp
waypipe
wf-recorder
wl-clipboard
wl-mirror
wl-mirror-pick
xdg-utils-spawn-terminal # Patched to open terminal
ydotool
];
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
QT_QPA_PLATFORM = "wayland";
LIBSEAT_BACKEND = "logind";
};
}

View file

@ -0,0 +1,13 @@
{
services.gammastep = {
enable = true;
provider = "geoclue2";
temperature = {
day = 6000;
night = 4600;
};
settings = {
general.adjustment-method = "wayland";
};
};
}

View file

@ -0,0 +1,35 @@
{ pkgs, lib, config, ... }:
let
enabledMonitors = lib.filter (m: m.enabled) config.monitors;
# A nice VNC script for remotes running hyprland
vncsh = pkgs.writeShellScriptBin "vnc.sh" ''
ssh $1 bash <<'EOF'
pgrep "wayvnc" && exit
export HYPRLAND_INSTANCE_SIGNATURE="$(ls /tmp/hypr/ -lt | head -2 | tail -1 | rev | cut -d ' ' -f1 | rev)"
export WAYLAND_DISPLAY="wayland-1"
ip="$(ip addr show dev tailscale0 | grep 'inet ' | xargs | cut -d ' ' -f2 | cut -d '/' -f1)"
xpos="$(hyprctl monitors -j | jq -r 'sort_by(.x)[-1] | .x + .width')"
${lib.concatLines (lib.forEach enabledMonitors (m: ''
hyprctl output create headless
monitor="$(hyprctl monitors -j | jq -r 'map(.name)[-1]')"
hyprctl keyword monitor $monitor,${toString m.width}x${toString m.height}@${toString m.refreshRate},$(($xpos + ${toString m.x}))x${toString m.y},1
screen -d -m wayvnc -k br -S /tmp/vnc-${m.workspace} -f 60 -o $monitor $ip 590${m.workspace}
sudo iptables -I INPUT -j ACCEPT -p tcp --dport 590${m.workspace}
''))}
EOF
${lib.concatLines (lib.forEach enabledMonitors (m: ''
vncviewer $1::590${m.workspace} &
''))}
wait
'';
in
{
home.packages = with pkgs; [
vncsh
wayvnc
tigervnc
];
}

View file

@ -0,0 +1,66 @@
{ config, pkgs, ... }:
let
inherit (config.colorscheme) colors;
kitty-xterm = pkgs.writeShellScriptBin "xterm" ''
${config.programs.kitty.package}/bin/kitty -1 "$@"
'';
in
{
home = {
packages = [ kitty-xterm ];
sessionVariables = {
TERMINAL = "kitty -1";
};
};
programs.kitty = {
enable = true;
font = {
name = config.fontProfiles.monospace.family;
size = 12;
};
settings = {
shell_integration = "no-rc"; # I prefer to do it manually
scrollback_lines = 4000;
scrollback_pager_history_size = 2048;
window_padding_width = 15;
foreground = "#${colors.base05}";
background = "#${colors.base00}";
selection_background = "#${colors.base05}";
selection_foreground = "#${colors.base00}";
url_color = "#${colors.base04}";
cursor = "#${colors.base05}";
active_border_color = "#${colors.base03}";
inactive_border_color = "#${colors.base01}";
active_tab_background = "#${colors.base00}";
active_tab_foreground = "#${colors.base05}";
inactive_tab_background = "#${colors.base01}";
inactive_tab_foreground = "#${colors.base04}";
tab_bar_background = "#${colors.base01}";
color0 = "#${colors.base00}";
color1 = "#${colors.base08}";
color2 = "#${colors.base0B}";
color3 = "#${colors.base0A}";
color4 = "#${colors.base0D}";
color5 = "#${colors.base0E}";
color6 = "#${colors.base0C}";
color7 = "#${colors.base05}";
color8 = "#${colors.base03}";
color9 = "#${colors.base08}";
color10 = "#${colors.base0B}";
color11 = "#${colors.base0A}";
color12 = "#${colors.base0D}";
color13 = "#${colors.base0E}";
color14 = "#${colors.base0C}";
color15 = "#${colors.base07}";
color16 = "#${colors.base09}";
color17 = "#${colors.base0F}";
color18 = "#${colors.base01}";
color19 = "#${colors.base02}";
color20 = "#${colors.base04}";
color21 = "#${colors.base06}";
};
};
}

View file

@ -0,0 +1,23 @@
{ config, ... }:
let inherit (config.colorscheme) colors kind;
in {
services.mako = {
enable = true;
iconPath =
if kind == "dark" then
"${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else
"${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${config.fontProfiles.regular.family} 12";
padding = "10,20";
anchor = "top-center";
width = 400;
height = 150;
borderSize = 2;
defaultTimeout = 12000;
backgroundColor = "#${colors.base00}dd";
borderColor = "#${colors.base03}dd";
textColor = "#${colors.base05}dd";
layer = "overlay";
};
}

View file

@ -0,0 +1,177 @@
{ config, pkgs, ... }:
let inherit (config.colorscheme) colors kind;
in
{
home.persistence = {
"/persist/home/misterio".directories = [
".config/qutebrowser/bookmarks"
".config/qutebrowser/greasemonkey"
".local/share/qutebrowser"
];
};
xdg.mimeApps.defaultApplications = {
"text/html" = [ "org.qutebrowser.qutebrowser.desktop" ];
"text/xml" = [ "org.qutebrowser.qutebrowser.desktop" ];
"x-scheme-handler/http" = [ "org.qutebrowser.qutebrowser.desktop" ];
"x-scheme-handler/https" = [ "org.qutebrowser.qutebrowser.desktop" ];
"x-scheme-handler/qute" = [ "org.qutebrowser.qutebrowser.desktop" ];
};
programs.qutebrowser = {
enable = true;
loadAutoconfig = true;
settings = {
editor.command = [ "xdg-open" "{file}" ];
tabs = {
show = "multiple";
position = "left";
tree_tabs = true;
};
fonts = {
default_family = config.fontProfiles.regular.family;
default_size = "12pt";
};
colors = {
webpage = {
preferred_color_scheme = kind;
bg = "#ffffff";
};
completion = {
fg = "#${colors.base05}";
match.fg = "#${colors.base09}";
even.bg = "#${colors.base00}";
odd.bg = "#${colors.base00}";
scrollbar = {
bg = "#${colors.base00}";
fg = "#${colors.base05}";
};
category = {
bg = "#${colors.base00}";
fg = "#${colors.base0D}";
border = {
bottom = "#${colors.base00}";
top = "#${colors.base00}";
};
};
item.selected = {
bg = "#${colors.base02}";
fg = "#${colors.base05}";
match.fg = "#${colors.base05}";
border = {
bottom = "#${colors.base02}";
top = "#${colors.base02}";
};
};
};
contextmenu = {
disabled = {
bg = "#${colors.base01}";
fg = "#${colors.base04}";
};
menu = {
bg = "#${colors.base00}";
fg = "#${colors.base05}";
};
selected = {
bg = "#${colors.base02}";
fg = "#${colors.base05}";
};
};
downloads = {
bar.bg = "#${colors.base00}";
error.fg = "#${colors.base08}";
start = {
bg = "#${colors.base0D}";
fg = "#${colors.base00}";
};
stop = {
bg = "#${colors.base0C}";
fg = "#${colors.base00}";
};
};
hints = {
bg = "#${colors.base0A}";
fg = "#${colors.base00}";
match.fg = "#${colors.base05}";
};
keyhint = {
bg = "#${colors.base00}";
fg = "#${colors.base05}";
suffix.fg = "#${colors.base05}";
};
messages = {
error.bg = "#${colors.base08}";
error.border = "#${colors.base08}";
error.fg = "#${colors.base00}";
info.bg = "#${colors.base00}";
info.border = "#${colors.base00}";
info.fg = "#${colors.base05}";
warning.bg = "#${colors.base0E}";
warning.border = "#${colors.base0E}";
warning.fg = "#${colors.base00}";
};
prompts = {
bg = "#${colors.base00}";
fg = "#${colors.base05}";
border = "#${colors.base00}";
selected.bg = "#${colors.base02}";
};
statusbar = {
caret.bg = "#${colors.base00}";
caret.fg = "#${colors.base0D}";
caret.selection.bg = "#${colors.base00}";
caret.selection.fg = "#${colors.base0D}";
command.bg = "#${colors.base01}";
command.fg = "#${colors.base04}";
command.private.bg = "#${colors.base01}";
command.private.fg = "#${colors.base0E}";
insert.bg = "#${colors.base00}";
insert.fg = "#${colors.base0C}";
normal.bg = "#${colors.base00}";
normal.fg = "#${colors.base05}";
passthrough.bg = "#${colors.base00}";
passthrough.fg = "#${colors.base0A}";
private.bg = "#${colors.base00}";
private.fg = "#${colors.base0E}";
progress.bg = "#${colors.base0D}";
url.error.fg = "#${colors.base08}";
url.fg = "#${colors.base05}";
url.hover.fg = "#${colors.base09}";
url.success.http.fg = "#${colors.base0B}";
url.success.https.fg = "#${colors.base0B}";
url.warn.fg = "#${colors.base0E}";
};
tabs = {
bar.bg = "#${colors.base00}";
even.bg = "#${colors.base00}";
even.fg = "#${colors.base05}";
indicator.error = "#${colors.base08}";
indicator.start = "#${colors.base0D}";
indicator.stop = "#${colors.base0C}";
odd.bg = "#${colors.base00}";
odd.fg = "#${colors.base05}";
pinned.even.bg = "#${colors.base0B}";
pinned.even.fg = "#${colors.base00}";
pinned.odd.bg = "#${colors.base0B}";
pinned.odd.fg = "#${colors.base00}";
pinned.selected.even.bg = "#${colors.base02}";
pinned.selected.even.fg = "#${colors.base05}";
pinned.selected.odd.bg = "#${colors.base02}";
pinned.selected.odd.fg = "#${colors.base05}";
selected.even.bg = "#${colors.base02}";
selected.even.fg = "#${colors.base05}";
selected.odd.bg = "#${colors.base02}";
selected.odd.fg = "#${colors.base05}";
};
};
};
extraConfig = ''
c.tabs.padding = {"bottom": 10, "left": 10, "right": 10, "top": 10}
'';
};
}

View file

@ -0,0 +1,54 @@
{ pkgs, lib, config, ... }:
let
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
pgrep = "${pkgs.procps}/bin/pgrep";
pactl = "${pkgs.pulseaudio}/bin/pactl";
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
swaymsg = "${config.wayland.windowManager.sway.package}/bin/swaymsg";
isLocked = "${pgrep} -x ${swaylock}";
lockTime = 4 * 60; # TODO: configurable desktop (10 min)/laptop (4 min)
# Makes two timeouts: one for when the screen is not locked (lockTime+timeout) and one for when it is.
afterLockTimeout = { timeout, command, resumeCommand ? null }: [
{ timeout = lockTime + timeout; inherit command resumeCommand; }
{ command = "${isLocked} && ${command}"; inherit resumeCommand timeout; }
];
in
{
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
timeouts =
# Lock screen
[{
timeout = lockTime;
command = "${swaylock} -i ${config.wallpaper} --daemonize";
}] ++
# Mute mic
(afterLockTimeout {
timeout = 10;
command = "${pactl} set-source-mute @DEFAULT_SOURCE@ yes";
resumeCommand = "${pactl} set-source-mute @DEFAULT_SOURCE@ no";
}) ++
# Turn off RGB
(lib.optionals config.services.rgbdaemon.enable (afterLockTimeout {
timeout = 20;
command = "systemctl --user stop rgbdaemon";
resumeCommand = "systemctl --user start rgbdaemon";
})) ++
# Turn off displays (hyprland)
(lib.optionals config.wayland.windowManager.hyprland.enable (afterLockTimeout {
timeout = 40;
command = "${hyprctl} dispatch dpms off";
resumeCommand = "${hyprctl} dispatch dpms on";
})) ++
# Turn off displays (sway)
(lib.optionals config.wayland.windowManager.sway.enable (afterLockTimeout {
timeout = 40;
command = "${swaymsg} 'output * dpms off'";
resumeCommand = "${swaymsg} 'output * dpms on'";
}));
};
}

View file

@ -0,0 +1,43 @@
{ config, pkgs, ... }:
let inherit (config.colorscheme) colors;
in
{
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
effect-blur = "20x3";
fade-in = 0.1;
font = config.fontProfiles.regular.family;
font-size = 15;
line-uses-inside = true;
disable-caps-lock-text = true;
indicator-caps-lock = true;
indicator-radius = 40;
indicator-idle-visible = true;
indicator-y-position = 1000;
ring-color = "#${colors.base02}";
inside-wrong-color = "#${colors.base08}";
ring-wrong-color = "#${colors.base08}";
key-hl-color = "#${colors.base0B}";
bs-hl-color = "#${colors.base08}";
ring-ver-color = "#${colors.base09}";
inside-ver-color = "#${colors.base09}";
inside-color = "#${colors.base01}";
text-color = "#${colors.base07}";
text-clear-color = "#${colors.base01}";
text-ver-color = "#${colors.base01}";
text-wrong-color = "#${colors.base01}";
text-caps-lock-color = "#${colors.base07}";
inside-clear-color = "#${colors.base0C}";
ring-clear-color = "#${colors.base0C}";
inside-caps-lock-color = "#${colors.base09}";
ring-caps-lock-color = "#${colors.base02}";
separator-color = "#${colors.base02}";
};
};
}

View file

@ -0,0 +1,392 @@
{ outputs, config, lib, pkgs, ... }:
let
# Dependencies
cat = "${pkgs.coreutils}/bin/cat";
cut = "${pkgs.coreutils}/bin/cut";
find = "${pkgs.findutils}/bin/find";
grep = "${pkgs.gnugrep}/bin/grep";
pgrep = "${pkgs.procps}/bin/pgrep";
tail = "${pkgs.coreutils}/bin/tail";
wc = "${pkgs.coreutils}/bin/wc";
xargs = "${pkgs.findutils}/bin/xargs";
timeout = "${pkgs.coreutils}/bin/timeout";
ping = "${pkgs.iputils}/bin/ping";
jq = "${pkgs.jq}/bin/jq";
gamemoded = "${pkgs.gamemode}/bin/gamemoded";
systemctl = "${pkgs.systemd}/bin/systemctl";
journalctl = "${pkgs.systemd}/bin/journalctl";
playerctl = "${pkgs.playerctl}/bin/playerctl";
playerctld = "${pkgs.playerctl}/bin/playerctld";
pavucontrol = "${pkgs.pavucontrol}/bin/pavucontrol";
wofi = "${pkgs.wofi}/bin/wofi";
# Function to simplify making waybar outputs
jsonOutput = name: { pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", percentage ? "" }: "${pkgs.writeShellScriptBin "waybar-${name}" ''
set -euo pipefail
${pre}
${jq} -cn \
--arg text "${text}" \
--arg tooltip "${tooltip}" \
--arg alt "${alt}" \
--arg class "${class}" \
--arg percentage "${percentage}" \
'{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}'
''}/bin/waybar-${name}";
in
{
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oa: {
mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ];
});
systemd.enable = true;
settings = {
primary = {
mode = "dock";
layer = "top";
height = 40;
margin = "6";
position = "top";
modules-left = [
"custom/menu"
] ++ (lib.optionals config.wayland.windowManager.sway.enable [
"sway/workspaces"
"sway/mode"
]) ++ (lib.optionals config.wayland.windowManager.hyprland.enable [
"hyprland/workspaces"
"hyprland/submap"
]) ++ [
"custom/currentplayer"
"custom/player"
];
modules-center = [
"pulseaudio"
"battery"
"clock"
"custom/unread-mail"
"custom/gpg-agent"
];
modules-right = [
"network"
"custom/tailscale-ping"
"custom/gamemode"
# TODO: currently broken for some reason
# "custom/gammastep"
"tray"
"custom/hostname"
];
clock = {
interval = 1;
format = "{:%d/%m %H:%M:%S}";
format-alt = "{:%Y-%m-%d %H:%M:%S %z}";
on-click-left = "mode";
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
pulseaudio = {
format = "{icon} {volume}%";
format-muted = " 0%";
format-icons = {
headphone = "󰋋";
headset = "󰋎";
portable = "";
default = [ "" "" "" ];
};
on-click = pavucontrol;
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "󰒳";
deactivated = "󰒲";
};
};
battery = {
bat = "BAT0";
interval = 10;
format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
format = "{icon} {capacity}%";
format-charging = "󰂄 {capacity}%";
onclick = "";
};
"sway/window" = {
max-length = 20;
};
network = {
interval = 3;
format-wifi = " {essid}";
format-ethernet = "󰈁 Connected";
format-disconnected = "";
tooltip-format = ''
{ifname}
{ipaddr}/{cidr}
Up: {bandwidthUpBits}
Down: {bandwidthDownBits}'';
on-click = "";
};
"custom/tailscale-ping" = {
interval = 10;
return-type = "json";
exec =
let
inherit (builtins) concatStringsSep attrNames;
hosts = attrNames outputs.nixosConfigurations;
homeMachine = "merope";
remoteMachine = "alcyone";
in
jsonOutput "tailscale-ping" {
# Build variables for each host
pre = ''
set -o pipefail
${concatStringsSep "\n" (map (host: ''
ping_${host}="$(${timeout} 2 ${ping} -c 1 -q ${host} 2>/dev/null | ${tail} -1 | ${cut} -d '/' -f5 | ${cut} -d '.' -f1)ms" || ping_${host}="Disconnected"
'') hosts)}
'';
# Access a remote machine's and a home machine's ping
text = " $ping_${remoteMachine} / $ping_${homeMachine}";
# Show pings from all machines
tooltip = concatStringsSep "\n" (map (host: "${host}: $ping_${host}") hosts);
};
format = "{}";
on-click = "";
};
"custom/menu" = {
return-type = "json";
exec = jsonOutput "menu" {
text = "";
tooltip = ''$(${cat} /etc/os-release | ${grep} PRETTY_NAME | ${cut} -d '"' -f2)'';
};
on-click = "${wofi} -S drun -x 10 -y 10 -W 25% -H 60%";
};
"custom/hostname" = {
exec = "echo $USER@$HOSTNAME";
};
"custom/unread-mail" = {
interval = 5;
return-type = "json";
exec = jsonOutput "unread-mail" {
pre = ''
count=$(${find} ~/Mail/*/Inbox/new -type f | ${wc} -l)
if ${pgrep} mbsync &>/dev/null; then
status="syncing"
else if [ "$count" == "0" ]; then
status="read"
else
status="unread"
fi
fi
'';
text = "$count";
alt = "$status";
};
format = "{icon} ({})";
format-icons = {
"read" = "󰇯";
"unread" = "󰇮";
"syncing" = "󰁪";
};
};
"custom/gpg-agent" = {
interval = 2;
return-type = "json";
exec =
let gpgCmds = import ../../../cli/gpg-commands.nix { inherit pkgs; };
in
jsonOutput "gpg-agent" {
pre = ''status=$(${gpgCmds.isUnlocked} && echo "unlocked" || echo "locked")'';
alt = "$status";
tooltip = "GPG is $status";
};
format = "{icon}";
format-icons = {
"locked" = "";
"unlocked" = "";
};
on-click = "";
};
"custom/gamemode" = {
exec-if = "${gamemoded} --status | ${grep} 'is active' -q";
interval = 2;
return-type = "json";
exec = jsonOutput "gamemode" {
tooltip = "Gamemode is active";
};
format = " ";
};
"custom/gammastep" = {
interval = 5;
return-type = "json";
exec = jsonOutput "gammastep" {
pre = ''
if unit_status="$(${systemctl} --user is-active gammastep)"; then
status="$unit_status ($(${journalctl} --user -u gammastep.service -g 'Period: ' | ${tail} -1 | ${cut} -d ':' -f6 | ${xargs}))"
else
status="$unit_status"
fi
'';
alt = "\${status:-inactive}";
tooltip = "Gammastep is $status";
};
format = "{icon}";
format-icons = {
"activating" = "󰁪 ";
"deactivating" = "󰁪 ";
"inactive" = "? ";
"active (Night)" = " ";
"active (Nighttime)" = " ";
"active (Transition (Night)" = " ";
"active (Transition (Nighttime)" = " ";
"active (Day)" = " ";
"active (Daytime)" = " ";
"active (Transition (Day)" = " ";
"active (Transition (Daytime)" = " ";
};
on-click = "${systemctl} --user is-active gammastep && ${systemctl} --user stop gammastep || ${systemctl} --user start gammastep";
};
"custom/currentplayer" = {
interval = 2;
return-type = "json";
exec = jsonOutput "currentplayer" {
pre = ''
player="$(${playerctl} status -f "{{playerName}}" 2>/dev/null || echo "No player active" | ${cut} -d '.' -f1)"
count="$(${playerctl} -l | ${wc} -l)"
if ((count > 1)); then
more=" +$((count - 1))"
else
more=""
fi
'';
alt = "$player";
tooltip = "$player ($count available)";
text = "$more";
};
format = "{icon}{}";
format-icons = {
"No player active" = " ";
"Celluloid" = "󰎁 ";
"spotify" = "󰓇 ";
"ncspot" = "󰓇 ";
"qutebrowser" = "󰖟 ";
"firefox" = " ";
"discord" = " 󰙯 ";
"sublimemusic" = " ";
"kdeconnect" = "󰄡 ";
"chromium" = " ";
};
on-click = "${playerctld} shift";
on-click-right = "${playerctld} unshift";
};
"custom/player" = {
exec-if = "${playerctl} status";
exec = ''${playerctl} metadata --format '{"text": "{{title}} - {{artist}}", "alt": "{{status}}", "tooltip": "{{title}} - {{artist}} ({{album}})"}' '';
return-type = "json";
interval = 2;
max-length = 30;
format = "{icon} {}";
format-icons = {
"Playing" = "󰐊";
"Paused" = "󰏤 ";
"Stopped" = "󰓛";
};
on-click = "${playerctl} play-pause";
};
};
};
# Cheatsheet:
# x -> all sides
# x y -> vertical, horizontal
# x y z -> top, horizontal, bottom
# w x y z -> top, right, bottom, left
style = let inherit (config.colorscheme) colors; in /* css */ ''
* {
font-family: ${config.fontProfiles.regular.family}, ${config.fontProfiles.monospace.family};
font-size: 12pt;
padding: 0 8px;
}
.modules-right {
margin-right: -15px;
}
.modules-left {
margin-left: -15px;
}
window#waybar.top {
opacity: 0.95;
padding: 0;
background-color: #${colors.base00};
border: 2px solid #${colors.base0C};
border-radius: 10px;
}
window#waybar.bottom {
opacity: 0.90;
background-color: #${colors.base00};
border: 2px solid #${colors.base0C};
border-radius: 10px;
}
window#waybar {
color: #${colors.base05};
}
#workspaces button {
background-color: #${colors.base01};
color: #${colors.base05};
padding: 5px 1px;
margin: 3px 0;
}
#workspaces button.hidden {
background-color: #${colors.base00};
color: #${colors.base04};
}
#workspaces button.focused,
#workspaces button.active {
background-color: #${colors.base0A};
color: #${colors.base00};
}
#clock {
background-color: #${colors.base0C};
color: #${colors.base00};
padding-left: 15px;
padding-right: 15px;
margin-top: 0;
margin-bottom: 0;
border-radius: 10px;
}
#custom-menu {
background-color: #${colors.base0C};
color: #${colors.base00};
padding-left: 15px;
padding-right: 22px;
margin: 0;
border-radius: 10px;
}
#custom-hostname {
background-color: #${colors.base0C};
color: #${colors.base00};
padding-left: 15px;
padding-right: 18px;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
border-radius: 10px;
}
#custom-currentplayer {
padding-right: 0;
}
#tray {
color: #${colors.base05};
}
'';
};
}

View file

@ -0,0 +1,54 @@
{ config, pkgs, ... }:
let
inherit (config) colorscheme;
inherit (colorscheme) colors;
in
{
programs.wezterm = {
enable = true;
colorSchemes = {
"${colorscheme.slug}" = {
foreground = "#${colors.base05}";
background = "#${colors.base00}";
ansi = [
"#${colors.base08}"
"#${colors.base09}"
"#${colors.base0A}"
"#${colors.base0B}"
"#${colors.base0C}"
"#${colors.base0D}"
"#${colors.base0E}"
"#${colors.base0F}"
];
brights = [
"#${colors.base00}"
"#${colors.base01}"
"#${colors.base02}"
"#${colors.base03}"
"#${colors.base04}"
"#${colors.base05}"
"#${colors.base06}"
"#${colors.base07}"
];
cursor_fg = "#${colors.base00}";
cursor_bg = "#${colors.base05}";
selection_fg = "#${colors.base00}";
selection_bg = "#${colors.base05}";
};
};
extraConfig = /* lua */ ''
return {
font = wezterm.font("${config.fontProfiles.monospace.family}"),
font_size = 12.0,
color_scheme = "${colorscheme.slug}",
hide_tab_bar_if_only_one_tab = true,
window_close_confirmation = "NeverPrompt",
set_environment_variables = {
TERM = 'wezterm',
},
}
'';
};
}

View file

@ -0,0 +1,20 @@
--- a/src/wofi.c Mon Feb 22 23:53:57 2021 -0800
+++ b/src/wofi.c Wed Aug 11 13:49:13 2021 -0300
@@ -881,12 +881,15 @@
}
void wofi_term_run(const char* cmd) {
+ char *shell = getenv("SHELL");
+ if (!shell) shell = "sh";
+
if(terminal != NULL) {
- execlp(terminal, terminal, "-e", cmd, NULL);
+ execlp(terminal, terminal, "-e", shell, "-c", cmd, NULL);
}
size_t term_count = sizeof(terminals) / sizeof(char*);
for(size_t count = 0; count < term_count; ++count) {
- execlp(terminals[count], terminals[count], "-e", cmd, NULL);
+ execlp(terminals[count], terminals[count], "-e", shell, "-c", cmd, NULL);
}
fprintf(stderr, "No terminal emulator found please set term in config or use --term\n");
exit(1);

View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }: {
programs.wofi = {
enable = true;
package = pkgs.wofi.overrideAttrs (oa: {
patches = (oa.patches or [ ]) ++ [
./wofi-run-shell.patch # Fix for https://todo.sr.ht/~scoopta/wofi/174
];
});
settings = {
image_size = 48;
columns = 3;
allow_images = true;
insensitive = true;
run-always_parse_args = true;
run-cache_file = "/dev/null";
run-exec_search = true;
};
};
home.packages =
let
inherit (config.programs.password-store) package enable;
in
lib.optional enable (pkgs.pass-wofi.override { pass = package; });
}

View file

@ -0,0 +1,32 @@
{ config, ... }:
let inherit (config.colorscheme) colors;
in {
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
font = "${config.fontProfiles.regular.family} 12";
recolor = true;
default-bg = "#${colors.base00}";
default-fg = "#${colors.base01}";
statusbar-bg = "#${colors.base02}";
statusbar-fg = "#${colors.base04}";
inputbar-bg = "#${colors.base00}";
inputbar-fg = "#${colors.base07}";
notification-bg = "#${colors.base00}";
notification-fg = "#${colors.base07}";
notification-error-bg = "#${colors.base00}";
notification-error-fg = "#${colors.base08}";
notification-warning-bg = "#${colors.base00}";
notification-warning-fg = "#${colors.base08}";
highlight-color = "#${colors.base0A}";
highlight-active-color = "#${colors.base0D}";
completion-bg = "#${colors.base01}";
completion-fg = "#${colors.base05}";
completions-highlight-bg = "#${colors.base0D}";
completions-highlight-fg = "#${colors.base07}";
recolor-lightcolor = "#${colors.base00}";
recolor-darkcolor = "#${colors.base06}";
};
};
}

File diff suppressed because it is too large Load diff

View file

@ -2,23 +2,26 @@
services = {
xserver = {
enable = true;
desktopManager.gnome = {
enable = true;
};
displayManager.gdm = {
enable = true;
autoSuspend = false;
wayland = true;
wayland = false;
};
desktopManager.gnome = {
enable = true;
};
};
dbus.packages = [ pkgs.gnome3.dconf ];
udev.packages = [ pkgs.gnome3.gnome-settings-daemon ];
geoclue2.enable = true;
gnome.games.enable = true;
};
networking.networkmanager.enable = true;
services.avahi.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
services.avahi.nssmdns = true;
# for a WiFi printer
services.avahi.openFirewall = true;
networking.networkmanager.enable = true;
}

View file

@ -1,43 +0,0 @@
{ pkgs, lib, config, ... }:
let
homeCfgs = config.home-manager.users;
homePaths = lib.mapAttrsToList (n: v: "${v.home.path}/share") homeCfgs;
extraDataPaths = lib.concatStringsSep ":" homePaths;
vars = ''XDG_DATA_DIRS="$XDG_DATA_DIRS:${extraDataPaths}"'';
sway-kiosk = command: "${pkgs.sway}/bin/sway --config ${pkgs.writeText "kiosk.config" ''
output * bg #000000 solid_color
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"
xwayland disable
input "type:touchpad" {
tap enabled
}
exec '${vars} ${command} -l debug; ${pkgs.sway}/bin/swaymsg exit'
''}";
gburdCfg = homeCfgs.gburd;
in
{
users.extraUsers.greeter.packages = [
gburdCfg.gtk.theme.package
gburdCfg.gtk.iconTheme.package
];
programs.regreet = {
enable = true;
settings = {
GTK = {
icon_theme_name = "ePapirus";
theme_name = gburdCfg.gtk.theme.name;
};
background = {
path = gburdCfg.wallpaper;
fit = "Cover";
};
};
};
services.greetd = {
enable = true;
settings.default_session.command = sway-kiosk (lib.getExe config.programs.regreet.package);
};
}

View file

@ -11,11 +11,9 @@
../common/optional/gnome.nix
../common/optional/x11-keymap.nix
../common/optional/gamemode.nix
../common/optional/greetd.nix
# ../common/optional/gamemode.nix
../common/optional/pipewire.nix
../common/optional/quietboot.nix
../common/optional/lol-acfix.nix
];
networking = {