diff --git a/README.org b/README.org index fa45c37..8f425e8 100644 --- a/README.org +++ b/README.org @@ -1,6 +1,6 @@ * Installing ** Fresh system (nixos USB drive) -1. Open a nix-shell with git: +1. Open a nix-shell with git (if not installed): #+BEGIN_SRC bash nix-shell -p git #+END_SRC @@ -76,3 +76,7 @@ #+BEGIN_SRC bash sudo nixos-rebuild switch --impure --flake '.#reykjavik' #+END_SRC +* Modules +** Desktop environment +*** Themeing +We use [[https://github.com/Misterio77/nix-colors][nix-colors]] to (try to) keep a consistent theme across all applications. This uses [[https://github.com/chriskempson/base16][base-16 themes]] (here is a [[https://github.com/chriskempson/base16/blob/main/styling.md][styiling guide]] for it). diff --git a/config/.config/alacritty/alacritty.yml b/config/.config/alacritty/alacritty.yml index d743a78..d3ac779 100644 --- a/config/.config/alacritty/alacritty.yml +++ b/config/.config/alacritty/alacritty.yml @@ -5,3 +5,5 @@ font: normal: family: Iosevka Nerd Font style: Regular +import: + - ~/.config/alacritty/theme.yml diff --git a/config/.config/polybar/bars/bars.ini b/config/.config/polybar/bars/bars.ini index fc6d713..bbe4ef9 100644 --- a/config/.config/polybar/bars/bars.ini +++ b/config/.config/polybar/bars/bars.ini @@ -12,20 +12,18 @@ font-0 = "Iosevka:size=10;2" font-1 = "Iosevka:size=16;2" font-2 = "Iosevka:size=22;4" -background = ${colours.trans} -foreground = ${colours.white} +background = ${colours/bar.bg} +foreground = ${colours/bar.fg} border-bottom-size = 5 border-top-size = 5 - border-left-size = 10 border-right-size = 10 -border-bottom-colour = ${colours.trans} -border-top-colour = ${colours.trans} - -border-left-colour = ${colours.trans} -border-right-colour = ${colours.trans} +border-bottom-color = ${colours/bar.bg} +border-top-color = ${colours/bar.bg} +border-left-color = ${colours/bar.bg} +border-right-color = ${colours/bar.bg} spacing = 0 padding-left = 0 @@ -34,8 +32,8 @@ module-margin-left = 0 separator = | separator-padding = .5 -separator-foreground = ${colours.trans} -separator-background = ${colours.trans} +separator-foreground = ${colours/bar.bg} +separator-background = ${colours/bar.bg} [bar/bottom] inherit = bar/base diff --git a/config/.config/polybar/bars/colours.ini b/config/.config/polybar/bars/colours.ini index 387ef16..e160f5b 100644 --- a/config/.config/polybar/bars/colours.ini +++ b/config/.config/polybar/bars/colours.ini @@ -4,82 +4,54 @@ white = #fff black = #000 gray = #555 -blue- = #498AD4 -blue = #2B6CB6 -blue+ = #173B63 - -xanadu- = #B3BCB6 -xanadu = #808F85 -xanadu+ = #606C64 - -green- = #CAE2CE -green = #91C499 -green+ = #61A86D - -linen- = #F9F5F0 -linen = #F2E9DC -linen+ = #DEC6A6 - -pear- = #E8EB5C -pear = #CFD11A -pear+ = #8F9112 - -orange- = #FEB548 -orange = #F18F01 -orange+ = #A26201 - -apricot- = #FFAB85 -apricot = #FFCAB1 -apricot+ = #FFF1EB - -rose- = #CC8FA0 -rose = #AB4E68 -rose+ = #7E3A4D +[colours/bar] +bg = ${colours.trans} +fg = ${colour-scheme.base05} [colours/date] -bg = ${colours.pear} -fg = ${colours.gray} +bg = ${colour-scheme.base01} +fg = ${colour-scheme.base05} [colours/battery] -full-bg = ${colours.green+} -full-fg = ${colours.gray} -charging-bg = ${colours.green} -charging-fg = ${colours.gray} -discharging-bg = ${colours.green} -discharging-fg = ${colours.gray} -low-bg = ${colours.orange} -low-fg = ${colours.gray} +full-bg = ${colour-scheme.base0C} +full-fg = ${colour-scheme.base01} +charging-bg = ${colour-scheme.base0C} +charging-fg = ${colour-scheme.base01} +discharging-bg = ${colour-scheme.base01} +discharging-fg = ${colour-scheme.base05} +low-bg = ${colour-scheme.base0E} +low-fg = ${colour-scheme.base01} [colours/workspaces] -focused-bg = ${colours.linen+} -focused-fg = ${colours.gray} -unfocused-bg = ${colours.linen} -unfocused-fg = ${colours.gray} -urgent-bg = ${colours.orange-} -urgent-fg = ${colours.gray} +focused-bg = ${colour-scheme.base02} +focused-fg = ${colour-scheme.base04} +unfocused-bg = ${colour-scheme.base01} +unfocused-fg = ${colour-scheme.base05} +urgent-bg = ${colour-scheme.base0E} +urgent-fg = ${colour-scheme.base01} [colours/i3-mode] -bg = ${colours.orange} -fg = ${colours.gray} +bg = ${colour-scheme.base0E} +fg = ${colour-scheme.base01} [colours/volume] -volume-bg = ${colours.rose} -volume-fg = ${colours.white} -muted-bg = ${colours.rose-} -muted-fg = ${colours.white} +volume-bg = ${colour-scheme.base0C} +volume-fg = ${colour-scheme.base01} +muted-bg = ${colour-scheme.base01} +muted-fg = ${colour-scheme.base05} [colours/wireless] -connected-bg = ${colours.apricot} -connected-fg = ${colours.gray} -disconnected-bg = ${colours.apricot} -disconnected-fg = ${colours.gray} -packetloss-bg = ${colours.apricot} -packetloss-fg = ${colours.gray} +connected-bg = ${colour-scheme.base0C} +connected-fg = ${colour-scheme.base01} +disconnected-bg = ${colour-scheme.base01} +disconnected-fg = ${colour-scheme.base05} +packetloss-bg = ${colour-scheme.base0E} +packetloss-fg = ${colour-scheme.base01} [colours/bluetooth] -bg = ${colours.blue} -fg = ${colours.white} +bg = ${colour-scheme.base0C} +fg = ${colour-scheme.base01} [colours/spotify] -bg = ${colours.green} -fg = ${colours.gray} +bg = ${colour-scheme.base0A} +fg = ${colour-scheme.base01} diff --git a/config/.config/polybar/bars/modules/battery.ini b/config/.config/polybar/bars/modules/battery.ini index 42cc947..75f57f9 100644 --- a/config/.config/polybar/bars/modules/battery.ini +++ b/config/.config/polybar/bars/modules/battery.ini @@ -4,7 +4,7 @@ full-at = 100 low-at = 20 battery = BAT0 adapter = ADP0 -poll-interval = 5 +poll-interval = 1 format-full = label-full = "%{T2}%{T-} %percentage%%" diff --git a/config/.config/polybar/bars/modules/bluetooth.ini b/config/.config/polybar/bars/modules/bluetooth.ini index 61f3bc4..f1a00bf 100644 --- a/config/.config/polybar/bars/modules/bluetooth.ini +++ b/config/.config/polybar/bars/modules/bluetooth.ini @@ -1,8 +1,8 @@ [module/bluetooth] type = custom/script -exec = ~/.config/polybar/scripts/bluetooth.sh +exec = ~/.config/rofi/menus/bluetooth/bluetooth.sh --status interval = 5 -click-left = ~/.config/rofi/bluetooth/bluetooth.sh +click-left = ~/.config/rofi/menus/bluetooth/bluetooth.sh format-background = ${colours/bluetooth.bg} format-foreground = ${colours/bluetooth.fg} diff --git a/config/.config/polybar/bars/modules/wireless.ini b/config/.config/polybar/bars/modules/wireless.ini index 87aa034..4b48f99 100644 --- a/config/.config/polybar/bars/modules/wireless.ini +++ b/config/.config/polybar/bars/modules/wireless.ini @@ -2,7 +2,6 @@ type = internal/network interface-type = wireless interval = 3.0 -click-left = ~/.config/rofi/wifi/wifi.sh accumulate-stats = true ;unknown-as-up = true diff --git a/config/.config/polybar/config.ini b/config/.config/polybar/config.ini index c72cb6d..a02b327 100644 --- a/config/.config/polybar/config.ini +++ b/config/.config/polybar/config.ini @@ -1 +1,3 @@ +# This file is generated by nixos-rebuild +include-file = colour-scheme.ini include-file = bars/bars.ini diff --git a/config/.config/polybar/scripts/bluetooth.sh b/config/.config/polybar/scripts/bluetooth.sh deleted file mode 100755 index 390a293..0000000 --- a/config/.config/polybar/scripts/bluetooth.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -bluetooth_print() { - if bluetoothctl show | grep -q "Powered: yes"; then - printf '' - - devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) - counter=0 - - for device in $devices_paired; do - device_info=$(bluetoothctl info "$device") - - if echo "$device_info" | grep -q "Connected: yes"; then - device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-) - - if [ $counter -gt 0 ]; then - printf ", %s" "$device_alias" - else - printf " %s" "$device_alias" - fi - - counter=$((counter + 1)) - fi - done - - printf '\n' - else - echo " -" - fi -} - -bluetooth_toggle() { - if bluetoothctl show | grep -q "Powered: no"; then - bluetoothctl power on >> /dev/null - sleep 1 - - devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) - echo "$devices_paired" | while read -r line; do - bluetoothctl connect "$line" >> /dev/null - done - else - devices_paired=$(bluetoothctl devices Paired | grep Device | cut -d ' ' -f 2) - echo "$devices_paired" | while read -r line; do - bluetoothctl disconnect "$line" >> /dev/null - done - - bluetoothctl power off >> /dev/null - fi -} - -case "$1" in - --toggle) - bluetooth_toggle - ;; - *) - bluetooth_print - ;; -esac diff --git a/config/.config/rofi/bluetooth/bluetooth.rasi b/config/.config/rofi/menus/bluetooth/bluetooth.rasi similarity index 89% rename from config/.config/rofi/bluetooth/bluetooth.rasi rename to config/.config/rofi/menus/bluetooth/bluetooth.rasi index f9ef9b0..62e4b80 100644 --- a/config/.config/rofi/bluetooth/bluetooth.rasi +++ b/config/.config/rofi/menus/bluetooth/bluetooth.rasi @@ -4,22 +4,13 @@ * **/ +@import "../../theme.rasi" + /*****----- Configuration -----*****/ configuration { show-icons: false; } -/*****----- Global Properties -----*****/ -* { - font: "Iosevka Nerd Font 10"; - background: #2B6CB6; - background-alt: #498AD4; - foreground: #FFFFFF; - selected: #173B63; - active: #FFCAB1; - urgent: #FFCAB1; -} - /*****----- Main Window -----*****/ window { /* properties for window widget */ @@ -35,9 +26,9 @@ window { enabled: true; margin: 0px; padding: 0px; - border: 0px solid; - border-radius: 20px; - border-color: @selected; + border: 2px solid; + border-radius: 15px; + border-color: @background-alt; cursor: "default"; background-color: @background; } diff --git a/config/.config/rofi/bluetooth/bluetooth.sh b/config/.config/rofi/menus/bluetooth/bluetooth.sh similarity index 98% rename from config/.config/rofi/bluetooth/bluetooth.sh rename to config/.config/rofi/menus/bluetooth/bluetooth.sh index d7b328a..048a7ac 100755 --- a/config/.config/rofi/bluetooth/bluetooth.sh +++ b/config/.config/rofi/menus/bluetooth/bluetooth.sh @@ -24,7 +24,7 @@ goback="Back" # PREFIX=projects/samfelag/config/ # Rofi command to pipe into, can add any options here -dir="$HOME/$PREFIX.config/rofi/bluetooth/" +dir="$HOME/$PREFIX.config/rofi/menus/bluetooth/" theme='bluetooth' rofi_command="rofi -dmenu -theme ${dir}/${theme}.rasi -i -p" @@ -195,7 +195,7 @@ toggle_trust() { # Useful for status bars like polybar, etc. print_status() { if power_on; then - printf '' + printf '' paired_devices_cmd="paired-devices" @@ -217,7 +217,7 @@ print_status() { done printf "\n" else - echo "" + echo "" fi } diff --git a/config/.config/rofi/images/flor01.png b/config/.config/rofi/menus/launcher/flor01.png similarity index 100% rename from config/.config/rofi/images/flor01.png rename to config/.config/rofi/menus/launcher/flor01.png diff --git a/config/.config/rofi/launcher/launcher.rasi b/config/.config/rofi/menus/launcher/launcher.rasi similarity index 93% rename from config/.config/rofi/launcher/launcher.rasi rename to config/.config/rofi/menus/launcher/launcher.rasi index 0342797..ee201be 100644 --- a/config/.config/rofi/launcher/launcher.rasi +++ b/config/.config/rofi/menus/launcher/launcher.rasi @@ -4,6 +4,8 @@ * **/ +@import "../../theme.rasi" + /*****----- Configuration -----*****/ configuration { modi: "drun,run,filebrowser,window"; @@ -16,17 +18,6 @@ configuration { window-format: "{w} · {c} · {t}"; } -/*****----- Global Properties -----*****/ -* { - font: "Iosevka Nerd Font 10"; - background: #2B6CB6; - background-alt: #498AD4; - foreground: #FFFFFF; - selected: #173B63; - active: #999999; - urgent: #808080; -} - /*****----- Main Window -----*****/ window { /* properties for window widget */ @@ -40,7 +31,9 @@ window { /* properties for all widgets */ enabled: true; + border: 2px solid; border-radius: 15px; + border-color: @background-alt; cursor: "default"; background-color: @background; } @@ -57,7 +50,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/flor01.png", width); + background-image: url("~/.config/rofi/menus/launcher/flor01.png", width); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/config/.config/rofi/launcher/launcher.sh b/config/.config/rofi/menus/launcher/launcher.sh similarity index 50% rename from config/.config/rofi/launcher/launcher.sh rename to config/.config/rofi/menus/launcher/launcher.sh index 4830549..9b76884 100755 --- a/config/.config/rofi/launcher/launcher.sh +++ b/config/.config/rofi/menus/launcher/launcher.sh @@ -3,8 +3,11 @@ ## Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x) ## Rofi : Launcher -# Current Theme -dir="$HOME/.config/rofi/launcher/" +# For debugging/development purposes +# PREFIX=projects/samfelag/config/ + +# Rofi command to pipe into, can add any options here +dir="$HOME/$PREFIX.config/rofi/menus/launcher/" theme='launcher' rofi -show drun -theme ${dir}/${theme}.rasi diff --git a/config/.config/rofi/powermenu/powermenu.rasi b/config/.config/rofi/menus/powermenu/powermenu.rasi similarity index 87% rename from config/.config/rofi/powermenu/powermenu.rasi rename to config/.config/rofi/menus/powermenu/powermenu.rasi index 5293525..a5ca2bf 100644 --- a/config/.config/rofi/powermenu/powermenu.rasi +++ b/config/.config/rofi/menus/powermenu/powermenu.rasi @@ -4,22 +4,13 @@ * **/ +@import "../../theme.rasi" + /*****----- Configuration -----*****/ configuration { show-icons: false; } -/*****----- Global Properties -----*****/ -* { - font: "Iosevka Nerd Font 10"; - background: #F18F01; - background-alt: #FEB548; - foreground: #444444; - selected: #A26201; - active: #FFCAB1; - urgent: #FFCAB1; -} - /*****----- Main Window -----*****/ window { /* properties for window widget */ @@ -35,9 +26,9 @@ window { enabled: true; margin: 0px; padding: 0px; - border: 0px solid; - border-radius: 20px; - border-color: @selected; + border: 2px solid; + border-radius: 15px; + border-color: @background-alt; cursor: "default"; background-color: @background; } diff --git a/config/.config/rofi/powermenu/powermenu.sh b/config/.config/rofi/menus/powermenu/powermenu.sh similarity index 97% rename from config/.config/rofi/powermenu/powermenu.sh rename to config/.config/rofi/menus/powermenu/powermenu.sh index 8185f70..f6912b7 100755 --- a/config/.config/rofi/powermenu/powermenu.sh +++ b/config/.config/rofi/menus/powermenu/powermenu.sh @@ -4,7 +4,7 @@ ## Rofi : Power Menu # Current Theme -dir="$HOME/.config/rofi/powermenu/" +dir="$HOME/.config/rofi/menus/powermenu/" theme='powermenu' # CMDs diff --git a/config/.config/rofi/wifi/wifi.rasi b/config/.config/rofi/menus/wifi/wifi.rasi similarity index 90% rename from config/.config/rofi/wifi/wifi.rasi rename to config/.config/rofi/menus/wifi/wifi.rasi index c5a7b23..00183db 100755 --- a/config/.config/rofi/wifi/wifi.rasi +++ b/config/.config/rofi/menus/wifi/wifi.rasi @@ -4,22 +4,13 @@ * **/ +@import "../../theme.rasi" + /*****----- Configuration -----*****/ configuration { show-icons: false; } -/*****----- Global Properties -----*****/ -* { - font: "Iosevka Nerd Font 10"; - background: #FFAB85; - background-alt: #FFCAB1; - foreground: #444444; - selected: #CC8FA0; - active: #7E3A4D; - urgent: #7E3A4D; -} - /*****----- Main Window -----*****/ window { /* properties for window widget */ @@ -35,9 +26,9 @@ window { enabled: true; margin: 0px; padding: 0px; - border: 0px solid; - border-radius: 20px; - border-color: @selected; + border: 2px solid; + border-radius: 15px; + border-color: @background-alt; cursor: "default"; background-color: @background; } diff --git a/config/.config/rofi/wifi/wifi.sh b/config/.config/rofi/menus/wifi/wifi.sh similarity index 98% rename from config/.config/rofi/wifi/wifi.sh rename to config/.config/rofi/menus/wifi/wifi.sh index 6dfb73b..379a49e 100755 --- a/config/.config/rofi/wifi/wifi.sh +++ b/config/.config/rofi/menus/wifi/wifi.sh @@ -10,7 +10,7 @@ # PREFIX=projects/samfelag/config/ # Rofi command to pipe into, can add any options here -dir="$HOME/$PREFIX.config/rofi/wifi/" +dir="$HOME/$PREFIX.config/rofi/menus/wifi/" theme='wifi' rofi_command="rofi -dmenu -i -theme ${dir}/${theme}.rasi" diff --git a/config/doom/config.el b/config/doom/config.el index 6f1ebfc..48861da 100644 --- a/config/doom/config.el +++ b/config/doom/config.el @@ -9,30 +9,21 @@ (setq user-full-name "Marc Sastre Rienitz" user-mail-address "marc@sastre.cat") -;; Doom exposes five (optional) variables for controlling fonts in Doom. Here -;; are the three important ones: -;; -;; + `doom-font' -;; + `doom-variable-pitch-font' -;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; -;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd -;; font string. You generally only need these two: -;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) -;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) -(setq doom-font (font-spec :family "Iosevka" :size 15)) -(setq doom-unicode-font (font-spec :family "Iosevka Nerd Font" :size 15)) - -;; There are two ways to load a theme. Both assume the theme is installed and -;; available. You can either set `doom-theme' or manually load a theme with the -;; `load-theme' function. This is the default: -(setq doom-theme 'doom-zenburn) - ;; This determines the style of line numbers in effect. If set to `nil', line ;; numbers are disabled. For relative line numbers, set this to `relative'. (setq display-line-numbers-type t) +;; Fonts +(setq doom-font (font-spec :family "Iosevka" :size 15)) +(setq doom-unicode-font (font-spec :family "Iosevka Nerd Font" :size 15)) + +;; Themeing +;; (load! "themes/base16-samfelag.el") +(use-package base16-theme + :init (add-to-list 'custom-theme-load-path "~/.config/doom/themes") + :ensure t + :config + (load-theme 'base16-samfelag t)) ;; Here are some additional functions/macros that could help you configure Doom: ;; @@ -143,15 +134,16 @@ ;; ----------------------------------------------------------------------------- ;; Appearance - Prettify ;; ----------------------------------------------------------------------------- -(load! "prettify-utils.el") +(load! "modules/prettify-utils.el") (pretty-hook python-mode ;; ("def" "𝙛") ;; ("class" "𝙘") - ("None" "∅") - ("lambda" "λ") - ("not in" "∉") - ("in" "∈")) + '("None" "∅") + '("lambda" "λ") + '("not in" "∉") + '("in" "∈")) + (pretty-hook emacs-lisp-mode) ;; ("defun" "𝙛") diff --git a/config/doom/prettify-utils.el b/config/doom/modules/prettify-utils.el similarity index 100% rename from config/doom/prettify-utils.el rename to config/doom/modules/prettify-utils.el diff --git a/config/doom/packages.el b/config/doom/packages.el index 43e5abc..07112d2 100644 --- a/config/doom/packages.el +++ b/config/doom/packages.el @@ -49,6 +49,8 @@ ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;(unpin! t) +(package! base16-theme) + (package! parinfer) ;; Editor diff --git a/config/doom/themes/base16-samfelag-theme.el b/config/doom/themes/base16-samfelag-theme.el new file mode 100644 index 0000000..e60cd7f --- /dev/null +++ b/config/doom/themes/base16-samfelag-theme.el @@ -0,0 +1,25 @@ +(require 'base16-theme) + +(defvar base16-samfelag-theme-colors + '(:base00 "#383838" + :base01 "#404040" + :base02 "#606060" + :base03 "#6f6f6f" + :base04 "#808080" + :base05 "#dcdccc" + :base06 "#c0c0c0" + :base07 "#ffffff" + :base08 "#dca3a3" + :base09 "#dfaf8f" + :base0A "#e0cf9f" + :base0B "#5f7f5f" + :base0C "#93e0e3" + :base0D "#7cb8bb" + :base0E "#dc8cc3" + :base0F "#000000") + "All colors for Base16 Samfelag are defined here.") + +(deftheme base16-samfelag) +(base16-theme-define 'base16-samfelag base16-samfelag-theme-colors) +(provide-theme 'base16-samfelag) +(provide 'base16-samfelag-theme) diff --git a/data/wallpapers/globus.jpg b/data/wallpapers/globus.jpg new file mode 100644 index 0000000..a55abce Binary files /dev/null and b/data/wallpapers/globus.jpg differ diff --git a/data/wallpapers/prat.jpg b/data/wallpapers/prat.jpg new file mode 100644 index 0000000..0eeb11b Binary files /dev/null and b/data/wallpapers/prat.jpg differ diff --git a/data/wallpapers/rosa.jpg b/data/wallpapers/rosa.jpg new file mode 100644 index 0000000..a81bc80 Binary files /dev/null and b/data/wallpapers/rosa.jpg differ diff --git a/flake.lock b/flake.lock index 4b613cd..f548867 100644 --- a/flake.lock +++ b/flake.lock @@ -1,16 +1,32 @@ { "nodes": { + "base16-schemes": { + "flake": false, + "locked": { + "lastModified": 1654895891, + "narHash": "sha256-xYYmZkHnyLCUBAkqkZ7v1Lc5m39857MukQLMRtGuvdk=", + "owner": "base16-project", + "repo": "base16-schemes", + "rev": "7c247f734eac7f04518c6e28d098635ee8dcabf5", + "type": "github" + }, + "original": { + "owner": "base16-project", + "repo": "base16-schemes", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1667735920, - "narHash": "sha256-EfkJxfLX6vVZfNR/7gZgIgwafJ+6RxHwBKp337i09gA=", + "lastModified": 1669120813, + "narHash": "sha256-00O/dvvcELCdpuFPde+bsJ9Bw974b/VunUArWlJ+lQA=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "c009b388c8c2514b24baf6231c5612192c25745c", + "rev": "a9c2a436757f09abc4c7bc0abc4d2529b312e42b", "type": "github" }, "original": { @@ -41,11 +57,11 @@ ] }, "locked": { - "lastModified": 1656169755, - "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", + "lastModified": 1667907331, + "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", + "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", "type": "github" }, "original": { @@ -55,13 +71,32 @@ "type": "github" } }, + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1667165773, + "narHash": "sha256-47gEPN7UKrNM+a3OKAFtNQeyc1/sSPgDm3OGCgphCyo=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "a58fb210eb285920ec10f204d007185b3629cadc", + "type": "github" + }, + "original": { + "owner": "misterio77", + "repo": "nix-colors", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1667639549, - "narHash": "sha256-frqZKSG/933Ctwl9voSZnXDwo8CqddXcjQhnCzwNqaM=", + "lastModified": 1669076005, + "narHash": "sha256-uzMji2q9Pk3jUH+e5nEFtoOZCP4VV1PDRJRLVmriY0M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cae3751e9f74eea29c573d6c2f14523f41c2821a", + "rev": "69335c46c48a73f291d5c6f332fb9fe8b8e22b30", "type": "github" }, "original": { @@ -69,13 +104,28 @@ "type": "indirect" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1655599917, + "narHash": "sha256-kjZbt5WdTrnjMxL79okg9TCoRUdADG50x/TWozbyTsE=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "5fb55578aa2f1a502d636a8ac71aece57cb730bb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1664594436, - "narHash": "sha256-YHowMADGzdi7fKnGlg47qe0PIljq+11VqLarmXDuKxQ=", + "lastModified": 1668984258, + "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9cac45850280978a21a3eb67b15a18f34cbffa2d", + "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a", "type": "github" }, "original": { @@ -89,6 +139,7 @@ "inputs": { "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", + "nix-colors": "nix-colors", "nixpkgs": "nixpkgs_2" } } diff --git a/flake.nix b/flake.nix index 58d3e53..bc8f8e1 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,8 @@ home-manager.url = "github:nix-community/home-manager/release-22.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nix-colors.url = "github:misterio77/nix-colors"; + emacs-overlay.url = "github:nix-community/emacs-overlay"; }; @@ -33,7 +35,10 @@ hostPath { imports = - [ inputs.home-manager.nixosModules.home-manager ] + [ + inputs.home-manager.nixosModules.home-manager + inputs.nix-colors.homeManagerModule + ] # All my personal modules ++ (lib.my.mapModulesRec' (toString ./modules) import); } diff --git a/hosts/reykjavik/default.nix b/hosts/reykjavik/default.nix index 0fa0f45..bcf546e 100644 --- a/hosts/reykjavik/default.nix +++ b/hosts/reykjavik/default.nix @@ -1,5 +1,10 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, inputs, ... }: +with lib; +let + nix-colors-lib = inputs.nix-colors.lib-contrib { inherit pkgs; }; + wallpaper = ../../data/wallpapers/globus.jpg; +in { imports = [ ./hardware.nix @@ -15,6 +20,13 @@ boot.loader.systemd-boot.enable = true; + # - Themeing --------------------------------- + + colorScheme = nix-colors-lib.colorSchemeFromPicture { + path = wallpaper; + kind = "dark"; + }; + # - Modules ------------------------------------ samfelag.modules = { @@ -32,6 +44,7 @@ # - Desktop ---------------------------------- desktop = { + inherit wallpaper; enable = true; laptop = true; }; @@ -41,7 +54,6 @@ dev.git.userName = "marc"; dev.git.userEmail = "marc@sastre.cat"; - dev.direnv.enable = true; # - Other apps ------------------------------- diff --git a/modules/app/alacritty.nix b/modules/app/alacritty.nix index 2fa4f43..8ec6bcd 100644 --- a/modules/app/alacritty.nix +++ b/modules/app/alacritty.nix @@ -16,7 +16,37 @@ in (nerdfonts.override { fonts = [ "Iosevka" ]; }) ]; - hm.xdg.configFile."alacritty".source = ../../config/.config/alacritty; + hm.xdg.configFile."alacritty/alacritty.yml".source = ../../config/.config/alacritty/alacritty.yml; + + # - Themeing --------------------------------- + hm.xdg.configFile."alacritty/theme.yml".text = '' + colors: + primary: + background: '0x${config.colorScheme.colors.base00}' + foreground: '0x${config.colorScheme.colors.base05}' + cursor: + text: '0x${config.colorScheme.colors.base00}' + cursor: '0x${config.colorScheme.colors.base05}' + normal: + black: '0x${config.colorScheme.colors.base00}' + red: '0x${config.colorScheme.colors.base08}' + green: '0x${config.colorScheme.colors.base0B}' + yellow: '0x${config.colorScheme.colors.base0A}' + blue: '0x${config.colorScheme.colors.base0D}' + magenta: '0x${config.colorScheme.colors.base0E}' + cyan: '0x${config.colorScheme.colors.base0C}' + white: '0x${config.colorScheme.colors.base05}' + bright: + black: '0x${config.colorScheme.colors.base03}' + red: '0x${config.colorScheme.colors.base09}' + green: '0x${config.colorScheme.colors.base01}' + yellow: '0x${config.colorScheme.colors.base02}' + blue: '0x${config.colorScheme.colors.base04}' + magenta: '0x${config.colorScheme.colors.base06}' + cyan: '0x${config.colorScheme.colors.base0F}' + white: '0x${config.colorScheme.colors.base07}' + draw_bold_text_with_bright_colors: false + ''; samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf i3Cfg.enable { "${i3Cfg.mod}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; diff --git a/modules/desktop/desktop.nix b/modules/desktop/desktop.nix index f5d4c47..359730e 100644 --- a/modules/desktop/desktop.nix +++ b/modules/desktop/desktop.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: with lib; let @@ -17,8 +17,7 @@ in default = false; }; - bgColour = my.mkOpt' types.str "#808F85" "Background colour for the wallpaper"; - wallpapers = my.mkOpt' types.path ../../data/wallpapers/flors "Path to a folder containing wallpapers"; + wallpaper = my.mkOpt' types.path ../../data/wallpaper/flors "Path to wallpaper(s)"; }; config = mkIf cfg.enable { @@ -64,16 +63,15 @@ in extraStartup = [ { command = "systemctl --user restart polybar"; always = true; notification = false; } - { command = "feh --bg-center -B \"${cfg.bgColour}\" -z --no-fehbg ${cfg.wallpapers}"; always = true; notification = false; } + { command = "feh --bg-fill -B \"#${config.colorScheme.colors.base00}\" -z --no-fehbg ${cfg.wallpaper}"; always = true; notification = false; } ]; extraKeybindings = { - "${cfg.i3.mod}+space" = "exec $HOME/.config/rofi/launcher/launcher.sh"; - "${cfg.i3.mod}+End" = "exec $HOME/.config/rofi/powermenu/powermenu.sh"; + "${cfg.i3.mod}+space" = "exec $HOME/.config/rofi/menus/launcher/launcher.sh"; + "${cfg.i3.mod}+End" = "exec $HOME/.config/rofi/menus/powermenu/powermenu.sh"; }; }; }; - }; } diff --git a/modules/desktop/i3.nix b/modules/desktop/i3.nix index e700a4a..8d60e5c 100644 --- a/modules/desktop/i3.nix +++ b/modules/desktop/i3.nix @@ -54,6 +54,7 @@ in { }; windowManager.i3.enable = true; + windowManager.i3.package = pkgs.i3-gaps; }; # - Configuration ---------------------------- @@ -79,10 +80,10 @@ in { titlebar = false; }; - # gaps = { - # inner = 10; - # outer = 5; - # }; + gaps = { + inner = 10; + outer = 0; + }; startup = [ { command = "i3-msg workspace 1"; } @@ -192,6 +193,39 @@ in { "${mod}+Shift+9" = "move container to workspace 9; workspace 9"; "${mod}+Shift+0" = "move container to workspace 10; workspace 10"; } // cfg.extraKeybindings; + + # - Themeing --------------------------------- + colors = { + background = "#${config.colorScheme.colors.base00}"; + focused = { + border = "#${config.colorScheme.colors.base03}"; + background = "#${config.colorScheme.colors.base0B}"; + text = "#${config.colorScheme.colors.base03}"; + indicator = "#${config.colorScheme.colors.base04}"; + childBorder = "#${config.colorScheme.colors.base03}"; + }; + focusedInactive = { + border = "#${config.colorScheme.colors.base03}"; + background = "#${config.colorScheme.colors.base04}"; + text = "#${config.colorScheme.colors.base03}"; + indicator = "#${config.colorScheme.colors.base04}"; + childBorder = "#${config.colorScheme.colors.base03}"; + }; + unfocused = { + border = "#${config.colorScheme.colors.base02}"; + background = "#${config.colorScheme.colors.base01}"; + text = "#${config.colorScheme.colors.base03}"; + indicator = "#${config.colorScheme.colors.base03}"; + childBorder = "#${config.colorScheme.colors.base02}"; + }; + urgent = { + border = "#${config.colorScheme.colors.base02}"; + background = "#${config.colorScheme.colors.base0A}"; + text = "#${config.colorScheme.colors.base02}"; + indicator = "#${config.colorScheme.colors.base03}"; + childBorder = "#${config.colorScheme.colors.base02}"; + }; + }; }; }; }; diff --git a/modules/desktop/polybar.nix b/modules/desktop/polybar.nix index 0e2bd7b..b55f018 100644 --- a/modules/desktop/polybar.nix +++ b/modules/desktop/polybar.nix @@ -35,12 +35,37 @@ in { hm.xdg.configFile."polybar/bars".source = paths.bars; hm.xdg.configFile."polybar/scripts".source = paths.scripts; + # - Themeing --------------------------------- + hm.xdg.configFile."polybar/colour-scheme.ini".text = '' + [colour-scheme] + base00 = #${config.colorScheme.colors.base00} + base01 = #${config.colorScheme.colors.base01} + base02 = #${config.colorScheme.colors.base02} + base03 = #${config.colorScheme.colors.base03} + base04 = #${config.colorScheme.colors.base04} + base05 = #${config.colorScheme.colors.base05} + base06 = #${config.colorScheme.colors.base06} + base07 = #${config.colorScheme.colors.base07} + base08 = #${config.colorScheme.colors.base08} + base09 = #${config.colorScheme.colors.base09} + base0A = #${config.colorScheme.colors.base0A} + base0B = #${config.colorScheme.colors.base0B} + base0C = #${config.colorScheme.colors.base0C} + base0D = #${config.colorScheme.colors.base0D} + base0E = #${config.colorScheme.colors.base0E} + base0F = #${config.colorScheme.colors.base0F} + ''; + + # - Dependencies ----------------------------- + # The polybar modules use rofi samfelag.modules.desktop.rofi.enable = true; samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf i3Cfg.enable { - "${i3Cfg.mod}+Shift+w" = "exec $HOME/.config/rofi/wifi/wifi.sh"; + "${i3Cfg.mod}+Shift+w" = "exec $HOME/.config/rofi/menus/wifi/wifi.sh"; }; + # - Services --------------------------------- + hm.systemd.user.services.polybar = { Unit = { Description = "Polybar status bar"; diff --git a/modules/desktop/rofi.nix b/modules/desktop/rofi.nix index 0463894..bfc9e06 100644 --- a/modules/desktop/rofi.nix +++ b/modules/desktop/rofi.nix @@ -12,6 +12,20 @@ in rofi ]; - hm.xdg.configFile."rofi".source = ../../config/.config/rofi; + hm.xdg.configFile."rofi/menus".source = ../../config/.config/rofi/menus; + + # Themeing --------------------------------- + hm.xdg.configFile."rofi/theme.rasi".text = '' + * { + font: "Iosevka Nerd Font 10"; + background: #${config.colorScheme.colors.base00}; + background-alt: #${config.colorScheme.colors.base01}; + foreground: #${config.colorScheme.colors.base05}; + selected: #${config.colorScheme.colors.base02}; + active: #${config.colorScheme.colors.base07}; + urgent: #${config.colorScheme.colors.base06}; + } + ''; + }; } diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 113649c..83f87d1 100644 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -80,11 +80,42 @@ in { env.PATH = [ "$HOME/.config/emacs/bin" ]; - hm.xdg.configFile."doom" = { - source = ../../config/doom; - recursive = true; + hm.xdg.configFile = { + "doom/modules".source = ../../config/doom/modules; + "doom/config.el".source = ../../config/doom/config.el; + "doom/custom.el".source = ../../config/doom/custom.el; + "doom/init.el".source = ../../config/doom/init.el; + "doom/packages.el".source = ../../config/doom/packages.el; + + # Themeing + "doom/themes/base16-samfelag-theme.el".text = '' + (require 'base16-theme) + (defvar base16-samfelag-theme-colors + '(:base00 "#${config.colorScheme.colors.base00}" + :base01 "#${config.colorScheme.colors.base01}" + :base02 "#${config.colorScheme.colors.base02}" + :base03 "#${config.colorScheme.colors.base03}" + :base04 "#${config.colorScheme.colors.base04}" + :base05 "#${config.colorScheme.colors.base05}" + :base06 "#${config.colorScheme.colors.base06}" + :base07 "#${config.colorScheme.colors.base07}" + :base08 "#${config.colorScheme.colors.base08}" + :base09 "#${config.colorScheme.colors.base09}" + :base0A "#${config.colorScheme.colors.base0A}" + :base0B "#${config.colorScheme.colors.base0B}" + :base0C "#${config.colorScheme.colors.base0C}" + :base0D "#${config.colorScheme.colors.base0D}" + :base0E "#${config.colorScheme.colors.base0E}" + :base0F "#${config.colorScheme.colors.base0F}") + "All colors for Base16 Samfelag are defined here.") + (deftheme base16-samfelag) + (base16-theme-define 'base16-samfelag base16-samfelag-theme-colors) + (provide-theme 'base16-samfelag) + (provide 'base16-samfelag-theme) + ''; }; + system.userActivationScripts = { installDoomEmacs = '' EMACS_FOLDER="$HOME/.config/emacs" diff --git a/modules/system/bluetooth.nix b/modules/system/bluetooth.nix index 0405832..96de4db 100644 --- a/modules/system/bluetooth.nix +++ b/modules/system/bluetooth.nix @@ -13,7 +13,7 @@ in services.blueman.enable = true; samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf desktopCfg.enable { - "${desktopCfg.i3.mod}+b" = "exec $HOME/.config/rofi/bluetooth/bluetooth.sh"; + "${desktopCfg.i3.mod}+b" = "exec $HOME/.config/rofi/menus/bluetooth/bluetooth.sh"; }; }; }