nixos-config/user/home.nix

1211 lines
34 KiB
Nix
Raw Normal View History

2022-07-21 00:32:09 -03:00
{ config, pkgs, lib, ... }:
let
2022-06-12 23:47:05 -03:00
key = {
2022-08-04 11:58:56 -03:00
layout = "colemak";
hints = "arstwfuyneio";
2022-07-21 00:32:09 -03:00
left = "n";
down = "e";
up = "i";
right = "o";
2022-08-04 11:58:56 -03:00
next = "l";
2022-06-12 23:47:05 -03:00
tabL = "u";
tabR = "Y";
2022-08-04 11:58:56 -03:00
insertMode = "s";
insertQuit = "kk";
menu = "s";
2022-06-12 23:47:05 -03:00
};
2022-06-13 10:34:47 -03:00
font = {
mono = "Hack Nerd Font";
interface = "Liberation Sans";
size = {
2022-08-04 11:58:56 -03:00
small = 12;
medium = 14;
big = 16;
2022-06-13 10:34:47 -03:00
};
};
accents = {
2022-06-13 12:07:08 -03:00
red = {
color = "#F44336";
fg = "#ffffff";
};
2022-06-13 10:34:47 -03:00
};
themes = {
dark = {
2022-07-21 00:32:09 -03:00
background = "~/.local/share/backgrounds/assembly_dark.png";
2022-08-01 21:40:12 -03:00
opacity = 98;
2022-08-01 20:59:20 -03:00
opacityHex = "ee";
2022-06-13 10:34:47 -03:00
color = {
2022-07-21 00:32:09 -03:00
type = "dark";
bg = "#202020";
bg_light = "#404040";
bg_dark = "#191919";
txt = "#FFFFFF";
nontxt = "#252525";
random_range = "[a-f]";
2022-06-13 10:34:47 -03:00
normal = {
2022-07-21 00:32:09 -03:00
black = "#404040";
red = "#AB4642";
green = "#A1B56C";
yellow = "#E6C547";
blue = "#6C99DA";
magenta = "#C397D8";
cyan = "#70C0BA";
white = "#EAEAEA";
#non standard
orange = "#FF7500";
brown = "#A07040";
2022-06-13 10:34:47 -03:00
};
};
};
};
2022-07-16 02:12:18 -03:00
papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; });
2022-07-21 00:32:09 -03:00
orchis_theme_compact =
(pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
nerdfonts_fira_hack =
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
2022-06-13 12:07:08 -03:00
accent = accents.red;
2022-08-01 20:59:20 -03:00
theme = themes.dark;
color = theme.color;
2022-07-20 22:14:36 -03:00
pulse_sink = pkgs.writeShellScriptBin "pulse_sink" ''
#!/bin/sh
2022-08-01 23:00:36 -03:00
output=$(printf "HDMI\nHeadphones" | ${bmenu}/bin/bmenu -b)
2022-07-20 22:14:36 -03:00
vol=$(${pkgs.pamixer}/bin/pamixer --get-volume)
case "$output" in
2022-07-21 00:32:09 -03:00
HDMI)
pactl set-default-sink alsa_output.pci-0000_07_00.1.hdmi-stereo-extra1
;;
Headphones)
pactl set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo
;;
2022-07-20 22:14:36 -03:00
esac
${pkgs.pamixer}/bin/pamixer --set-volume "$vol"
'';
2022-08-01 20:59:20 -03:00
bmenu = pkgs.writeScriptBin "bmenu" ''
#!${pkgs.fish}/bin/fish
# wrapper around bemenu
# bmenu * - use as dmenu, -p for custom prompt (man bemenu)
# bmenu run - select from .desktop files and run it
# bmenu start - internal option
2022-08-01 23:38:27 -03:00
2022-08-01 20:59:20 -03:00
set swaymsg ${pkgs.sway}/bin/swaymsg
set swaymsg ${pkgs.sway}/bin/swaymsg
if test "$argv[1]" = "run"
test -n "$argv[2]" && set t "$argv[2]" || set t "terminal"
test -n "$i3SOCK" && set wrapper 'i3-msg exec --'
test -n "$SWAYSOCK" && set wrapper 'swaymsg exec --'
exec ${pkgs.j4-dmenu-desktop}/bin/j4-dmenu-desktop \
--dmenu="bmenu start -p Iniciar:" \
--term "$t" \
--wrapper="$wrapper" \
--no-generic
end
if test -n "$SWAYSOCK"
swaymsg -t get_tree |
${pkgs.jq}/bin/jq -je '..|select(.focused? and .fullscreen_mode? == 1)|""' &&
${pkgs.sway}/bin/swaymsg -q fullscreen off &&
set fullscreen
${pkgs.sway}/bin/swaymsg -t get_outputs |
${pkgs.jq}/bin/jq -r 'map(.focused)|reverse|index(true)' |
read focused_output
test -n "$focused_output"
and set focused_output "-m $focused_output"
end
function clean_exit
set -q fullscreen
and swaymsg -q fullscreen on &
end
trap clean_exit EXIT
# t title
# f filter
# n normal
# h highlighted
# s selected
# sc scrollbar
2022-08-04 11:58:56 -03:00
set fn "${font.mono} ${toString font.size.small}"
2022-08-01 20:59:20 -03:00
2022-08-01 23:38:27 -03:00
set tb "${color.bg}${theme.opacityHex}"
set tf "${accent.color}"
2022-08-01 20:59:20 -03:00
2022-08-01 23:38:27 -03:00
set fb "${color.bg}${theme.opacityHex}"
set ff "${color.txt}"
2022-08-01 20:59:20 -03:00
2022-08-01 23:38:27 -03:00
set nb "${color.bg}${theme.opacityHex}"
set nf "${color.txt}"
set hb "${accent.color}"
set hf "${accent.fg}"
2022-08-01 20:59:20 -03:00
${pkgs.dhist}/bin/dhist wrap -- ${pkgs.bemenu}/bin/bemenu \
$focused_output\
--ignorecase\
--bottom\
--no-overlap\
--list 20\
--prefix '>'\
--fn "$fn"\
--tb "$tb" --tf "$tf" \
--fb "$fb" --ff "$ff" \
--nb "$nb" --nf "$nf" \
--hb "$hb" --hf "$hf" \
$argv
# vim: ft=fish
'';
2022-08-02 22:33:21 -03:00
volumesh =
pkgs.writeShellScriptBin "volumesh" (builtins.readFile ./scripts/volumesh);
_lock = pkgs.writeShellScriptBin "_lock" ''
swaylock -f
systemctl --user start swayidle.service
'';
_suspend = pkgs.writeShellScriptBin "_suspend" ''
${_lock}/bin/_lock
systemctl suspend
'';
_sway_idle_toggle = pkgs.writeShellScriptBin "_sway_idle_toggle" ''
if pidof swayidle > /dev/null; then
systemctl --user stop swayidle.service
else
systemctl --user start swayidle.service
fi
'';
2022-07-20 22:14:36 -03:00
in {
2022-06-05 01:43:16 -03:00
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "lelgenio";
home.homeDirectory = "/home/lelgenio";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.packages = with pkgs; [
alacritty
exa
fd
2022-07-20 22:14:36 -03:00
# text manipulation
pkgs.unstable.helix
2022-07-20 20:07:58 -03:00
sd
2022-06-05 01:43:16 -03:00
ripgrep
2022-07-20 22:14:36 -03:00
# desktop
kanshi
xfce.thunar
2022-07-20 22:44:41 -03:00
pass
2022-08-01 20:15:26 -03:00
dhist
2022-08-01 20:59:20 -03:00
bmenu
2022-08-02 00:07:04 -03:00
volumesh
pamixer
libnotify
2022-07-20 22:14:36 -03:00
# media
2022-06-12 23:47:05 -03:00
yt-dlp
2022-06-09 23:16:20 -03:00
ffmpeg
imagemagick
mpv
2022-07-21 10:36:38 -03:00
mpc-cli
pulse_sink
2022-08-02 21:36:25 -03:00
#games
lutris
steam
2022-07-20 20:07:58 -03:00
# chat
tdesktop
2022-08-02 21:36:25 -03:00
# discord # I'm using webcord, see home.activation
2022-08-03 11:56:30 -03:00
thunderbird
2022-07-20 20:07:58 -03:00
# Theming
2022-07-20 22:14:36 -03:00
orchis_theme_compact
papirus_red
2022-07-21 00:29:12 -03:00
libsForQt5.qtstyleplugins
qt5.qtsvg
2022-07-20 22:14:36 -03:00
## fonts
2022-06-13 10:34:47 -03:00
liberation_ttf
hack-font
font-awesome_5
fira-code
2022-07-21 00:32:09 -03:00
nerdfonts_fira_hack
2022-07-20 20:07:58 -03:00
# Programming
vscode
2022-08-04 11:58:56 -03:00
rustup
# cargo
# cargo-edit
2022-07-20 20:07:58 -03:00
rust-analyzer
gcc
2022-07-21 10:36:38 -03:00
nixfmt
2022-06-05 01:43:16 -03:00
];
2022-08-01 21:14:29 -03:00
programs.fish = {
enable = true;
interactiveShellInit = ''
2022-08-01 23:38:27 -03:00
set -g __accent_color "${accent.color}"
alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'"
2022-08-01 21:14:29 -03:00
'';
2022-08-01 21:32:44 -03:00
shellAbbrs = {
2022-08-04 21:26:50 -03:00
v = "kak";
# system
2022-08-01 23:38:27 -03:00
sv = "sudo systemct";
suv = "sudo systemct --user";
# git abbrs
g = "git";
ga = "git add";
gs = "git status";
gsh = "git show";
gl = "git log";
gg = "git graph";
gd = "git diff";
gds = "git diff --staged";
gc = "git commit";
gca = "git commit --all";
gcf = "git commit --fixup";
gp = "git push -u origin (git branch --show-current)";
gw = "git switch";
gr = "cd (git root)";
gri = "git rebase --interactive FETCH_HEAD";
2022-08-01 23:18:35 -03:00
};
2022-08-01 23:38:27 -03:00
functions = { fish_greeting = ""; };
2022-08-01 23:18:35 -03:00
};
programs.zoxide = {
enable = true;
enableFishIntegration = true;
2022-08-01 21:14:29 -03:00
};
home.file = {
# ".config/sway/config".source = ./sway;
".config/fish/conf.d/prompt.fish".source = ./fish_prompt.fish;
2022-08-01 23:18:29 -03:00
".local/share/backgrounds".source = ./backgrounds;
2022-08-04 23:12:25 -03:00
".config/kak/kakrc".text = let
2022-08-04 23:22:41 -03:00
colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) {
accent_fg = accent.fg;
accent_color = accent.color;
bg_light = color.bg_light;
bg_dark = color.bg_dark;
nontxt = color.nontxt;
orange = color.normal.orange;
brown = color.normal.brown;
2022-08-04 21:26:50 -03:00
};
2022-08-04 23:22:41 -03:00
in with colors;
lib.concatStringsSep "\n" (map (lib.readFile) [
./kak/filetypes.kak
./kak/hooks.kak
./kak/indent.kak
./kak/keys.kak
./kak/plug.kak
./kak/usermode.kak
]) + ''
set global scrolloff 10,20
set global autoreload yes
set global startup_info_version 20200901
'' + ''
face global crosshairs_line default,${bg_dark}
face global crosshairs_column default+b
# For Code
face global value magenta
face global type yellow
face global variable blue
face global module ${brown}
face global function ${orange}
face global string green
face global keyword ${accent_color}
face global operator yellow
face global attribute cyan
face global comment ${bg_light}
face global documentation comment
face global meta +i@function
face global builtin blue
# For markup
face global title blue
face global header cyan
face global mono green
face global block magenta
face global link cyan
face global bullet cyan
face global list yellow
# builtin faces
face global Default default,default
face global PrimaryCursor ${accent_fg},${accent_color}+fg
face global PrimaryCursorEol PrimaryCursor
face global PrimarySelection default,${bg_light}+f
face global SecondaryCursor default,default+rfg
face global SecondaryCursorEol SecondaryCursor
face global SecondarySelection PrimarySelection
face global InactiveCursor ${accent_fg},${bg_light}+fg
face global MenuForeground ${accent_fg},${accent_color}
face global MenuBackground default,${bg_dark}
face global MenuInfo cyan
face global Information default,${bg_dark}
face global Error default,red+g
face global StatusLine %sh{
printf "rgb:"
head /dev/urandom |
base64 |
rg --text -o "${color.random_range}" |
head -n 6 |
sd '\n' ""
}
face global StatusLineMode StatusLine
face global StatusLineInfo StatusLine
face global StatusLineValue StatusLine
face global StatusCursor ${accent_fg},${accent_color}
face global Prompt yellow,default
try %{add-highlighter global/ show-matching}
face global MatchingChar ${accent_color},default+b
# Goodies
try %{add-highlighter global/number-lines number-lines -relative -hlcursor}
face global LineNumbers ${bg_light},default
face global LineNumberCursor default,${bg_dark}
face global LineNumbersWrapped red,default
try %{add-highlighter global/ show-whitespaces}
face global Whitespace ${nontxt},default+f
face global BufferPadding ${nontxt},default
## highlight trailing whitespace
# add-highlighter global/ regex '\h*$' 0:red,red+u
face global Reference default+bu
face global InlayHint ${bg_light}+buif
# Lsp
2022-08-04 21:26:50 -03:00
'' + (lib.concatStringsSep "\n" (lib.mapAttrsToList (name: color: ''
2022-08-04 23:22:41 -03:00
face global HighlightDiagnostic${name} ${color},default+bu
face global Diagnostic${name} ${color},default+bu
face global TextDiagnostic${name} ${color},default+b
face global InlayDiagnostic${name} ${color},default+br
2022-08-04 21:26:50 -03:00
'') {
2022-08-04 23:22:41 -03:00
Error = "red";
Warning = "yellow";
Hint = "blue";
2022-08-04 21:26:50 -03:00
}));
2022-08-01 21:14:29 -03:00
};
2022-08-01 21:40:12 -03:00
programs.alacritty = {
enable = true;
settings = {
2022-08-04 11:58:56 -03:00
font = {
size = font.size.small;
normal = { family = font.mono; };
};
2022-08-01 23:38:27 -03:00
colors = {
primary = {
background = "${color.bg}";
foreground = "${color.txt}";
2022-08-01 21:40:12 -03:00
};
2022-08-01 23:38:27 -03:00
cursor = {
text = "#000000";
cursor = "${accent.color}";
2022-08-01 21:40:12 -03:00
};
2022-08-01 23:38:27 -03:00
normal = {
black = "${color.normal.black}";
red = "${color.normal.red}";
green = "${color.normal.green}";
yellow = "${color.normal.yellow}";
blue = "${color.normal.blue}";
magenta = "${color.normal.magenta}";
cyan = "${color.normal.cyan}";
white = "${color.normal.white}";
2022-08-01 21:40:12 -03:00
};
};
2022-08-01 23:38:27 -03:00
draw_bold_text_with_bright_colors = false;
window = {
opacity = theme.opacity / 100.0;
dynamic_padding = true;
2022-08-01 21:40:12 -03:00
};
2022-08-04 11:58:56 -03:00
hints = {
alphabet = key.hints;
enabled = [{
regex = let
mimes =
"(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
# I fucking hate regex, look at this bullshit
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^`'';
in "${mimes}[${delimiters}]+";
command = "xdg-open";
post_processing = true;
mouse = {
enabled = true;
mods = "None";
};
binding = {
key = "U";
mods = "Control|Shift";
};
}];
};
mouse = { hide_when_typing = true; };
key_bindings = [
{
key = lib.toUpper key.up;
mode = "Vi|~Search";
action = "Up";
}
{
key = lib.toUpper key.down;
mode = "Vi|~Search";
action = "Down";
}
{
key = lib.toUpper key.left;
mode = "Vi|~Search";
action = "Left";
}
{
key = lib.toUpper key.right;
mode = "Vi|~Search";
action = "Right";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ScrollToBottom";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ToggleViMode";
}
{
key = lib.toUpper key.next;
mode = "Vi|~Search";
action = "SearchNext";
}
{
key = "Up";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineUp";
}
{
key = "Down";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineDown";
}
{
key = "PageUp";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageUp";
}
{
key = "PageDown";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageDown";
}
{
key = "N";
mods = "Control|Shift";
action = "SpawnNewInstance";
}
# {%@@ if key.layout == "colemak" @@%}
{
key = "T";
mode = "Vi|~Search";
action = "SemanticRightEnd";
}
# {%@@ endif @@%}
];
2022-08-01 21:40:12 -03:00
};
};
2022-07-16 02:43:19 -03:00
programs.helix = {
2022-07-16 14:24:09 -03:00
enable = true;
2022-07-16 15:42:27 -03:00
package = pkgs.unstable.helix;
2022-07-16 14:24:09 -03:00
settings = {
theme = "gruvbox";
2022-07-16 15:42:27 -03:00
editor = {
whitespace.render = "all";
whitespace.characters = {
2022-07-16 15:49:57 -03:00
space = "·";
tab = "";
2022-07-16 15:42:27 -03:00
newline = "¬";
};
};
keys.normal = {
2022-07-21 00:32:09 -03:00
# basic movement
n = "move_char_left";
e = "move_line_down";
i = "move_line_up";
o = "move_char_right";
# search
l = "search_next";
L = "search_prev";
# edits
s = "insert_mode";
# open newline
h = "open_below";
H = "open_above";
# selections
k = "select_regex";
K = "split_selection";
"C-k" = "split_selection_on_newline";
# goto mode
g.n = "goto_line_start";
g.o = "goto_line_end";
};
2022-07-19 23:53:22 -03:00
keys.select = {
2022-07-21 00:32:09 -03:00
# basic movement
n = "extend_char_left";
e = "extend_line_down";
i = "extend_line_up";
o = "extend_char_right";
# search
l = "search_next";
L = "search_prev";
# edits
s = "insert_mode";
# open newline
h = "open_below";
H = "open_above";
# selections
k = "select_regex";
K = "split_selection";
"C-k" = "split_selection_on_newline";
# goto mode
g.n = "goto_line_start";
g.o = "goto_line_end";
};
keys.insert = { "A-k" = "normal_mode"; };
2022-07-16 02:43:19 -03:00
};
2022-07-16 15:42:27 -03:00
};
2022-08-02 22:33:21 -03:00
home.sessionVariables = {
2022-08-04 21:26:50 -03:00
EDITOR = "kak";
2022-08-02 22:33:21 -03:00
VOLUME_CHANGE_SOUND =
"${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/audio-volume-change.oga";
2022-08-02 00:07:04 -03:00
};
2022-06-05 01:43:16 -03:00
programs.firefox = {
enable = true;
package = pkgs.firefox;
2022-07-19 23:43:50 -03:00
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
ublock-origin
tree-style-tab
sponsorblock
duckduckgo-privacy-essentials
];
2022-06-13 20:10:58 -03:00
profiles = {
main = {
isDefault = true;
settings = {
"devtools.theme" = "dark";
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.tabs.inTitlebar" = 0;
};
userChrome = ''
2022-07-16 02:12:18 -03:00
#tabbrowser-tabs { visibility: collapse !important; }
2022-06-13 20:10:58 -03:00
'';
};
};
2022-06-05 01:43:16 -03:00
};
2022-06-12 23:47:05 -03:00
programs.command-not-found.enable = true;
# home.file = {
# ".config/sway/config".source = ./sway;
# };
2022-06-13 09:45:20 -03:00
programs.waybar = {
enable = true;
2022-06-13 10:34:47 -03:00
systemd.enable = true;
systemd.target = "sway-session.target";
2022-06-13 09:45:20 -03:00
settings = [{
layer = "top";
2022-07-21 00:32:09 -03:00
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "clock" ];
modules-right = [ "custom/caffeine" "pulseaudio" "network" ];
2022-07-21 00:32:09 -03:00
network = {
interval = 5;
tooltip = false;
on-click = "terminal iwd";
format-wifi = "{icon}";
format-icons = [ "" "" "" "" "" ];
format-ethernet = "";
format-linked = "";
format-disconnected = "";
2022-07-20 23:08:00 -03:00
};
2022-07-21 00:38:34 -03:00
"sway/workspaces" = {
enable-bar-scroll = true;
format = "{icon}";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = "";
urgent = "";
focused = "";
default = "";
};
};
2022-07-21 00:32:09 -03:00
clock = {
interval = 60;
format = "<b>{:%H:%M %a %d/%m}</b>";
tooltip = false;
2022-07-21 00:29:12 -03:00
};
"custom/caffeine" = {
format = "{}";
exec = "pidof swayidle > /dev/null && echo || echo ";
on-click = "_sway_idle_toggle";
interval = 1;
tooltip = false;
};
2022-07-21 00:32:09 -03:00
pulseaudio = {
interval = 5;
tooltip = false;
scroll-step = 10;
format = "{icon}";
format-bluetooth = "";
format-bluetooth-muted = "";
format-muted = "";
format-icons = {
headphone = [ " " " 奔" " " ];
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "奔" "" ];
};
on-click = "pavucontrol";
on-click-right = "pulse-sink";
2022-07-19 23:34:15 -03:00
};
2022-06-13 09:45:20 -03:00
}];
2022-06-13 10:34:47 -03:00
style = ''
/* {%@@ set bg_rgb = hex2rgb(color.bg) @@%} */
* {
2022-08-04 11:58:56 -03:00
font: ${
toString font.size.medium
}px "${font.interface}", Font Awesome, Fira Code Nerd Font;
2022-07-21 00:32:09 -03:00
border-radius:0;
margin:0;
padding: 0;
transition-duration:0;
2022-06-13 10:34:47 -03:00
}
window#waybar {
2022-07-21 00:32:09 -03:00
/* background-color: rgba(30,30,30,.9); */
transition-duration: .5s;
/* TODO: background opacity */
background-color: ${color.bg};
/*{%@@ if bar_pos == "top" @@%}
border-bottom:
{%@@ else @@%}
border-top:
{%@@ endif @@%}*/
2022-06-13 10:34:47 -03:00
border-bottom:
2022-07-21 00:32:09 -03:00
2px solid ${color.bg_dark};
2022-06-13 10:34:47 -03:00
}
window#waybar.solo {
2022-07-21 00:32:09 -03:00
background-color: ${color.bg};
2022-06-13 10:34:47 -03:00
}
#workspaces button {
2022-07-21 00:32:09 -03:00
color: ${color.bg_light};
min-width:50px;
background-color: transparent;
border: 3px solid transparent;
2022-06-13 10:34:47 -03:00
}
#workspaces button.focused {
2022-07-21 00:32:09 -03:00
color: ${color.txt};
/*{%@@ if bar_pos == "top" @@%}
border-top:
{%@@ else @@%}
border-bottom:
{%@@ endif @@%}*/
border-top:
3px solid ${accent.color};
/* border-bottom: 3px solid transparent; */
2022-06-13 10:34:47 -03:00
}
/*Window Title*/
#window {
2022-07-21 00:32:09 -03:00
color: ${color.txt};
margin:0 4px;
2022-06-13 10:34:47 -03:00
}
#mode {
2022-07-21 00:32:09 -03:00
color: ${accent.color};
2022-06-13 10:34:47 -03:00
}
#mpd,
#custom-mpd,
#tray,
#clock,
#network,
#battery,
#backlight,
#bluetooth,
#pulseaudio,
#custom-mail,
#custom-spigot,
#custom-updates,
#custom-weather,
#custom-unpushed,
#custom-transmissionD,
#custom-transmissionS,
#custom-delugeD,
#custom-delugeS,
#custom-caffeine
{
2022-07-21 00:32:09 -03:00
margin: 0 7px;
color: ${color.txt};
opacity:.7;
2022-06-13 10:34:47 -03:00
}
#battery{
2022-07-21 00:32:09 -03:00
margin-right:15px;
2022-06-13 10:34:47 -03:00
}
#clock,
#custom-weather
{
2022-08-04 11:58:56 -03:00
font-size: ${toString font.size.big}px;
2022-06-13 10:34:47 -03:00
}
#network,
#pulseaudio,
#custom-caffeine
{
2022-07-21 00:32:09 -03:00
margin-top:-1px;
font-size:16px;
2022-06-13 10:34:47 -03:00
}
#mpd,
#window,
#workspaces
{
2022-07-21 00:32:09 -03:00
font-weight:normal;
2022-06-13 10:34:47 -03:00
}
#custom-unpushed,
#custom-recording {
2022-07-21 00:32:09 -03:00
min-width:15px;
color: #ee4040;
2022-06-13 10:34:47 -03:00
}
#tray {
2022-07-21 00:32:09 -03:00
padding: 0;
margin: 0;
2022-06-13 10:34:47 -03:00
}
#language {
2022-08-04 11:58:56 -03:00
font-size: ${toString font.size.medium}px;
2022-07-21 00:32:09 -03:00
color: ${color.bg_light};
2022-06-13 10:34:47 -03:00
}
#custom-sleep {
2022-07-21 00:32:09 -03:00
color: ${accent.color};
2022-08-04 11:58:56 -03:00
font-size: ${toString font.size.big}px;
2022-07-21 00:32:09 -03:00
font-weight: bold;
2022-06-13 10:34:47 -03:00
}
'';
2022-06-13 09:45:20 -03:00
};
2022-06-12 23:47:05 -03:00
wayland.windowManager.sway = {
enable = true;
config = {
2022-07-11 21:34:23 -03:00
bars = [ ];
2022-06-13 12:07:08 -03:00
window.titlebar = false;
gaps = {
smartGaps = true;
smartBorders = "on";
inner = 5;
};
2022-07-21 00:32:09 -03:00
colors = let
acc = accent.color;
fg_acc = accent.fg;
fg_color = color.txt;
bg_color = color.bg_dark;
alert = "#000000";
client = border: background: text: indicator: childBorder: {
inherit border background text indicator childBorder;
2022-06-13 12:07:08 -03:00
};
2022-07-21 00:32:09 -03:00
in {
focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color;
urgent = client alert alert fg_color alert alert;
};
2022-08-01 23:38:27 -03:00
output = { "*" = { bg = "${theme.background} fill"; }; };
2022-06-12 23:47:05 -03:00
input."type:touchpad" = {
# Disable While Typing
dwt = "disabled";
natural_scroll = "enabled";
tap = "enabled";
};
input."*" = {
2022-07-20 19:48:29 -03:00
xkb_layout = "us(colemak),br";
2022-06-12 23:47:05 -03:00
xkb_options = "lv3:lsgt_switch,grp:shifts_toggle";
xkb_numlock = "enabled";
repeat_rate = "30";
repeat_delay = "200";
};
2022-07-20 22:14:36 -03:00
assigns = {
"10" = [
2022-07-21 00:32:09 -03:00
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
2022-08-02 21:17:03 -03:00
{ class = "WebCord"; }
2022-07-20 22:14:36 -03:00
];
};
2022-07-21 00:32:09 -03:00
modes = let return_mode = lib.mapAttrs (k: v: "${v}; mode default");
2022-07-20 22:14:36 -03:00
in {
2022-08-02 00:07:04 -03:00
audio = {
2022-08-02 22:33:21 -03:00
${key.tabL} = "volumes decrease";
2022-08-02 00:07:04 -03:00
} // return_mode {
"space" = "exec mpc toggle";
2022-07-20 22:14:36 -03:00
"escape" = "";
"s" = "exec ${pulse_sink}/bin/pulse_sink";
};
};
2022-08-01 21:42:30 -03:00
floating.modifier = "Mod4";
2022-07-21 00:32:09 -03:00
keybindings = let
2022-06-12 23:47:05 -03:00
mod = "Mod4";
2022-08-01 20:59:20 -03:00
menu = "bmenu run";
2022-06-12 23:47:05 -03:00
terminal = "alacritty";
2022-06-13 09:45:20 -03:00
workspace_binds = {
2022-06-12 23:47:05 -03:00
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
2022-06-13 09:45:20 -03:00
"${mod}+0" = "workspace number 10";
2022-07-21 00:32:09 -03:00
"${mod}+Shift+1" = "move container to workspace number 1";
"${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+3" = "move container to workspace number 3";
"${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+5" = "move container to workspace number 5";
"${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+7" = "move container to workspace number 7";
"${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+9" = "move container to workspace number 9";
"${mod}+Shift+0" = "move container to workspace number 10";
2022-06-13 09:45:20 -03:00
};
2022-07-21 00:32:09 -03:00
prev_next_binds = let
join_dict_arr = builtins.foldl' (a: v: a // v) { };
maybe_window = key:
if (lib.strings.hasInfix "button" key) then
"--whole-window"
else
"";
prev_binds = map (key: {
"${maybe_window key} ${mod}+${key}" = "workspace prev_on_output";
}) [ key.tabL "bracketleft" "Prior" "button9" "button4" ];
next_binds = map (key: {
"${maybe_window key} ${mod}+${key}" = "workspace next_on_output";
}) [ key.tabR "bracketright" "Next" "button8" "button5" ];
in join_dict_arr (prev_binds ++ next_binds);
2022-06-13 09:45:20 -03:00
movement_binds = {
"${mod}+${key.left}" = "focus left";
"${mod}+${key.down}" = "focus down";
"${mod}+${key.up}" = "focus up";
"${mod}+${key.right}" = "focus right";
"${mod}+Left" = "focus left";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Right" = "focus right";
"${mod}+Shift+${key.left}" = "move left";
"${mod}+Shift+${key.down}" = "move down";
"${mod}+Shift+${key.up}" = "move up";
"${mod}+Shift+${key.right}" = "move right";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Right" = "move right";
"${mod}+Control+${key.left}" = "resize shrink width";
"${mod}+Control+${key.down}" = "resize grow height";
"${mod}+Control+${key.up}" = "resize shrink height";
"${mod}+Control+${key.right}" = "resize grow width";
"${mod}+Control+Left" = "resize shrink width";
"${mod}+Control+Down" = "resize grow height";
"${mod}+Control+Up" = "resize shrink height";
"${mod}+Control+Right" = "resize grow width";
"${mod}+mod1+${key.left}" = "focus output left";
"${mod}+mod1+${key.down}" = "focus output down";
"${mod}+mod1+${key.up}" = "focus output up";
"${mod}+mod1+${key.right}" = "focus output right";
"${mod}+mod1+Left" = "focus output left";
"${mod}+mod1+Down" = "focus output down";
"${mod}+mod1+Up" = "focus output up";
"${mod}+mod1+Right" = "focus output right";
"${mod}+mod1+Shift+${key.left}" = "move workspace output left";
"${mod}+mod1+Shift+${key.down}" = "move workspace output down";
"${mod}+mod1+Shift+${key.up}" = "move workspace output up";
"${mod}+mod1+Shift+${key.right}" = "move workspace output right";
"${mod}+mod1+Shift+Left" = "move workspace output left";
"${mod}+mod1+Shift+Down" = "move workspace output down";
"${mod}+mod1+Shift+Up" = "move workspace output up";
"${mod}+mod1+Shift+Right" = "move workspace output right";
};
audio_binds = {
2022-07-21 00:32:09 -03:00
XF86AudioRaiseVolume =
"exec pactl set-sink-volume @DEFAULT_SINK@ +10%";
XF86AudioLowerVolume =
"exec pactl set-sink-volume @DEFAULT_SINK@ -10%";
2022-06-13 09:45:20 -03:00
XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
2022-07-21 00:32:09 -03:00
XF86AudioMicMute =
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
2022-06-13 09:45:20 -03:00
# Control media
XF86AudioPlay = "exec playerctl play-pause";
XF86AudioPause = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous";
};
system_binds = {
"--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend";
"${mod}+Alt+c" = "exec ${_sway_idle_toggle}/bin/_sway_idle_toggle";
};
2022-06-13 09:45:20 -03:00
in {
"${mod}+Return" = "exec ${terminal}";
2022-07-20 20:07:58 -03:00
"${mod}+Ctrl+Return" = "exec thunar";
2022-06-13 09:45:20 -03:00
"${mod}+x" = "kill";
"${mod}+s" = "exec ${menu}";
2022-07-20 22:14:36 -03:00
"${mod}+m" = "mode audio";
2022-06-13 09:45:20 -03:00
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
"${mod}+f" = "fullscreen toggle";
"${mod}+a" = "focus parent";
# "${mod}+s" = "layout stacking";
"${mod}+w" = "layout tabbed";
# "${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+Shift+minus" = "move scratchpad";
"${mod}+minus" = "scratchpad show";
"${mod}+Shift+c" = "reload";
# "${mod}+Shift+e" =
# "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${mod}+r" = "mode resize";
2022-07-21 00:32:09 -03:00
} // workspace_binds // prev_next_binds // movement_binds // audio_binds
2022-07-20 19:48:29 -03:00
// system_binds
2022-06-12 23:47:05 -03:00
# // map (key: "$mod+${key} workspace prev_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
# // map (key: "$mod+${key} workspace next_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
;
terminal = pkgs.alacritty.executable;
2022-06-13 09:45:20 -03:00
};
};
2022-08-01 23:38:27 -03:00
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 360;
command = "swaylock -f";
}
{
timeout = 1800;
2022-08-02 22:33:21 -03:00
command = ''
mpc status | grep "^[playing]" > /dev/null || swaymsg "output * dpms off"'';
resumeCommand = ''swaymsg "output * dpms on"'';
2022-08-01 23:38:27 -03:00
}
];
events = [{
event = "before-sleep";
command = "swaylock -f";
}];
};
2022-08-02 22:34:22 -03:00
xdg.configFile."swaylock/config".text = ''
2022-08-04 11:58:56 -03:00
image=${theme.background}
font=${font.interface}
font-size=${toString font.size.medium}
indicator-thickness=20
color=${color.bg}
inside-color=#FFFFFF00
bs-hl-color=${color.normal.red}
ring-color=${color.normal.green}
key-hl-color=${accent.color}
# divisor lines
separator-color=#aabbcc00
line-color=#aabbcc00
line-clear-color=#aabbcc00
line-caps-lock-color=#aabbcc00
line-ver-color=#aabbcc00
line-wrong-color=#aabbcc00
2022-08-02 22:33:21 -03:00
'';
2022-07-21 01:04:22 -03:00
services.gammastep = {
enable = true;
provider = "geoclue2";
};
2022-06-13 09:45:20 -03:00
services.kanshi = {
enable = true;
profiles = {
sedetary = {
2022-07-21 00:32:09 -03:00
outputs = [
{
criteria = "eDP-1";
status = "disable";
position = "1920,312";
}
{
criteria = "HDMI-A-1";
position = "0,0";
}
2022-07-16 02:12:18 -03:00
];
2022-07-21 00:32:09 -03:00
exec = [ "xrdb .Xresources" ];
2022-07-16 02:12:18 -03:00
};
2022-06-13 09:45:20 -03:00
nomad = {
outputs = [{
criteria = "eDP-1";
status = "enable";
position = "1920,312";
}];
2022-07-21 00:32:09 -03:00
exec = [ "xrdb .Xresources" ];
2022-06-13 09:45:20 -03:00
};
2022-06-12 23:47:05 -03:00
};
2022-08-02 00:16:05 -03:00
};
programs.mako = {
enable = true;
borderSize = 2;
2022-08-02 22:33:21 -03:00
padding = "5";
margin = "15";
2022-08-02 00:16:05 -03:00
layer = "overlay";
backgroundColor = color.bg;
borderColor = accent.color;
progressColor = "over ${accent.color}88";
2022-08-02 22:33:21 -03:00
defaultTimeout = 10000;
# # {{@@ header() @@}}
# # text
# font={{@@ font.interface @@}} {{@@ font.size.small @@}}
# text-color={{@@ color.txt @@}}
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# # colors
# background-color={{@@ color.bg @@}}{{@@ opacity | clamp_to_hex @@}}
# border-color={{@@ accent_color @@}}
# progress-color=over {{@@ accent_color @@}}88
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# # decoration
# border-size=2
# padding=5
# margin=15
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# # features
# icons=1
# markup=1
# actions=1
# default-timeout=10000
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# # position
# layer=overlay
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# [app-name=volumesh]
# default-timeout=5000
# group-by=app-name
# format=<b>%s</b>\n%b
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# [app-name=dotdrop]
# default-timeout=5000
# group-by=app-name
# format=<b>%s</b>\n%b
2022-08-02 00:16:05 -03:00
2022-08-02 22:33:21 -03:00
# # vim: ft=ini
2022-08-02 00:16:05 -03:00
2022-08-02 21:17:03 -03:00
};
home.activation = {
2022-08-02 22:33:21 -03:00
install_flatpaks = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
2022-08-04 23:12:25 -03:00
$DRY_RUN_CMD flatpak $VERBOSE_ARG remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$DRY_RUN_CMD flatpak $VERBOSE_ARG install -y flathub io.github.spacingbat3.webcord
2022-08-02 21:17:03 -03:00
'';
2022-06-12 23:47:05 -03:00
};
2022-06-13 12:07:08 -03:00
services.kdeconnect = {
enable = true;
indicator = true;
};
2022-07-21 10:36:38 -03:00
services.mpd = {
enable = true;
musicDirectory = "~/Música";
};
2022-07-19 22:20:55 -03:00
home.pointerCursor = {
name = "capitaine-cursors";
package = pkgs.capitaine-cursors;
x11.enable = true;
gtk.enable = true;
};
2022-06-13 22:21:47 -03:00
gtk = {
enable = true;
theme = {
name = "Orchis-Red-Dark-Compact";
package = orchis_theme_compact;
};
iconTheme = {
name = "Papirus-Dark";
2022-07-16 02:12:18 -03:00
package = papirus_red;
2022-06-13 22:21:47 -03:00
};
};
2022-07-19 22:05:48 -03:00
qt = {
enable = true;
platformTheme = "gtk";
style.package = pkgs.libsForQt5.qtstyleplugins;
style.name = "gtk2";
};
2022-07-21 00:29:12 -03:00
2022-07-20 00:14:01 -03:00
programs.mangohud.enable = true;
2022-07-20 20:07:58 -03:00
systemd.user.services = {
firefox = {
Unit = {
Description = "Firefox Web browser";
Documentation = "https://github.com/Alexays/Waybar/wiki";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = "${pkgs.firefox}/bin/firefox";
2022-07-20 20:07:58 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
discord = {
Unit = {
Description = "Discord Internet voice chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = "/usr/bin/env flatpak run io.github.spacingbat3.webcord";
2022-07-20 20:07:58 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
telegram = {
Unit = {
Description = "Telegram Internet chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.tdesktop}/bin/telegram-desktop";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
2022-08-02 00:16:05 -03:00
mako = {
Unit = {
Description = "Notification daemon";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
2022-07-20 20:07:58 -03:00
};
2022-07-21 00:32:09 -03:00
}