2022-07-21 00:32:09 -03:00
{ config , pkgs , lib , . . . }:
let
2022-08-04 23:46:59 -03:00
inherit ( import ./variables.nix ) key theme color accent font ;
2022-07-16 02:12:18 -03:00
papirus_red = ( pkgs . unstable . papirus-icon-theme . override { color = " r e d " ; } ) ;
2022-07-21 00:32:09 -03:00
orchis_theme_compact =
( pkgs . orchis-theme . override { tweaks = [ " c o m p a c t " " s o l i d " ] ; } ) ;
nerdfonts_fira_hack =
( pkgs . nerdfonts . override { fonts = [ " F i r a C o d e " " H a c k " ] ; } ) ;
2022-07-20 22:14:36 -03:00
pulse_sink = pkgs . writeShellScriptBin " p u l s e _ s i n k " ''
#!/bin/sh
2022-08-01 23:00:36 -03:00
output = $ ( printf " H D M I \n H e a d p h o n e s " | $ { bmenu } /bin/bmenu - b )
2022-07-20 22:14:36 -03:00
vol = $ ( $ { pkgs . pamixer } /bin/pamixer - - get-volume )
case " $ o u t p u t " 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 " $ v o l "
'' ;
2022-08-01 20:59:20 -03:00
bmenu = pkgs . writeScriptBin " b m e n u " ''
#!${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 " $ a r g v [ 1 ] " = " r u n "
test - n " $ a r g v [ 2 ] " && set t " $ a r g v [ 2 ] " || set t " t e r m i n a l "
test - n " $ i 3 S O C K " && set wrapper ' i3-msg exec - - '
test - n " $ S W A Y S O C K " && set wrapper ' swaymsg exec - - '
exec $ { pkgs . j4-dmenu-desktop } /bin/j4-dmenu-desktop \
- - dmenu = " b m e n u s t a r t - p I n i c i a r : " \
- - term " $ t " \
- - wrapper = " $ w r a p p e r " \
- - no-generic
end
if test - n " $ S W A Y S O C K "
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 " $ f o c u s e d _ o u t p u t "
and set focused_output " - m $ f o c u s e d _ o u t p u t "
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 " $ f n " \
- - tb " $ t b " - - tf " $ t f " \
- - fb " $ f b " - - ff " $ f f " \
- - nb " $ n b " - - nf " $ n f " \
- - hb " $ h b " - - hf " $ h f " \
$ argv
# vim: ft=fish
'' ;
2022-08-02 22:33:21 -03:00
volumesh =
pkgs . writeShellScriptBin " v o l u m e s h " ( builtins . readFile ./scripts/volumesh ) ;
2022-08-04 19:58:09 -03:00
_lock = pkgs . writeShellScriptBin " _ l o c k " ''
swaylock - f
systemctl - - user start swayidle . service
'' ;
_suspend = pkgs . writeShellScriptBin " _ s u s p e n d " ''
$ { _lock } /bin/_lock
systemctl suspend
'' ;
_sway_idle_toggle = pkgs . writeShellScriptBin " _ s w a y _ i d l e _ t o g g l e " ''
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-08-04 23:46:59 -03:00
imports = [
./waybar.nix
2022-08-04 23:50:58 -03:00
./helix.nix
2022-08-04 23:46:59 -03:00
] ;
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 = " l e l g e n i o " ;
home . homeDirectory = " / h o m e / l e l g e n i o " ;
# 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 = " 2 2 . 0 5 " ;
# 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
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 " _ f i s h _ p r o m p t _ c o l o r ' $ _ _ a c c e n t _ c o l o r ' "
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 = " k a k " ;
# system
2022-08-01 23:38:27 -03:00
sv = " s u d o s y s t e m c t " ;
suv = " s u d o s y s t e m c t - - u s e r " ;
# git abbrs
g = " g i t " ;
ga = " g i t a d d " ;
gs = " g i t s t a t u s " ;
gsh = " g i t s h o w " ;
gl = " g i t l o g " ;
gg = " g i t g r a p h " ;
gd = " g i t d i f f " ;
gds = " g i t d i f f - - s t a g e d " ;
gc = " g i t c o m m i t " ;
gca = " g i t c o m m i t - - a l l " ;
gcf = " g i t c o m m i t - - f i x u p " ;
gp = " g i t p u s h - u o r i g i n ( g i t b r a n c h - - s h o w - c u r r e n t ) " ;
gw = " g i t s w i t c h " ;
gr = " c d ( g i t r o o t ) " ;
gri = " g i t r e b a s e - - i n t e r a c t i v e F E T C H _ H E A D " ;
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;
" . c o n f i g / f i s h / c o n f . d / p r o m p t . f i s h " . source = ./fish_prompt.fish ;
2022-08-01 23:18:29 -03:00
" . l o c a l / s h a r e / b a c k g r o u n d s " . source = ./backgrounds ;
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 = " # 0 0 0 0 0 0 " ;
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 =
" ( m a i l t o : | g e m i n i : | g o p h e r : | h t t p s : | h t t p : | n e w s : | f i l e : | g i t : | s s h : | f t p : ) " ;
# I fucking hate regex, look at this bullshit
delimiters = '' ^ \ \ u 0 0 0 0 - \ \ u 0 0 1 F \ \ u 0 0 7 F - \ \ u 0 0 9 F < > " \ \ s { - } \ \ ^ ⟨ ⟩ ` '' ;
in " ${ mimes } [ ${ delimiters } ] + " ;
command = " x d g - o p e n " ;
post_processing = true ;
mouse = {
enabled = true ;
mods = " N o n e " ;
} ;
binding = {
key = " U " ;
mods = " C o n t r o l | S h i f t " ;
} ;
} ] ;
} ;
mouse = { hide_when_typing = true ; } ;
key_bindings = [
{
key = lib . toUpper key . up ;
mode = " V i | ~ S e a r c h " ;
action = " U p " ;
}
{
key = lib . toUpper key . down ;
mode = " V i | ~ S e a r c h " ;
action = " D o w n " ;
}
{
key = lib . toUpper key . left ;
mode = " V i | ~ S e a r c h " ;
action = " L e f t " ;
}
{
key = lib . toUpper key . right ;
mode = " V i | ~ S e a r c h " ;
action = " R i g h t " ;
}
{
key = lib . toUpper key . insertMode ;
mode = " V i | ~ S e a r c h " ;
action = " S c r o l l T o B o t t o m " ;
}
{
key = lib . toUpper key . insertMode ;
mode = " V i | ~ S e a r c h " ;
action = " T o g g l e V i M o d e " ;
}
{
key = lib . toUpper key . next ;
mode = " V i | ~ S e a r c h " ;
action = " S e a r c h N e x t " ;
}
{
key = " U p " ;
mods = " C o n t r o l | S h i f t " ;
mode = " ~ A l t " ;
action = " S c r o l l L i n e U p " ;
}
{
key = " D o w n " ;
mods = " C o n t r o l | S h i f t " ;
mode = " ~ A l t " ;
action = " S c r o l l L i n e D o w n " ;
}
{
key = " P a g e U p " ;
mods = " C o n t r o l | S h i f t " ;
mode = " ~ A l t " ;
action = " S c r o l l H a l f P a g e U p " ;
}
{
key = " P a g e D o w n " ;
mods = " C o n t r o l | S h i f t " ;
mode = " ~ A l t " ;
action = " S c r o l l H a l f P a g e D o w n " ;
}
{
key = " N " ;
mods = " C o n t r o l | S h i f t " ;
action = " S p a w n N e w I n s t a n c e " ;
}
# {%@@ if key.layout == "colemak" @@%}
{
key = " T " ;
mode = " V i | ~ S e a r c h " ;
action = " S e m a n t i c R i g h t E n d " ;
}
# {%@@ endif @@%}
] ;
2022-08-01 21:40:12 -03:00
} ;
} ;
2022-08-04 23:25:17 -03:00
programs . kakoune = {
enable = true ;
extraConfig = let
colors = lib . mapAttrs ( _ : lib . replaceStrings [ " # " ] [ " r g b : " ] ) {
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 ;
} ;
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 " r g b : "
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
'' + ( l i b . c o n c a t S t r i n g s S e p " \ n " ( l i b . m a p A t t r s T o L i s t ( n a m e : c o l o r : ''
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
'' ) {
Error = " r e d " ;
Warning = " y e l l o w " ;
Hint = " b l u e " ;
} ) ) ;
} ;
2022-08-02 22:33:21 -03:00
home . sessionVariables = {
2022-08-04 21:26:50 -03:00
EDITOR = " k a k " ;
2022-08-02 22:33:21 -03:00
VOLUME_CHANGE_SOUND =
" ${ pkgs . sound-theme-freedesktop } / s h a r e / s o u n d s / f r e e d e s k t o p / s t e r e o / a u d i o - v o l u m e - c h a n g e . o g a " ;
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 = {
" d e v t o o l s . t h e m e " = " d a r k " ;
" t o o l k i t . l e g a c y U s e r P r o f i l e C u s t o m i z a t i o n s . s t y l e s h e e t s " = true ;
" b r o w s e r . t a b s . i n T i t l e b a r " = 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;
# };
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 = " o n " ;
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 = " # 0 0 0 0 0 0 " ;
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 } f i l l " ; } ; } ;
2022-06-12 23:47:05 -03:00
input . " t y p e : t o u c h p a d " = {
# Disable While Typing
dwt = " d i s a b l e d " ;
natural_scroll = " e n a b l e d " ;
tap = " e n a b l e d " ;
} ;
input . " * " = {
2022-07-20 19:48:29 -03:00
xkb_layout = " u s ( c o l e m a k ) , b r " ;
2022-06-12 23:47:05 -03:00
xkb_options = " l v 3 : l s g t _ s w i t c h , g r p : s h i f t s _ t o g g l e " ;
xkb_numlock = " e n a b l e d " ;
repeat_rate = " 3 0 " ;
repeat_delay = " 2 0 0 " ;
} ;
2022-07-20 22:14:36 -03:00
assigns = {
" 1 0 " = [
2022-07-21 00:32:09 -03:00
{ app_id = " . * [ T t ] e l e g r a m . * " ; }
{ class = " . * [ T t ] e l e g r a m . * " ; }
{ class = " J i t s i M e e t " ; }
{ class = " d i s c o r d " ; }
{ title = " D i s c o r d " ; }
2022-08-02 21:17:03 -03:00
{ class = " W e b C o r d " ; }
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 } ; m o d e d e f a u l t " ) ;
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 } = " v o l u m e s d e c r e a s e " ;
2022-08-02 00:07:04 -03:00
} // return_mode {
" s p a c e " = " e x e c m p c t o g g l e " ;
2022-07-20 22:14:36 -03:00
" e s c a p e " = " " ;
" s " = " e x e c ${ pulse_sink } / b i n / p u l s e _ s i n k " ;
} ;
} ;
2022-08-01 21:42:30 -03:00
floating . modifier = " M o d 4 " ;
2022-07-21 00:32:09 -03:00
keybindings = let
2022-06-12 23:47:05 -03:00
mod = " M o d 4 " ;
2022-08-01 20:59:20 -03:00
menu = " b m e n u r u n " ;
2022-06-12 23:47:05 -03:00
terminal = " a l a c r i t t y " ;
2022-06-13 09:45:20 -03:00
workspace_binds = {
2022-06-12 23:47:05 -03:00
" ${ mod } + 1 " = " w o r k s p a c e n u m b e r 1 " ;
" ${ mod } + 2 " = " w o r k s p a c e n u m b e r 2 " ;
" ${ mod } + 3 " = " w o r k s p a c e n u m b e r 3 " ;
" ${ mod } + 4 " = " w o r k s p a c e n u m b e r 4 " ;
" ${ mod } + 5 " = " w o r k s p a c e n u m b e r 5 " ;
" ${ mod } + 6 " = " w o r k s p a c e n u m b e r 6 " ;
" ${ mod } + 7 " = " w o r k s p a c e n u m b e r 7 " ;
" ${ mod } + 8 " = " w o r k s p a c e n u m b e r 8 " ;
" ${ mod } + 9 " = " w o r k s p a c e n u m b e r 9 " ;
2022-06-13 09:45:20 -03:00
" ${ mod } + 0 " = " w o r k s p a c e n u m b e r 1 0 " ;
2022-07-21 00:32:09 -03:00
" ${ mod } + S h i f t + 1 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 1 " ;
" ${ mod } + S h i f t + 2 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 2 " ;
" ${ mod } + S h i f t + 3 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 3 " ;
" ${ mod } + S h i f t + 4 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 4 " ;
" ${ mod } + S h i f t + 5 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 5 " ;
" ${ mod } + S h i f t + 6 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 6 " ;
" ${ mod } + S h i f t + 7 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 7 " ;
" ${ mod } + S h i f t + 8 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 8 " ;
" ${ mod } + S h i f t + 9 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 9 " ;
" ${ mod } + S h i f t + 0 " = " m o v e c o n t a i n e r t o w o r k s p a c e n u m b e r 1 0 " ;
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 " b u t t o n " key ) then
" - - w h o l e - w i n d o w "
else
" " ;
prev_binds = map ( key : {
" ${ maybe_window key } ${ mod } + ${ key } " = " w o r k s p a c e p r e v _ o n _ o u t p u t " ;
} ) [ key . tabL " b r a c k e t l e f t " " P r i o r " " b u t t o n 9 " " b u t t o n 4 " ] ;
next_binds = map ( key : {
" ${ maybe_window key } ${ mod } + ${ key } " = " w o r k s p a c e n e x t _ o n _ o u t p u t " ;
} ) [ key . tabR " b r a c k e t r i g h t " " N e x t " " b u t t o n 8 " " b u t t o n 5 " ] ;
in join_dict_arr ( prev_binds ++ next_binds ) ;
2022-06-13 09:45:20 -03:00
movement_binds = {
" ${ mod } + ${ key . left } " = " f o c u s l e f t " ;
" ${ mod } + ${ key . down } " = " f o c u s d o w n " ;
" ${ mod } + ${ key . up } " = " f o c u s u p " ;
" ${ mod } + ${ key . right } " = " f o c u s r i g h t " ;
" ${ mod } + L e f t " = " f o c u s l e f t " ;
" ${ mod } + D o w n " = " f o c u s d o w n " ;
" ${ mod } + U p " = " f o c u s u p " ;
" ${ mod } + R i g h t " = " f o c u s r i g h t " ;
" ${ mod } + S h i f t + ${ key . left } " = " m o v e l e f t " ;
" ${ mod } + S h i f t + ${ key . down } " = " m o v e d o w n " ;
" ${ mod } + S h i f t + ${ key . up } " = " m o v e u p " ;
" ${ mod } + S h i f t + ${ key . right } " = " m o v e r i g h t " ;
" ${ mod } + S h i f t + L e f t " = " m o v e l e f t " ;
" ${ mod } + S h i f t + D o w n " = " m o v e d o w n " ;
" ${ mod } + S h i f t + U p " = " m o v e u p " ;
" ${ mod } + S h i f t + R i g h t " = " m o v e r i g h t " ;
" ${ mod } + C o n t r o l + ${ key . left } " = " r e s i z e s h r i n k w i d t h " ;
" ${ mod } + C o n t r o l + ${ key . down } " = " r e s i z e g r o w h e i g h t " ;
" ${ mod } + C o n t r o l + ${ key . up } " = " r e s i z e s h r i n k h e i g h t " ;
" ${ mod } + C o n t r o l + ${ key . right } " = " r e s i z e g r o w w i d t h " ;
" ${ mod } + C o n t r o l + L e f t " = " r e s i z e s h r i n k w i d t h " ;
" ${ mod } + C o n t r o l + D o w n " = " r e s i z e g r o w h e i g h t " ;
" ${ mod } + C o n t r o l + U p " = " r e s i z e s h r i n k h e i g h t " ;
" ${ mod } + C o n t r o l + R i g h t " = " r e s i z e g r o w w i d t h " ;
" ${ mod } + m o d 1 + ${ key . left } " = " f o c u s o u t p u t l e f t " ;
" ${ mod } + m o d 1 + ${ key . down } " = " f o c u s o u t p u t d o w n " ;
" ${ mod } + m o d 1 + ${ key . up } " = " f o c u s o u t p u t u p " ;
" ${ mod } + m o d 1 + ${ key . right } " = " f o c u s o u t p u t r i g h t " ;
" ${ mod } + m o d 1 + L e f t " = " f o c u s o u t p u t l e f t " ;
" ${ mod } + m o d 1 + D o w n " = " f o c u s o u t p u t d o w n " ;
" ${ mod } + m o d 1 + U p " = " f o c u s o u t p u t u p " ;
" ${ mod } + m o d 1 + R i g h t " = " f o c u s o u t p u t r i g h t " ;
" ${ mod } + m o d 1 + S h i f t + ${ key . left } " = " m o v e w o r k s p a c e o u t p u t l e f t " ;
" ${ mod } + m o d 1 + S h i f t + ${ key . down } " = " m o v e w o r k s p a c e o u t p u t d o w n " ;
" ${ mod } + m o d 1 + S h i f t + ${ key . up } " = " m o v e w o r k s p a c e o u t p u t u p " ;
" ${ mod } + m o d 1 + S h i f t + ${ key . right } " = " m o v e w o r k s p a c e o u t p u t r i g h t " ;
" ${ mod } + m o d 1 + S h i f t + L e f t " = " m o v e w o r k s p a c e o u t p u t l e f t " ;
" ${ mod } + m o d 1 + S h i f t + D o w n " = " m o v e w o r k s p a c e o u t p u t d o w n " ;
" ${ mod } + m o d 1 + S h i f t + U p " = " m o v e w o r k s p a c e o u t p u t u p " ;
" ${ mod } + m o d 1 + S h i f t + R i g h t " = " m o v e w o r k s p a c e o u t p u t r i g h t " ;
} ;
audio_binds = {
2022-07-21 00:32:09 -03:00
XF86AudioRaiseVolume =
" e x e c p a c t l s e t - s i n k - v o l u m e @ D E F A U L T _ S I N K @ + 1 0 % " ;
XF86AudioLowerVolume =
" e x e c p a c t l s e t - s i n k - v o l u m e @ D E F A U L T _ S I N K @ - 1 0 % " ;
2022-06-13 09:45:20 -03:00
XF86AudioMute = " e x e c p a c t l s e t - s i n k - m u t e @ D E F A U L T _ S I N K @ t o g g l e " ;
2022-07-21 00:32:09 -03:00
XF86AudioMicMute =
" e x e c p a c t l s e t - s o u r c e - m u t e @ D E F A U L T _ S O U R C E @ t o g g l e " ;
2022-06-13 09:45:20 -03:00
# Control media
XF86AudioPlay = " e x e c p l a y e r c t l p l a y - p a u s e " ;
XF86AudioPause = " e x e c p l a y e r c t l p l a y - p a u s e " ;
XF86AudioNext = " e x e c p l a y e r c t l n e x t " ;
XF86AudioPrev = " e x e c p l a y e r c t l p r e v i o u s " ;
} ;
2022-08-04 19:58:09 -03:00
system_binds = {
" - - l o c k e d C t r l + ${ mod } + z " = " e x e c ${ _suspend } / b i n / _ s u s p e n d " ;
" ${ mod } + A l t + c " = " e x e c ${ _sway_idle_toggle } / b i n / _ s w a y _ i d l e _ t o g g l e " ;
} ;
2022-06-13 09:45:20 -03:00
in {
" ${ mod } + R e t u r n " = " e x e c ${ terminal } " ;
2022-07-20 20:07:58 -03:00
" ${ mod } + C t r l + R e t u r n " = " e x e c t h u n a r " ;
2022-06-13 09:45:20 -03:00
" ${ mod } + x " = " k i l l " ;
" ${ mod } + s " = " e x e c ${ menu } " ;
2022-07-20 22:14:36 -03:00
" ${ mod } + m " = " m o d e a u d i o " ;
2022-06-13 09:45:20 -03:00
" ${ mod } + b " = " s p l i t h " ;
" ${ mod } + v " = " s p l i t v " ;
" ${ mod } + f " = " f u l l s c r e e n t o g g l e " ;
" ${ mod } + a " = " f o c u s p a r e n t " ;
# "${mod}+s" = "layout stacking";
" ${ mod } + w " = " l a y o u t t a b b e d " ;
# "${mod}+e" = "layout toggle split";
" ${ mod } + S h i f t + s p a c e " = " f l o a t i n g t o g g l e " ;
" ${ mod } + s p a c e " = " f o c u s m o d e _ t o g g l e " ;
" ${ mod } + S h i f t + m i n u s " = " m o v e s c r a t c h p a d " ;
" ${ mod } + m i n u s " = " s c r a t c h p a d s h o w " ;
" ${ mod } + S h i f t + c " = " r e l o a d " ;
# "${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 " = " m o d e r e s i z e " ;
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 = " s w a y l o c k - f " ;
}
{
timeout = 1800 ;
2022-08-02 22:33:21 -03:00
command = ''
mpc status | grep " ^ [ p l a y i n g ] " > /dev/null || swaymsg " o u t p u t * d p m s o f f " '' ;
resumeCommand = '' s w a y m s g " o u t p u t * d p m s o n " '' ;
2022-08-01 23:38:27 -03:00
}
] ;
events = [ {
event = " b e f o r e - s l e e p " ;
command = " s w a y l o c k - f " ;
} ] ;
} ;
2022-08-02 22:34:22 -03:00
xdg . configFile . " s w a y l o c k / c o n f i g " . 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 = " g e o c l u e 2 " ;
} ;
2022-06-13 09:45:20 -03:00
services . kanshi = {
enable = true ;
profiles = {
sedetary = {
2022-07-21 00:32:09 -03:00
outputs = [
{
criteria = " e D P - 1 " ;
status = " d i s a b l e " ;
position = " 1 9 2 0 , 3 1 2 " ;
}
{
criteria = " H D M I - A - 1 " ;
position = " 0 , 0 " ;
}
2022-07-16 02:12:18 -03:00
] ;
2022-07-21 00:32:09 -03:00
exec = [ " x r d b . X r e s o u r c e s " ] ;
2022-07-16 02:12:18 -03:00
} ;
2022-06-13 09:45:20 -03:00
nomad = {
outputs = [ {
criteria = " e D P - 1 " ;
status = " e n a b l e " ;
position = " 1 9 2 0 , 3 1 2 " ;
} ] ;
2022-07-21 00:32:09 -03:00
exec = [ " x r d b . X r e s o u r c e s " ] ;
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 = " 1 5 " ;
2022-08-02 00:16:05 -03:00
layer = " o v e r l a y " ;
backgroundColor = color . bg ;
borderColor = accent . color ;
progressColor = " o v e r ${ accent . color } 8 8 " ;
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 [ " w r i t e B o u n d a r y " ] ''
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 ú s i c a " ;
} ;
2022-07-19 22:20:55 -03:00
home . pointerCursor = {
name = " c a p i t a i n e - c u r s o r s " ;
package = pkgs . capitaine-cursors ;
x11 . enable = true ;
gtk . enable = true ;
} ;
2022-06-13 22:21:47 -03:00
gtk = {
enable = true ;
theme = {
name = " O r c h i s - R e d - D a r k - C o m p a c t " ;
package = orchis_theme_compact ;
} ;
iconTheme = {
name = " P a p i r u s - D a r k " ;
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 = " g t k " ;
style . package = pkgs . libsForQt5 . qtstyleplugins ;
style . name = " g t k 2 " ;
} ;
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 = " F i r e f o x W e b b r o w s e r " ;
Documentation = " h t t p s : / / g i t h u b . c o m / A l e x a y s / W a y b a r / w i k i " ;
PartOf = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
After = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
} ;
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = " ${ pkgs . firefox } / b i n / f i r e f o x " ;
2022-07-20 20:07:58 -03:00
Restart = " o n - f a i l u r e " ;
} ;
Install = { WantedBy = [ " s w a y - s e s s i o n . t a r g e t " ] ; } ;
} ;
discord = {
Unit = {
Description = " D i s c o r d I n t e r n e t v o i c e c h a t " ;
PartOf = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
After = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
} ;
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = " / u s r / b i n / e n v f l a t p a k r u n i o . g i t h u b . s p a c i n g b a t 3 . w e b c o r d " ;
2022-07-20 20:07:58 -03:00
Restart = " o n - f a i l u r e " ;
} ;
Install = { WantedBy = [ " s w a y - s e s s i o n . t a r g e t " ] ; } ;
} ;
telegram = {
Unit = {
Description = " T e l e g r a m I n t e r n e t c h a t " ;
PartOf = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
After = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
} ;
Service = {
ExecStart = " ${ pkgs . tdesktop } / b i n / t e l e g r a m - d e s k t o p " ;
Restart = " o n - f a i l u r e " ;
} ;
Install = { WantedBy = [ " s w a y - s e s s i o n . t a r g e t " ] ; } ;
} ;
2022-08-02 00:16:05 -03:00
mako = {
Unit = {
Description = " N o t i f i c a t i o n d a e m o n " ;
PartOf = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
After = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
} ;
Service = {
ExecStart = " ${ pkgs . mako } / b i n / m a k o " ;
Restart = " o n - f a i l u r e " ;
} ;
Install = { WantedBy = [ " s w a y - s e s s i o n . t a r g e t " ] ; } ;
} ;
2022-07-20 20:07:58 -03:00
} ;
2022-07-21 00:32:09 -03:00
}