From 02f83397ed1b68ad723ef8492a165484ac5419c7 Mon Sep 17 00:00:00 2001 From: Matthew Ess Date: Thu, 2 Jan 2020 20:13:32 -0500 Subject: [PATCH] Reorganize rofi and i3 configs --- assets/arc-dark-red.rasi | 137 +++++++++++++++++++++++++++++++++++++++ home.nix | 50 ++++---------- i3.nix | 109 +++++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+), 38 deletions(-) create mode 100644 assets/arc-dark-red.rasi create mode 100644 i3.nix diff --git a/assets/arc-dark-red.rasi b/assets/arc-dark-red.rasi new file mode 100644 index 0000000..a5f57e2 --- /dev/null +++ b/assets/arc-dark-red.rasi @@ -0,0 +1,137 @@ +/* + * ROFI Color theme + * A red variation of Arc-Dark theme by leofa, based on arc-theme-Red (https://github.com/mclmza/arc-theme-Red) + * User: wikwg9 + */ +* { + selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); + foreground: rgba ( 196, 203, 212, 100 % ); + normal-foreground: @foreground; + alternate-normal-background: rgba ( 64, 69, 82, 59 % ); + red: rgba ( 220, 50, 47, 100 % ); + selected-urgent-foreground: rgba ( 249, 249, 249, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + urgent-foreground: rgba ( 204, 102, 102, 100 % ); + alternate-urgent-background: rgba ( 75, 81, 96, 90 % ); + active-foreground: rgba ( 220, 140, 160, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba ( 249, 249, 249, 100 % ); + alternate-active-background: rgba ( 75, 81, 96, 89 % ); + background: rgba ( 45, 48, 59, 95 % ); + alternate-normal-foreground: @foreground; + normal-background: @background; + lightfg: rgba ( 88, 104, 117, 100 % ); + selected-normal-background: rgba ( 204, 87, 93, 100 % ); + border-color: rgba ( 137, 131, 124, 100 % ); + spacing: 2; + separatorcolor: rgba ( 29, 31, 33, 100 % ); + urgent-background: rgba ( 29, 31, 33, 17 % ); + selected-urgent-background: rgba ( 165, 66, 66, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 29, 31, 33, 17 % ); + selected-active-background: rgba ( 204, 87, 93, 100 % ); +} +#window { + background-color: @background; + padding: 5; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 2px 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 2px 0px 0px ; + border-color: @separatorcolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 1px ; +} +#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; +} +#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: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +#element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +#element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +#mode-switcher { + border: 2px 0px 0px ; + border-color: @separatorcolor; +} +#button { + spacing: 0; + text-color: @normal-foreground; +} +#button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +#inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +#entry { + spacing: 0; + text-color: @normal-foreground; +} +#prompt { + spacing: 0; + text-color: @normal-foreground; +} +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @normal-foreground; +} diff --git a/home.nix b/home.nix index e3fa051..b3ae02a 100644 --- a/home.nix +++ b/home.nix @@ -32,6 +32,7 @@ in { clipnotify dmenu i3lock + rofi ]; file = { ".background-image".source = ./assets/background-image; @@ -121,6 +122,7 @@ in { format = " %avail free" } ''; + ".config/rofi/theme.rasi".source = ./assets/arc-dark-red.rasi; }; }; nixpkgs = { config.allowUnfree = true; }; @@ -219,6 +221,13 @@ in { autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif ''; }; + rofi = { + enable = true; + font = "Fira Code 14"; + lines = 15; + location = "center"; + theme = ".config/rofi/theme"; + }; ssh.enable = true; starship.enable = true; }; @@ -238,44 +247,9 @@ in { enable = true; scriptPath = ".hm-xsession"; windowManager = { - i3 = { - enable = true; - config = rec { - assigns = { - "1: web" = [{ class = "Firefox"; }]; - "2: devel" = [ { class = "Alacritty"; } { class = "Atom"; } ]; - }; - bars = [{ fonts = [ "Fira Code" "FontAwesome 10" ]; }]; - modifier = "Mod4"; - keybindings = lib.mkOptionDefault { - "${modifier}+c" = "exec CM_ONESHOT=1 clipmenud"; - "${modifier}+v" = "exec clipmenu"; - "${modifier}+Escape" = "exec ${lockCmd}"; - "${modifier}+0" = "workspace number 0"; - "${modifier}+1" = "workspace number 1"; - "${modifier}+2" = "workspace number 2"; - "${modifier}+3" = "workspace number 3"; - "${modifier}+4" = "workspace number 4"; - "${modifier}+5" = "workspace number 5"; - "${modifier}+6" = "workspace number 6"; - "${modifier}+7" = "workspace number 7"; - "${modifier}+8" = "workspace number 8"; - "${modifier}+9" = "workspace number 9"; - "XF86AudioRaiseVolume" = - "exec --no-startup-id amixer sset Master 5%+"; - "XF86AudioLowerVolume" = - "exec --no-startup-id amixer sset Master 5%-"; - "XF86MonBrightnessUp" = "exec light -A 20"; - "XF86MonBrightnessDown" = "exec light -U 20"; - }; - workspaceLayout = "tabbed"; - }; - extraConfig = '' - exec --no-startup-id firefox - exec --no-startup-id atom - exec --no-startup-id alacritty - for_window [class="Firefox"] focus - ''; + i3 = import ./i3.nix { + inherit lib; + inherit lockCmd; }; }; }; diff --git a/i3.nix b/i3.nix new file mode 100644 index 0000000..d56a6de --- /dev/null +++ b/i3.nix @@ -0,0 +1,109 @@ +{ lib, lockCmd, ... }: { + enable = true; + config = rec { + assigns = { + "1: web" = [{ class = "Firefox"; }]; + "2: devel" = [ { class = "Alacritty"; } { class = "Atom"; } ]; + }; + fonts = [ "Fira Code" "FontAwesome 11" ]; + colors = { + background = "#fff5e0"; + focused = { + border = "#421B28"; + background = "#783048"; + text = "#EAE1CE"; + indicator = "#A04060"; + childBorder = "#783048"; + }; + focusedInactive = { + border = "#7F6E73"; + background = "#B59DA4"; + text = "#383632"; + indicator = "#484E50"; + childBorder = "#5F676A"; + }; + unfocused = { + border = "#333333"; + background = "#222222"; + text = "#CDC5B4"; + indicator = "#292D2E"; + childBorder = "#222222"; + }; + placeholder = { + border = "#000000"; + background = "#0C0C0C"; + text = "#CDC5B4"; + indicator = "#000000"; + childBorder = "#0C0C0C"; + }; + urgent = { + border = "#D890A8"; + background = "#D890A8"; + text = "#383632"; + indicator = "#D890A8"; + childBorder = "#D890A8"; + }; + }; + bars = [{ + fonts = [ "Fira Code" "FontAwesome 11" ]; + colors = { + background = "#180d10"; + statusline = "#EAE1CE"; + separator = "#CDC5B4"; + focusedWorkspace = { + border = "#783048"; + background = "#783048"; + text = "#EAE1CE"; + }; + activeWorkspace = { + border = "#CDC5B4"; + background = "#222222"; + text = "#EAE1CE"; + }; + inactiveWorkspace = { + border = "#222222"; + background = "#222222"; + text = "#CDC5B4"; + }; + urgentWorkspace = { + border = "#D890A8"; + background = "#D890A8"; + text = "#383632"; + }; + bindingMode = { + border = "#D890A8"; + background = "#D890A8"; + text = "#383632"; + }; + }; + }]; + modifier = "Mod4"; + keybindings = lib.mkOptionDefault { + "${modifier}+c" = "exec CM_ONESHOT=1 clipmenud"; + "${modifier}+v" = "exec clipmenu"; + "${modifier}+Escape" = "exec ${lockCmd}"; + "${modifier}+0" = "workspace number 0"; + "${modifier}+1" = "workspace number 1"; + "${modifier}+2" = "workspace number 2"; + "${modifier}+3" = "workspace number 3"; + "${modifier}+4" = "workspace number 4"; + "${modifier}+5" = "workspace number 5"; + "${modifier}+6" = "workspace number 6"; + "${modifier}+7" = "workspace number 7"; + "${modifier}+8" = "workspace number 8"; + "${modifier}+9" = "workspace number 9"; + "${modifier}+d" = "exec --no-startup-id rofi -show run"; + "XF86AudioRaiseVolume" = "exec --no-startup-id amixer sset Master 5%+"; + "XF86AudioLowerVolume" = "exec --no-startup-id amixer sset Master 5%-"; + "XF86MonBrightnessUp" = "exec light -A 20"; + "XF86MonBrightnessDown" = "exec light -U 20"; + }; + workspaceLayout = "tabbed"; + }; + extraConfig = '' + exec --no-startup-id firefox + exec --no-startup-id atom + exec --no-startup-id alacritty + for_window [class="Firefox"] focus + ''; +}