diff --git a/assets/colortest.fish b/assets/colortest.fish new file mode 100644 index 0000000..f89bc75 --- /dev/null +++ b/assets/colortest.fish @@ -0,0 +1,20 @@ +function colortest --description 'Shows the various fish colors being used' + set -l clr_list (set -n | grep fish | grep color | grep -v __) + if test -n "$clr_list" + set -l bclr (set_color normal) + set -l bold (set_color --bold) + printf "\n| %-38s | %-38s |\n" Variable Definition + echo '|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|' + for var in $clr_list + set -l def $$var + set -l clr (set_color $def ^/dev/null) + or begin + printf "| %-38s | %s%-38s$bclr |\n" "$var" (set_color --bold white --background=red) "$def" + continue + end + printf "| $clr%-38s$bclr | $bold%-38s$bclr |\n" "$var" "$def" + end + echo '|________________________________________|________________________________________|'\n + end +end + diff --git a/assets/i3status.toml b/assets/i3status.toml new file mode 100644 index 0000000..1941651 --- /dev/null +++ b/assets/i3status.toml @@ -0,0 +1,46 @@ +[theme] +name = "plain" +[theme.overrides] +separator = "" + +[icons] +name = "awesome" + +[[block]] +block = "disk_space" +path = "/" +alias = "/" +info_type = "available" +unit = "GB" +interval = 20 +warning = 20.0 +alert = 10.0 + +[[block]] +block = "memory" +display_type = "memory" +format_mem = "{Mup}%" +format_swap = "{SUp}%" + +[[block]] +block = "cpu" +interval = 5 + +[[block]] +block = "load" +interval = 5 +format = "{1m}" + +[[block]] +block = "sound" + +[[block]] +block = "time" +interval = 60 +format = "%a %m/%d %R" + +[[block]] +block = "battery" +driver = "upower" +format = "{percentage}% {time}" + diff --git a/assets/sidetab.rasi b/assets/sidetab.rasi new file mode 100644 index 0000000..693dbc4 --- /dev/null +++ b/assets/sidetab.rasi @@ -0,0 +1,131 @@ +/** + * User: deadguy + * Copyright: deadguy + */ + +configuration { + display-drun: "Activate"; + display-run: "Execute"; + display-window: "Window"; + show-icons: true; + sidebar-mode: true; +} + +* { + background-color: #080808; + text-color: #d3d7cf; + selbg: #215d9c; + actbg: #262626; + urgbg: #e53935; + winbg: #26c6da; + + selected-normal-foreground: @winbg; + normal-foreground: @text-color; + selected-normal-background: @actbg; + normal-background: @background-color; + + selected-urgent-foreground: @background-color; + urgent-foreground: @text-color; + selected-urgent-background: @urgbg; + urgent-background: @background-color; + + selected-active-foreground: @winbg; + active-foreground: @text-color; + selected-active-background: @actbg; + active-background: @selbg; + + line-margin: 2; + line-padding: 2; + separator-style: "none"; + hide-scrollbar: "true"; + margin: 0; + padding: 0; +} + +window { + location: west; + anchor: west; + height: 100%; + width: 22%; + orientation: horizontal; + children: [mainbox]; +} + +mainbox { + spacing: 0.8em; + children: [ entry,listview,mode-switcher ]; +} + +button { padding: 5px 2px; } + +button selected { + background-color: @active-background; + text-color: @background-color; +} + +inputbar { + padding: 5px; + spacing: 5px; +} + +listview { + spacing: 0.5em; + dynamic: false; + cycle: true; +} + +element { padding: 10px; } + +entry { + expand: false; + text-color: @normal-foreground; + vertical-align: 1; + padding: 5px; +} + +element normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; + border: 0 5px solid 0 0; + border-color: @active-background; +} + +element selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element alternate.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element alternate.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element alternate.active { + background-color: @active-background; + text-color: @active-foreground; +} diff --git a/assets/slate.rasi b/assets/slate.rasi new file mode 100644 index 0000000..d6d29b3 --- /dev/null +++ b/assets/slate.rasi @@ -0,0 +1,43 @@ +* { + background-color: #282C33; + border-color: #2e343f; + text-color: #8ca0aa; + spacing: 0; + width: 512px; +} + +inputbar { + border: 0 0 1px 0; + children: [prompt,entry]; +} + +prompt { + padding: 16px; + border: 0 1px 0 0; +} + +textbox { + background-color: #2e343f; + border: 0 0 1px 0; + border-color: #282C33; + padding: 8px 16px; +} + +entry { + padding: 16px; +} + +listview { + cycle: false; + margin: 0 0 -1px 0; + scrollbar: false; +} + +element { + border: 0 0 1px 0; + padding: 16px; +} + +element selected { + background-color: #2e343f; +} \ No newline at end of file diff --git a/cachix/ghcide-nix.nix b/cachix/ghcide-nix.nix new file mode 100644 index 0000000..a25ea0d --- /dev/null +++ b/cachix/ghcide-nix.nix @@ -0,0 +1,12 @@ + +{ + nix = { + binaryCaches = [ + "https://ghcide-nix.cachix.org" + ]; + binaryCachePublicKeys = [ + "ghcide-nix.cachix.org-1:ibAY5FD+XWLzbLr8fxK6n8fL9zZe7jS+gYeyxyWYK5c=" + ]; + }; +} + \ No newline at end of file diff --git a/cachix/mothbot.nix b/cachix/mothbot.nix new file mode 100644 index 0000000..d79f4fd --- /dev/null +++ b/cachix/mothbot.nix @@ -0,0 +1,12 @@ + +{ + nix = { + binaryCaches = [ + "https://mothbot.cachix.org" + ]; + binaryCachePublicKeys = [ + "mothbot.cachix.org-1:+frc2gaYS3tGHaHCeuwlWkBSR6xwskmCfvIX3YjMcV8=" + ]; + }; +} + \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index 7ddc714..243039f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -50,11 +50,12 @@ source-code-pro fira-code fira-code-symbols - font-awesome_5 + font-awesome_4 aileron ]; fontconfig = { enable = true; + penultimate.enable = true; defaultFonts = { monospace = [ "Fira Code" ]; }; }; }; @@ -103,6 +104,7 @@ geoclue2.enable = true; printing.enable = true; gnome3.gnome-keyring.enable = true; + upower.enable = true; xserver = { enable = true; layout = "us"; diff --git a/home.nix b/home.nix index 74f136d..1eabcbc 100644 --- a/home.nix +++ b/home.nix @@ -5,37 +5,38 @@ let email = "daringseal@gmail.com"; workEmail = "mess@yelp.com"; lockCmd = "i3lock -i ~/.lockscreen-image"; - niv = (import (builtins.fetchTarball { - url = - "https://github.com/nmattia/niv/tarball/abd0de3269fd712955d27b70e32921841c7b8bb7"; - sha256 = "0b38n1ad00s1qqyw3ml3pypf8i1pw4aqw0bpa02qq9iv7sp3x0gz"; - }) { }).niv; + statusCmd = "i3status-rs ~/.config/i3status.toml"; + unstable = import { config.allowUnfree = true; }; in { home = { sessionVariables = { EDITOR = "vim"; BROWSER = "firefox"; - TERMINAL = "alacritty"; + TERMINAL = "kitty"; }; packages = with pkgs; [ # nix utilities cachix - niv + unstable.niv nixfmt nix-prefetch-git # command line utilities ag + exercism fzy imagemagick jq + rlwrap tldr unzip # graphical applications - alacritty atom + unstable.discord + (dunst.override { dunstify = true; }) enpass firefox + kitty nheko slack steam @@ -44,6 +45,8 @@ in { clipnotify dmenu i3lock + unstable.i3status-rust + libnotify rofi xclip ]; @@ -70,6 +73,8 @@ in { ''; ".config/fish/completions/systemctl.fish".source = ./assets/systemctl.fish; + ".config/fish/functions/colortest.fish".source = + ./assets/colortest.fish; ".config/fish/functions/kbl.fish".text = '' function kbl -a level set -l initial (cat /sys/class/leds/tpacpi\:\:kbd_backlight/brightness) @@ -85,84 +90,30 @@ in { ''; ".config/fish/functions/unz.fish".text = '' function unz -a target - string match \*.zip $target; and set target (basename target) + # strip extensions + string match \*.zip $target; and set target (string split -r -m1 . $target)[1] unzip -d $target $target end ''; - ".config/i3status/config".text = '' - # i3status configuration file. - # see "man i3status" for documentation. - - # It is important that this file is edited as UTF-8. - # The following line should contain a sharp s: - # ß - # If the above line is not correctly displayed, fix your editor first! - - general { - colors = true - interval = 5 - } - - order += "disk /" - order += "volume master" - order += "wireless _first_" - order += "battery 1" - order += "load" - order += "tztime local" - - wireless _first_ { - format_up = " (%essid - %quality) %ip" - format_down = "down" - } - - volume master { - format = " %volume" - format_muted = " (%volume)" - device = "pulse:0" - mixer = "Master" - mixer_idx = 0 - } - - battery 1 { - format = "%status %percentage %remaining" - status_bat = "" - status_chr = "" - status_full = "" - low_threshold = 30 - threshold_type = percentage - integer_battery_capacity = true - color_good = "#0000FF" - path = "/sys/class/power_supply/BAT0/uevent" - } - - run_watch DHCP { - pidfile = "/var/run/dhclient*.pid" - } - - run_watch VPN { - pidfile = "/var/run/vpnc/pid" - } - - tztime local { - format = " %h %d, %Y %I:%M:%S" - } - - load { - format = " %1min" - } - - disk "/" { - format = " %avail free" - } + ".config/i3status.toml".source = ./assets/i3status.toml; + ".config/kitty/kitty.conf".text = '' + font_family Fira Code Regular + bold_font Fira Code Bold + font_size 15.0 ''; - ".config/rofi/theme.rasi".source = ./assets/arc-dark-red.rasi; + ".config/rofi/theme.rasi".source = ./assets/sidetab.rasi; }; }; nixpkgs = { config.allowUnfree = true; }; programs = { alacritty = { - enable = true; - settings = { font.normal.family = "Fira Code"; }; + enable = false; + settings = { + font = { + normal.family = "Fira Code"; + size = 10.5; + }; + }; }; bat.enable = true; broot.enable = true; @@ -189,10 +140,14 @@ in { alias grep=ag alias sys="sudo systemctl" alias rebuild="sudo nixos-rebuild switch" - alias upgrade="sudo nixos-rebuild switch --upgrade" + alias rebuildd="sudo nixos-rebuild switch; and systemctl restart display-manager" + alias upgrade="sudo rm -rf /root/.cache/nix/tarballs; and sudo nixos-rebuild switch --upgrade" alias clip="xclip -selection c" alias cxuse="sudo cachix use -d ~/dotfiles.nix" alias cxpsh="nix build -f shell.nix; nix-store -qR --include-outputs (nix-instantiate shell.nix) | cachix push" + alias home="vim ~/dotfiles.nix/home.nix +'cd %:p:h'" + alias i3="vim ~/dotfiles.nix/i3.nix +'cd %:p:h'" + alias vims="vim -S Session.vim" ''; }; git = { @@ -226,20 +181,29 @@ in { vim-nix lightline-vim haskell-vim - LanguageClient-neovim + auto-pairs + vim-fish ]; extraConfig = '' + syntax on + filetype plugin indent on set cursorline "highlight current line set showmatch "highlight matching [{()}] set tabstop=2 "number of visual spaces per TAB when reading set softtabstop=2 "number of spaces per TAB when editing set expandtab "tabs are spaces set shiftwidth=2 "indents - cmap w!! w !sudo tee >/dev/null % set ww=<,>,[,] "wrap + set splitbelow "split underneath + command Mks NERDTreeClose | mksession! + + "save readonly + cmap w!! w !sudo tee >/dev/null % "terminal exit - tnoremap :q! + tnoremap + "nohl + nnoremap , :nohlsearch colorscheme Tomorrow-Night-Eighties "lightline options @@ -257,30 +221,64 @@ in { autocmd vimenter * wincmd p "close if only nerdtree is left autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - - "language server stuff - let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml'] - let g:LanguageClient_serverCommands = { - \ 'haskell': ['ghcide', '--lsp'], - \ } ''; }; rofi = { enable = true; font = "Fira Code 14"; - lines = 15; + lines = 10; location = "center"; - theme = ".config/rofi/theme"; + theme = "~/.config/rofi/theme.rasi"; }; ssh = { enable = true; - extraOptionOverrides = { - "AddKeysToAgent" = "true"; - }; + extraOptionOverrides = { "AddKeysToAgent" = "true"; }; }; starship.enable = true; }; services = { + dunst = { + enable = true; + settings = { + global = { + geometry = "0x5-30+20"; + notification_height = 25; + indicate_hidden = "yes"; + corner_radius = 5; + padding = 10; + horizontal_padding = 10; + idle_threshold = 60; + font = "Fira Code 16"; + markup = "full"; + format = '' + %s %a + %b''; + alignment = "center"; + horizontal_alignment = "center"; + icon_position = "left"; + separator_color = "#383838"; + frame_color = "#383838"; + frame_width = 2; + }; + shortcuts = { + close = "ctrl+space"; + history = "ctrl+grave"; + }; + urgency_low = { + background = "#282828"; + foreground = "#5882FA"; + }; + urgency_normal = { + background = "#282828"; + foreground = "#5882FA"; + }; + urgency_critical = { + background = "#282828"; + foreground = "#FF0040"; + timeout = 0; + }; + }; + }; gnome-keyring.enable = true; lorri.enable = true; redshift = { @@ -299,6 +297,7 @@ in { i3 = import ./i3.nix { inherit lib; inherit lockCmd; + inherit statusCmd; }; }; }; diff --git a/i3.nix b/i3.nix index 784d85c..8a2d64c 100644 --- a/i3.nix +++ b/i3.nix @@ -1,15 +1,15 @@ -{ lib, lockCmd, ... }: { +{ lib, lockCmd, statusCmd, ... }: { enable = true; config = rec { - fonts = [ "Fira Code" "FontAwesome 12" ]; + fonts = [ "Aileron" "FontAwesome 14" ]; colors = { - background = "#fff5e0"; + background = "#CBBB9B"; focused = { border = "#421B28"; - background = "#783048"; + background = "#3F71A8"; text = "#EAE1CE"; indicator = "#A04060"; - childBorder = "#783048"; + childBorder = "#3F71A8"; }; focusedInactive = { border = "#7F6E73"; @@ -42,13 +42,14 @@ }; bars = [{ fonts = [ "Fira Code" "FontAwesome 11" ]; + statusCommand = statusCmd; colors = { - background = "#180d10"; + background = "#000000"; statusline = "#EAE1CE"; separator = "#CDC5B4"; focusedWorkspace = { - border = "#783048"; - background = "#783048"; + border = "#3F71A8"; + background = "#3F71A8"; text = "#EAE1CE"; }; activeWorkspace = { @@ -97,18 +98,24 @@ workspaceLayout = "tabbed"; assigns = { "1: web" = [{ class = "Firefox"; }]; - "2: devel" = [ { class = "Alacritty"; } { class = "Atom"; } ]; - "3: social" = [ { class = "(N|n)heko"; } { class = "Slack"; } ]; + "2: devel" = [ { class = "(K|k)itty"; } { class = "Atom"; } ]; + "3: social" = [ + { class = "(N|n)heko"; } + { class = "Slack"; } + { class = "discord"; } + ]; "4: admin" = [{ class = "Enpass"; }]; - "5: other" = [{ class = ".*"; }]; + "5: games" = [{ class = "(S|s)team"; }]; + "6: other" = [{ class = ".*"; }]; }; }; extraConfig = '' exec --no-startup-id firefox - exec --no-startup-id alacritty + exec --no-startup-id kitty exec --no-startup-id Enpass - exec --no-startup-id slack - exec --no-startup-id nheko + # exec --no-startup-id slack + # exec --no-startup-id nheko + # exec --no-startup-id Discord for_window [class="Firefox"] focus ''; }