misc changes

feat/kile-v2
Ricard Illa 2022-01-21 16:18:38 +01:00
parent e259f57286
commit 83bccd8c3f
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
10 changed files with 231 additions and 209 deletions

View File

@ -9,7 +9,8 @@
x = 0; x = 0;
y = 0; y = 0;
}; };
size = 7; # size = 7;
size = 9;
}; };
}; };
}; };

View File

@ -4,6 +4,7 @@ let
impermanence = builtins.fetchTarball { impermanence = builtins.fetchTarball {
url = "https://github.com/nix-community/impermanence/archive/master.tar.gz"; url = "https://github.com/nix-community/impermanence/archive/master.tar.gz";
}; };
in { in {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
# programs.home-manager.enable = true; # programs.home-manager.enable = true;
@ -15,13 +16,13 @@ in {
imports = [ imports = [
"${impermanence}/home-manager.nix" "${impermanence}/home-manager.nix"
# ./desktop-sway ./desktop-sway
./alacritty ./alacritty
./arduino ./arduino
./barrier ./barrier
./browsers ./browsers
./dav ./dav
./desktop-xmonad # ./desktop-xmonad
./fonts ./fonts
./git ./git
./gotify ./gotify
@ -106,6 +107,7 @@ in {
CM_LAUNCHER = "rofi"; # for clipmenu CM_LAUNCHER = "rofi"; # for clipmenu
LEDGER_FILE = "${config.home.homeDirectory}/finance/2021.journal"; LEDGER_FILE = "${config.home.homeDirectory}/finance/2021.journal";
QT_QPA_PLATFORMTHEME = "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [

View File

@ -0,0 +1,39 @@
{ config, pkgs, ... }:
let
bemenuColors = {
titleBackground = "#282828E0";
titleForeground = "#fbf1c7";
filterBackground = "#282828E0";
filterForeground = "#ebdbb2";
normalBackground = "#282828E0";
normalForeground = "#ebdbb2";
highlightedBackground = "#458588E0";
highlightedForeground = "#fbf1c7";
scrollbarBackground = "#282828E0";
scrollbarForeground = "#458588E0";
};
in {
home.packages = [ pkgs.bemenu ];
home.sessionVariables.BEMENU_OPTS = ''
--ignorecase \
--list 20 \
--prompt '' \
--scrollbar none \
--wrap \
--scrollbar autohide \
--no-overlap \
--monitor all \
--fn 'Inter 13px' \
--tb '${bemenuColors.titleBackground}' \
--tf '${bemenuColors.titleForeground}' \
--fb '${bemenuColors.filterBackground}' \
--ff '${bemenuColors.filterForeground}' \
--nb '${bemenuColors.normalBackground}' \
--nf '${bemenuColors.normalForeground}' \
--hb '${bemenuColors.highlightedBackground}' \
--hf '${bemenuColors.highlightedForeground}' \
--scb '${bemenuColors.scrollbarBackground}' \
--scf '${bemenuColors.scrollbarForeground}'
'';
}

View File

@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./sway.nix ./waybar.nix ./wofi.nix ]; imports = [ ./sway.nix ./waybar.nix ./bemenu.nix ];
home.packages = with pkgs; [ home.packages = with pkgs; [
swaylock swaylock

View File

@ -2,19 +2,35 @@
let let
cfg = config.wayland.windowManager.sway.config; cfg = config.wayland.windowManager.sway.config;
wofi_pass = pkgs.callPackage ./wofi-pass.nix { inherit config pkgs; };
pactl = "${pkgs.pulseaudio}/bin/pactl"; pactl = "${pkgs.pulseaudio}/bin/pactl";
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
in wallpapers = "${config.home.homeDirectory}/Images/wallpapers/enabled";
{
# todo: do it properly like in https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/security/pass/rofi-pass.nix
tessenSrc = builtins.fetchTarball {
url =
"https://github.com/ayushnix/tessen/releases/download/v1.3.1/tessen-1.3.1.tar.gz";
};
tessen = pkgs.runCommandLocal "tessen" {
nativeBuildInputs = [ pkgs.makeWrapper ];
} ''
install -m755 ${tessenSrc}/tessen -D $out/bin/tessen
patchShebangs $out/bin/tessen
wrapProgram $out/bin/tessen \
--prefix PATH: ${pkgs.lib.makeBinPath [ pkgs.bash ]}
'';
in {
home.packages = [ tessen ];
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
config = { config = {
modifier = "Mod4"; modifier = "Mod4";
terminal = "alacritty"; terminal = "alacritty";
menu = "${pkgs.wofi}/bin/wofi --show run"; menu = "${pkgs.bemenu}/bin/bemenu-run";
left = "h"; left = "h";
down = "j"; down = "j";
@ -24,7 +40,8 @@ in
output = { output = {
"LVDS-1" = { "LVDS-1" = {
resolution = "1366x768"; resolution = "1366x768";
bg = "~/Images/wallpapers/times_of_grace.jpg fill"; bg =
"`${pkgs.findutils}/bin/find ${wallpapers} -type f | ${pkgs.coreutils}/bin/shuf -n 1` fill";
}; };
}; };
@ -57,7 +74,8 @@ in
"${cfg.modifier}+Control+${cfg.left}" = "move workspace to output left"; "${cfg.modifier}+Control+${cfg.left}" = "move workspace to output left";
"${cfg.modifier}+Control+${cfg.down}" = "move workspace to output down"; "${cfg.modifier}+Control+${cfg.down}" = "move workspace to output down";
"${cfg.modifier}+Control+${cfg.up}" = "move workspace to output up"; "${cfg.modifier}+Control+${cfg.up}" = "move workspace to output up";
"${cfg.modifier}+Control+${cfg.right}" = "move workspace to output right"; "${cfg.modifier}+Control+${cfg.right}" =
"move workspace to output right";
"${cfg.modifier}+Shift+w" = "move window to output left"; "${cfg.modifier}+Shift+w" = "move window to output left";
"${cfg.modifier}+Shift+e" = "move window to output right"; "${cfg.modifier}+Shift+e" = "move window to output right";
@ -101,12 +119,15 @@ in
"${cfg.modifier}+space" = "layout toggle all"; "${cfg.modifier}+space" = "layout toggle all";
"${cfg.modifier}+Shift+space" = "layout default"; "${cfg.modifier}+Shift+space" = "layout default";
"${cfg.modifier}+p" = "exec ${wofi_pass}/bin/wofi-pass"; "${cfg.modifier}+p" = "exec ${tessen}/bin/tessen";
"XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" =
"XF86AudioLowerVolume" = "exec ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; "exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" =
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" = "exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"; "XF86AudioMicMute" =
"exec ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${brightnessctl} set 5%-"; "XF86MonBrightnessDown" = "exec ${brightnessctl} set 5%-";
"XF86MonBrightnessUp" = "exec ${brightnessctl} set +5%"; "XF86MonBrightnessUp" = "exec ${brightnessctl} set +5%";
"XF86AudioPlay" = "exec ${playerctl} play-pause"; "XF86AudioPlay" = "exec ${playerctl} play-pause";

View File

@ -71,7 +71,7 @@
format-muted = ""; format-muted = "";
}; };
tray.icon-size = 10; tray.icon-size = 14;
}; };
} }
]; ];

View File

@ -1,30 +0,0 @@
{ config, pkgs, ... }:
let
bash = "${pkgs.bash}/bin/bash";
wofi = "${pkgs.wofi}/bin/wofi";
pass = "${pkgs.pass}/bin/pass";
wtype = "${pkgs.wtype}/bin/wtype";
xargs = "${pkgs.findutils}/bin/xargs";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
prefix = "${config.home.homeDirectory}/.password-store";
in
pkgs.writeScriptBin "wofi-pass" ''
#!${bash}
password_files=( "${prefix}"/**/*.gpg )
password_files=( "''${password_files[@]#"${prefix}"/}" )
password_files=( "''${password_files[@]%.gpg}" )
sel=$(
printf '%s\n' "''${password_files[@]}" | \
${wofi} --dmenu "$@"
)
#[ -n "''${sel}" ] && \
# ${pass} show "''${sel}" | \
# ${xargs} ${wtype}
[ -n "''${sel}" ] && \
${pass} show "''${sel}" | ${wl-copy}
''

View File

@ -1,57 +0,0 @@
{ config, pkgs, ... }:
let
wofi_pass = pkgs.callPackage ./wofi-pass.nix { inherit config pkgs; };
in
{
home.packages = [ pkgs.wofi wofi_pass ];
home.file.".config/wofi/style.css".text = ''
* {
font-family: Inter;
}
#outer-box {
border: 2px solid #458588;
padding: 5px;
padding-bottom: 0px;
}
window {
background-color: rgba(40, 40, 40, 0.9);
}
#entry {
border-radius: 0px;
}
#input {
border-radius: 0px;
background-color: #282828;
border: none;
border-bottom: 1px solid #928374;
margin-bottom: 5px;
background-color: transparent;
}
#entry:selected {
background-color: rgba(69, 133, 136, 0.9);
}
#text {
color: #ebdbb2;
}
#text:selected {
background-color: transparent;
color: #fbf1c7;
}
#scroll {
margin: 0px;
border: none;
}
'';
}

View File

@ -55,7 +55,7 @@ let
in in
{ {
imports = [ ./autorandr.nix ./misc.nix ]; imports = [ ./autorandr.nix ./rofi.nix ./misc.nix ];
home = { home = {
keyboard = { keyboard = {
layout = "us"; layout = "us";
@ -178,100 +178,6 @@ in
''; '';
}; };
programs.rofi = {
enable = true;
font = "${font.name} ${font.size}";
extraConfig = {
display-run = " ";
# display-drun = " ";
display-window = " ";
drun-display-format = "{name}";
modi = "window,run,drun,ssh";
show-icons = false;
};
theme = let
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background-color = mkLiteral "transparent";
border = 0;
margin = 0;
padding = 0;
spacing = 0;
};
element = {
padding = 2;
orientation = "vertical";
};
"element-text" = {
text-color = mkLiteral colors.fg;
};
"element selected" = {
text-color = mkLiteral colors.selFg;
background-color = mkLiteral "${colors.sel}A0";
};
entry = {
padding = mkLiteral "0 0 6 3";
text-color = mkLiteral colors.fg;
};
inputbar = {
children = map mkLiteral ["prompt" "entry"];
border = mkLiteral "0 0 1 0";
border-color = mkLiteral gruvbox-dark.gray2;
margin = mkLiteral "0 0 5 0";
};
listview = {
columns = 1;
fixed-height = false;
};
mainbox = {
children = map mkLiteral ["inputbar" "listview"];
margin = 6;
};
prompt = {
padding = mkLiteral "0 0 0 6";
text-color = mkLiteral colors.fg;
background-color = mkLiteral "transparent";
};
window = {
transparency = "real";
background-color = mkLiteral "${colors.bg}D0";
y-offset = mkLiteral "-25%";
border = 2;
border-color = mkLiteral colors.sel;
};
};
terminal = "${pkgs.alacritty}/bin/alacritty";
pass = {
enable = true;
extraConfig = ''
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
delay=2
wait=0.2
xdotool_delay=12
EDITOR='gvim -f'
BROWSER='xdg-open'
default_do='typePass' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='false'
notify='false'
default_autotype='user :tab pass'
help_color="${gruvbox-dark.blue-light}"
clip=primary
clip_clear=45
edit_new_pass="true"
default_user=":filename"
autotype="Alt+1"
type_user="Alt+u"
type_pass="Alt+p"
copy_name=""
copy_pass=""
'';
};
};
services.dunst = { services.dunst = {
enable = true; enable = true;
iconTheme = { iconTheme = {

View File

@ -0,0 +1,140 @@
{ config, pkgs, ... }:
let
gruvbox-dark = {
bg = "#282828";
bg1 = "#3c3836";
bg2 = "#504945";
fg = "#ebdbb2";
fg0 = "#fbf1c7";
fg3 = "#bdae93";
red = "#cc241d";
green = "#98971a";
yellow = "#d79921";
blue = "#458588";
purple = "#b16286";
aqua = "#689d6a";
gray = "#a89984";
gray2 = "#928374";
red-light = "#fb4934";
green-light = "#b8bb26";
yellow-light = "#fabd2f";
blue-light = "#83a598";
purple-light = "#d3869b";
aqua-light = "#8ec07c";
};
colors = {
fg = gruvbox-dark.fg;
selFg = gruvbox-dark.fg0;
bg = gruvbox-dark.bg;
sel = gruvbox-dark.blue;
inactive = gruvbox-dark.gray;
inactiveBorder = gruvbox-dark.bg2;
urgent = gruvbox-dark.red;
};
rofiTransparency = "96";
font = {
name = "Inter";
size = "10";
};
monoFont = {
name = "Hack";
size = "9";
};
in {
programs.rofi = {
enable = true;
font = "${font.name} ${font.size}";
extraConfig = {
display-run = " ";
# display-drun = " ";
display-window = " ";
drun-display-format = "{name}";
modi = "window,run,drun,ssh";
show-icons = false;
};
theme = let inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background-color = mkLiteral "transparent";
border = 0;
margin = 0;
padding = 0;
spacing = 0;
};
element = {
padding = 2;
orientation = "vertical";
};
"element-text" = { text-color = mkLiteral colors.fg; };
"element selected" = {
text-color = mkLiteral colors.selFg;
background-color = mkLiteral "${colors.sel}A0";
};
entry = {
padding = mkLiteral "0 0 6 3";
text-color = mkLiteral colors.fg;
};
inputbar = {
children = map mkLiteral [ "prompt" "entry" ];
border = mkLiteral "0 0 1 0";
border-color = mkLiteral gruvbox-dark.gray2;
margin = mkLiteral "0 0 5 0";
};
listview = {
columns = 1;
fixed-height = false;
};
mainbox = {
children = map mkLiteral [ "inputbar" "listview" ];
margin = 6;
};
prompt = {
padding = mkLiteral "0 0 0 6";
text-color = mkLiteral colors.fg;
background-color = mkLiteral "transparent";
};
window = {
transparency = "real";
background-color = mkLiteral "${colors.bg}D0";
y-offset = mkLiteral "-25%";
border = 2;
border-color = mkLiteral colors.sel;
};
};
terminal = "${pkgs.alacritty}/bin/alacritty";
pass = {
enable = true;
extraConfig = ''
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
delay=2
wait=0.2
xdotool_delay=12
EDITOR='gvim -f'
BROWSER='xdg-open'
default_do='typePass' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='false'
notify='false'
default_autotype='user :tab pass'
help_color="${gruvbox-dark.blue-light}"
clip=primary
clip_clear=45
edit_new_pass="true"
default_user=":filename"
autotype="Alt+1"
type_user="Alt+u"
type_pass="Alt+p"
copy_name=""
copy_pass=""
'';
};
};
}