Lockscreen custom

This commit is contained in:
Filippo Berto 2021-06-20 21:41:54 +02:00
parent b3fdc5f573
commit e080d5b9b8
10 changed files with 134 additions and 49 deletions

View file

@ -1,14 +1,12 @@
{ system ? builtins.currentSystem }:
{ pkgs ? import <nixpkgs> { inherit system; }
, system ? builtins.currentSystem
}:
let
pkgs = import <nixpkgs> { inherit system; };
# pkgs = import (builtins.fetchTarball {
# name = "nixos-unstable-2021-05-26";
# url = "https://github.com/nixos/nixpkgs/archive/9b7fb215d4d8399772a4f3d6f00fab3747136f53.tar.gz";
# sha256 = "02d1841j7jg161q7cwh7vryxhv7x3bmnhd1jczx14ggfa66vqfhm";
# }) { inherit system; };
callPackage = pkgs.lib.callPackageWith (pkgs // self);
self = {
gallery-tagger = callPackage ./gallery-tagger {};
lockscreen = callPackage ./lockscreen pkgs.extra.colorPalette // {};
};
in(self)
in
(self)

View file

@ -0,0 +1,55 @@
{ lib
, stdenv
, extra
, roboto
, i3lock-color
, writeScript
, font ? { package = roboto; name = "Roboto"; }
, palette ? extra.palette.palette {}
, ...
}:
let
strPalette = extra.palette.toRGBAHex palette;
in
writeScript "lockscreen.sh" ''
#!/bin/sh
# Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \
--insidever-color="${strPalette.normal.green}" \
--insidewrong-color="${strPalette.normal.red}" \
--inside-color="${strPalette.primary.background}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ring-color="${strPalette.bright.blue}" \
--line-uses-ring \
--keyhl-color="${strPalette.bright.red}" \
--bshl-color="${strPalette.bright.red}" \
--separator-color="${strPalette.primary.background}" \
--verif-color="${strPalette.normal.green}" \
--wrong-color="${strPalette.normal.red}" \
--layout-color="${strPalette.normal.blue}" \
--date-color="${strPalette.normal.blue}" \
--time-color="${strPalette.normal.blue}" \
--blur 10 \
--clock \
--indicator \
--time-str="%H:%M:%S" \
--date-str="%a %e %b %Y" \
--verif-text="Verifying..." \
--wrong-text="Auth Failed" \
--noinput="No Input" \
--lock-text="Locking..." \
--lockfailed="Lock Failed" \
--time-font="${font.name}" \
--date-font="${font.name}" \
--layout-font="${font.name}" \
--verif-font="${font.name}" \
--wrong-font="${font.name}" \
--radius=120 \
--ring-width=20 \
--pass-media-keys \
--pass-screen-keys \
--pass-volume-keys \
''

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
nixpkgs = import <nixpkgs> {};
@ -15,7 +15,7 @@ in
(final: prev: { extra = (prev.lib.callPackageWith prev) ./extra/default.nix {}; }) # Custom library
(final: prev: (prev.lib.callPackageWith prev) ./custom/default.nix {}) # Custom packges
(
final: prev: {
final: prev: rec {
extra = prev.extra // {
colorPalette = with pkgs.extra; palette.palette {
black = color.hexToRgba nord.n0;
@ -31,6 +31,18 @@ in
bright-red = color.hexToRgba nord.n12;
cursor-cursor = color.hexToRgba nord.n4;
};
font = {
normal = { package = pkgs.cantarell-fonts; name = "Cantarell"; };
monospace = { package = pkgs.nerdfonts; name = "FuraCode Nerd Font Mono"; };
};
};
}
)
(
final: prev: {
lockscreen = prev.lockscreen.override {
palette = prev.extra.colorPalette;
font = prev.extra.font.normal;
};
}
)
@ -41,8 +53,6 @@ in
keyboard.layout = "it";
keyboard.options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
packages = with pkgs; [
audacity
authy
blender
@ -95,11 +105,12 @@ in
transmission-gtk
wineFull
wireguard
xclip
zoom-us
zotero
] ++ [
(
dwarf-fortress-packages.dwarf-fortress-full.override {
pkgs.dwarf-fortress-packages.dwarf-fortress-full.override {
enableLegendsBrowser = false;
enableTextMode = true;
theme = "cla";

View file

@ -1,14 +1,14 @@
{ pkgs, lib, ... }:
{
# Include fonts packages
home.packages = with pkgs; [ nerdfonts ];
home.packages = [ pkgs.extra.font.monospace.package ];
programs.alacritty = {
enable = true;
settings = {
env.TERM = "xterm-256color";
scrolling.history = 3000;
font = {
normal.family = "FuraCode Nerd Font Mono";
normal.family = pkgs.extra.font.monospace.name;
size = 9.0;
};
background_opacity = 0.95;

View file

@ -1,9 +1,12 @@
{ pkgs, ... }:
let rofi_dmenu = "${pkgs.rofi} -dmenu";
firefox = "${pkgs.firefox}/bin/firefox";
dmenu = "${pkgs.dmenu}/bin/dmenu";
in {
home.packages = with pkgs; [ dunst nerdfonts ];
let
rofi_dmenu = "${pkgs.rofi} -dmenu";
firefox = "${pkgs.firefox}/bin/firefox";
dmenu = "${pkgs.dmenu}/bin/dmenu";
palette = pkgs.extra.palette.toRGBHex pkgs.extra.colorPalette;
in
{
home.packages = with pkgs; [ dunst extra.font.normal.package ];
services.dunst = {
enable = true;
iconTheme = {
@ -13,7 +16,7 @@ in {
settings = {
global = {
monitor = 0;
follow = "keyboard";
follow = "mouse";
geometry = "300x6-20+50";
indicate_hidden = "yes";
shrink = "yes";
@ -23,12 +26,12 @@ in {
padding = 8;
horizontal_padding = 8;
frame_width = 2;
frame_color = "#2E3440";
separator_color = "#404859";
frame_color = palette.normal.black;
separator_color = palette.normal.blue;
sort = "yes";
idle_threshold = 120;
font = "FuraCode Nerd Font Mono 10";
font = "${pkgs.extra.font.normal.name} 10";
line_height = 0;
markup = "full";
format = "<b>%s</b>\\n%b";
@ -58,27 +61,27 @@ in {
mouse_right_click = "close_all";
};
urgency_low = {
background = "#2E3440";
foreground = "#D8DEE9";
background = palette.primary.background;
foreground = palette.primary.foreground;
timeout = 10;
};
urgency_normal = {
background = "#2E3440";
foreground = "#D8DEE9";
background = palette.primary.background;
foreground = palette.primary.foreground;
timeout = 10;
};
urgency_critical = {
background = "#2E3440";
foreground = "#D8DEE9";
frame_color = "#ff0000";
background = palette.primary.background;
foreground = palette.primary.foreground;
frame_color = palette.bright.red;
timeout = 0;
};
shortcuts = {
shortcuts = {
close = "ctrl+space";
close_all = "ctrl+shift+space";
history = "ctrl+backslash";
context = "ctrl+shift+period";
};
};
};
};
}

View file

@ -2,9 +2,8 @@
{
programs.obs-studio = {
enable = true;
plugins = with pkgs; [
plugins = with pkgs.obs-studio-plugins; [
# obs-linuxbrowser
obs-v4l2sink
obs-gstreamer
obs-move-transition
];

View file

@ -60,8 +60,10 @@ let
};
font = [
"FuraCode Nerd Font Mono:pixelsize=10;2"
# "EmojiOne Color;0"
"Material Design Icons;2"
"EmojiOne Color;0"
"NotoEmoji Nerd Font Mono;0"
"Noto Color Emoji;0"
];
wm-restack = "bspwm";
};
@ -236,7 +238,7 @@ in
};
volume = colors.normal // {
padding = 1;
text = "VOL <bar-volume> <label-volume>";
text = "VOL <bar-volume> <label-volume> <ramp-volume>";
};
};
label.muted = {

View file

@ -1,11 +1,8 @@
{ pkgs, ... }:
let
i3lock-color = "${pkgs.i3lock-color}/bin/i3lock-color";
in
{
services.screen-locker = {
enable = true;
lockCmd = '' ${i3lock-color} -B 10 --greeter-text="Welcome back $USER" --greeter-color="#ffffff" --date-color="#ffffff" --time-color="#ffffff" '';
lockCmd = "${pkgs.lockscreen}";
inactiveInterval = 10; # miutes
};
}

View file

@ -4,7 +4,6 @@
alacritty = "${pkgs.alacritty}/bin/alacritty";
bspc = "${pkgs.bspwm}/bin/bspc";
dunstify = "${pkgs.dunst}/bin/dunstify";
i3lock-color = "${pkgs.i3lock-color}/bin/i3lock-color";
playerctl = "${pkgs.playerctl}/bin/playerctl";
pulseaudio-ctl = "${pkgs.pulseaudio-ctl}/bin/pulseaudio-ctl";
rofi = "${pkgs.rofi}/bin/rofi";
@ -17,7 +16,7 @@
"super + alt + {h,j,k,l}" = "${bspc} node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
"super + alt + {q,r}" = "${bspc} {quit,wm -r}";
"super + alt + shift + {h,j,k,l}" = "${bspc} node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
"super + alt + m" = '' ${i3lock-color} -B 10 --greeter-text="Welcome back $USER" --greeter-color="#ffffff" --date-color="#ffffff" --time-color="#ffffff" '';
"super + alt + m" = "${pkgs.lockscreen}";
"super + bracket{left,right}" = "${bspc} desktop -f {prev,next}.local";
"super + ctrl + {1-9}" = "${bspc} node -o 0.{1-9}";
"super + ctrl + {h,j,k,l}" = "${bspc} node -p {west,south,north,east}";

View file

@ -8,11 +8,13 @@
programs.zsh = {
enable = true;
autocd = true;
# plugins = [{
# name = "powerlevel10k";
# src = pkgs.zsh-powerlevel10k;
# file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
# }];
plugins = [
# {
# name = "powerlevel10k";
# src = pkgs.zsh-powerlevel10k;
# file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
# }
];
initExtraBeforeCompInit = ''
zstyle ':completion:*' menu select
setopt CORRECT
@ -24,7 +26,26 @@
# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = [ "os_icon" "dir" "vcs" "prompt_char" ];
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS = [ "status" "command_execution_time" "background_jobs" "direnv" "nix_shell" "time" "vpn_ip" ]
# };
oh-my-zsh = {
enable = true;
plugins = [
"alias-finder"
"common-aliases"
"cp"
"dirhistory"
"docker-compose"
"docker"
"extract"
"git-auto-fetch"
"git"
"sudo"
];
extraConfig = "";
};
};
programs.starship = {
enable = true;
enableBashIntegration = true;