Polybar theme + bspwm movement + xidlehook + lockscreen

This commit is contained in:
Filippo Berto 2021-06-16 09:22:28 +02:00
parent 739be5f9ae
commit 2c7a0f3ed3
4 changed files with 76 additions and 29 deletions

View file

@ -63,6 +63,7 @@ in
gnome3.seahorse gnome3.seahorse
gnome3.sushi gnome3.sushi
google-chrome google-chrome
gucharmap
htop htop
jetbrains.datagrip jetbrains.datagrip
krita krita
@ -79,6 +80,7 @@ in
pcmanfm pcmanfm
pentablet-driver pentablet-driver
procps-ng procps-ng
ripgrep
shotwell shotwell
skypeforlinux skypeforlinux
slack slack
@ -86,6 +88,7 @@ in
tdesktop tdesktop
teams teams
transmission-gtk transmission-gtk
wineFull
wireguard wireguard
zoom-us zoom-us
zotero zotero
@ -127,7 +130,8 @@ in
./modules/polybar.nix ./modules/polybar.nix
./modules/qogir_theme.nix ./modules/qogir_theme.nix
./modules/rofi.nix ./modules/rofi.nix
./modules/screen_locker.nix # ./modules/screen_locker.nix
./modules/xidelhook.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/sxhkd.nix ./modules/sxhkd.nix
./modules/syncthing.nix ./modules/syncthing.nix

View file

@ -6,7 +6,7 @@ let
pgrep = "${pkgs.procps}/bin/pgrep"; pgrep = "${pkgs.procps}/bin/pgrep";
pkill = "${pkgs.procps}/bin/pkill"; pkill = "${pkgs.procps}/bin/pkill";
playerCtl = "${pkgs.playerctl}/bin/playerctl"; playerCtl = "${pkgs.playerctl}/bin/playerctl";
playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata"; playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | head -c 60";
colors = with pkgs.extra; palette.toARGBHex rec { colors = with pkgs.extra; palette.toARGBHex rec {
normal = { normal = {
@ -57,16 +57,16 @@ let
top.size = 2; top.size = 2;
bottom.size = 0; bottom.size = 0;
}; };
font = [ "FuraCode Nerd Font Mono:pixelsize=10;2" "unifont:fontformat=truetype:size=8:antialias=false;0" "siji:pixelsize=10;1" ]; font = [
tray = { "FuraCode Nerd Font Mono:pixelsize=10;2"
position = "right"; # "EmojiOne Color;0"
padding = 0; "NotoEmoji Nerd Font Mono;0"
}; ];
wm-restack = "bspwm"; wm-restack = "bspwm";
}; };
in in
{ {
home.packages = with pkgs; [ nerdfonts ]; home.packages = with pkgs; [ nerdfonts emojione noto-fonts-emoji ];
services.polybar = { services.polybar = {
enable = true; enable = true;
package = pkgs.polybarFull; package = pkgs.polybarFull;
@ -90,6 +90,10 @@ in
# modules-center = # modules-center =
modules-right = "player pulseaudio temperature cpu memory battery date powermenu"; modules-right = "player pulseaudio temperature cpu memory battery date powermenu";
enable-ipc = true; enable-ipc = true;
tray = {
position = "right";
padding = 0;
};
}; };
"bar/secondary" = commonBar // { "bar/secondary" = commonBar // {
@ -108,11 +112,11 @@ in
animation = { animation = {
charging = { charging = {
text = [ "" "" "" ]; text = [ "" "" "" "" "" "" "" "" "" "" ];
framerate = "750"; framerate = "750";
}; };
discharging = { discharging = {
text = [ "" "" "" ]; text = [ "" "" "" "" "" "" "" "" "" "" ];
framerate = "750"; framerate = "750";
}; };
}; };
@ -120,15 +124,15 @@ in
format = { format = {
charging = colors.selected // { charging = colors.selected // {
padding = 1; padding = 1;
text = "<animation-charging> <label-charging>"; text = "<label-charging> <animation-charging>";
}; };
discharging = colors.active // { discharging = colors.active // {
padding = 1; padding = 1;
text = "<animation-discharging> <label-discharging>"; text = "<label-discharging> <animation-discharging>";
}; };
full = colors.normal // { full = colors.normal // {
padding = 1; padding = 1;
text = " <label-full>"; text = "<label-full> ";
}; };
}; };
@ -161,11 +165,12 @@ in
"module/cpu" = { "module/cpu" = {
type = "internal/cpu"; type = "internal/cpu";
format = colors.normal // { format = colors.normal // {
prefix = " "; text = "RAM <label> <ramp-load>";
padding = 1; padding = 1;
}; };
interval = 2; interval = 2;
label = "%percentage-sum%%"; label = "%percentage-sum%%";
ramp-load = [ "" "" "" "" "" "" ];
}; };
"module/date" = { "module/date" = {
@ -188,11 +193,12 @@ in
"module/memory" = { "module/memory" = {
type = "internal/memory"; type = "internal/memory";
format = colors.normal // { format = colors.normal // {
prefix = " ";
padding = 1; padding = 1;
text = "RAM <label> <ramp-used>";
}; };
interval = 2; interval = 2;
label = "%percentage_used%% ~ %percentage_swap_used%%"; label = "%percentage_used%%";
ramp-used = [ "" "" "" "" "" "" ];
}; };
"module/pulseaudio" = { "module/pulseaudio" = {
@ -224,26 +230,31 @@ in
click.right = "${pgrep} pavucontrol && ${pkill} pavucontrol || ${pavucontrol}"; click.right = "${pgrep} pavucontrol && ${pkill} pavucontrol || ${pavucontrol}";
format = { format = {
padding = 1; padding = 1;
muted = colors.active; muted = colors.active // {
padding = 1;
};
volume = colors.normal // { volume = colors.normal // {
text = "<label-volume> <bar-volume>"; padding = 1;
text = "<ramp-volume><label-volume> <bar-volume>";
}; };
}; };
label.muted = { label.muted = {
text = "VOL muted"; text = "🔇";
}; };
label.volume = { label.volume = {
text = "VOL %percentage%%"; text = " %percentage%%";
}; };
ramp.volume = [ "🔈" "🔉" "🔊" ];
type = "internal/pulseaudio"; type = "internal/pulseaudio";
}; };
"module/temperature" = { "module/temperature" = {
format = colors.normal // { format = colors.normal // {
padding = 1; padding = 1;
text = "<ramp> <label>"; text = "<label> <ramp>";
warn = { warn = {
text = "<ramp> <label-warn>"; padding = 1;
text = "<label-warn> <ramp>";
underline = colors.alert; underline = colors.alert;
}; };
}; };
@ -253,7 +264,7 @@ in
warn = "%temperature-c%"; warn = "%temperature-c%";
}; };
ramp = { ramp = {
text = [ "" "" "" ]; text = [ "" "" "" "" "" ];
}; };
thermal.zone = "0"; thermal.zone = "0";
type = "internal/temperature"; type = "internal/temperature";
@ -280,18 +291,18 @@ in
}; };
menu = [ menu = [
[ [
({ text = "Reboot"; exec = "menu-open-1"; }) ({ text = "Reboot"; exec = "#powermenu.open.1"; })
({ text = "Hibernate"; exec = "menu-open-2"; }) ({ text = "Hibernate"; exec = "#powermenu.open.2"; })
({ text = "Power off"; exec = "menu-open-3"; }) ({ text = "Power off"; exec = "#powermenu.open.3"; })
] ]
[ [
({ text = "Reboot"; exec = "systemctl reboot"; }) ({ text = "Reboot"; exec = "reboot"; })
] ]
[ [
({ text = "Hibernate"; exec = "systemctl hibernate"; }) ({ text = "Hibernate"; exec = "systemctl hibernate"; })
] ]
[ [
({ text = "Power off"; exec = "systemctl poweroff"; }) ({ text = "Power off"; exec = "shutdown now"; })
] ]
]; ];
}; };

View file

@ -35,7 +35,10 @@
"super + {_,shift + } Return" = "{${alacritty} , ${terminator}}"; "super + {_,shift + } Return" = "{${alacritty} , ${terminator}}";
"super + {_,shift + }{1-9,0}" = "${bspc} {desktop -f,node -d} 'focused:^{1-9,10}'"; "super + {_,shift + }{1-9,0}" = "${bspc} {desktop -f,node -d} 'focused:^{1-9,10}'";
"super + {_,shift + }c" = "${bspc} node -f {next,prev}.local"; "super + {_,shift + }c" = "${bspc} node -f {next,prev}.local";
"super + {_,shift + }{h,j,k,l}" = "${bspc} node -{f,s} {west,south,north,east}"; # "super + {_,shift + }{h,j,k,l}" = "${bspc} node -{f,s} {west,south,north,east}";
"super + {h,j,k,l}" = "${bspc} node -f {west,south,north,east}";
"super + shift + {h,j,k,l}" = ''dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow'';
"super + {_,shift + }w" = "${bspc} node -{c,k}"; "super + {_,shift + }w" = "${bspc} node -{c,k}";
"super + @space" = "rofi -show drun"; "super + @space" = "rofi -show drun";
"super + {t,shift + t,s,f}" = "${bspc} node -t {tiled,pseudo_tiled,floating,fullscreen}"; "super + {t,shift + t,s,f}" = "${bspc} node -t {tiled,pseudo_tiled,floating,fullscreen}";

29
modules/xidelhook.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, lib, ... }:
with lib;
let
program = "${pkgs.xidlehook}/bin/xidlehook";
lockCmd = escapeShellArg '' ${pkgs.i3lock-color}/bin/i3lock-color -B 10 --greeter-text="Welcome back $USER" --greeter-color="#ffffff" --date-color="#ffffff" --time-color="#ffffff" '';
script = concatStringsSep " " [
''${program}''
''--not-when-fullscreen''
''--not-when-audio''
''--timer 300 ${lockCmd} ""''
];
in
{
systemd.user.services.xidlehook = {
Unit = {
Description = "xidlehook service";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
ConditionEnvironment = [ "DISPLAY" ];
};
Service = {
Type = "simple";
ExecStart = "${script}";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}