diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 9f877f25..7db9428d 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -14,13 +14,15 @@ bspc config remove_unplugged_monitors true # Rules bspc rule -r '*' -bspc rule -a 'Emacs:org*' state=floating -bspc rule -a 'Emacs:scratch' state=floating bspc rule -a mpv state=floating center=on bspc rule -a Pinentry state=floating center=on -bspc rule -a Emacs split_ratio=0.32 state=fullscreen +bspc rule -a Emacs split_ratio=0.32 state=fullscreen border=off +bspc rule -a xst-256color border=off bspc rule -a Firefox split_ratio=0.32 bspc rule -a feh state=fullscreen +bspc rule -a 'Emacs:org*' state=floating +bspc rule -a 'Emacs:scratch' state=floating +bspc rule -a st-scratch state=floating sticky=on center=on # diff --git a/config/rofi/bin/appmenu b/config/rofi/bin/appmenu new file mode 100755 index 00000000..f75f9ef3 --- /dev/null +++ b/config/rofi/bin/appmenu @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +rofi \ + -monitor -4 \ + -no-lazy-grab \ + -show drun \ + -modi drun,run \ + -display-drun apps \ + -show-icons \ + -theme theme/appmenu.rasi diff --git a/config/rofi/bin/passmenu b/config/rofi/bin/passmenu new file mode 100755 index 00000000..7578d9c6 --- /dev/null +++ b/config/rofi/bin/passmenu @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +# Prompts for a pass entry, then for a specific field. Similar to passmenu, but +# uses rofi, and can resume from a previous session. +# +# Example: passmenu [RESUME] + +ROFI_CMD='rofi -dmenu -theme theme/passmenu.rasi' +set -e +shopt -s nullglob globstar + +for prog in xclip notify-send pass; do + if ! command -v "$prog" >/dev/null; then + >&2 echo "$prog not installed, aborting" + exit 1 + fi +done + +if [[ $1 == -r ]]; then + resume=1; shift +fi +url=$@ + +LAST_ENTRY_FILE=/tmp/_upm +if [[ -n $resume && -f $LAST_ENTRY_FILE ]]; then + entry="$(<$LAST_ENTRY_FILE)" +else + prefix=${PASSWORD_STORE_DIR-~/.password-store} + password_files=( "$prefix"/**/*.gpg ) + password_files=( "${password_files[@]#"$prefix"/}" ) + password_files=( "${password_files[@]%.gpg}" ) + entry=$(printf "%s\n" "${password_files[@]}" | $ROFI_CMD -p "pass > " -filter "$url") +fi + +if [[ -z $entry ]]; then + notify-send --urgency=critical "Failed to select $entry" + exit 1 +fi + +echo "$entry" >/tmp/_upm +secrets="$(pass show "$entry")" +if [[ -n $secrets ]]; then + fields=$(awk -F': ' 'NR>1 && !/^otpauth:/ {print $1}' <<<"$secrets") + field=$(printf "password\n%s\notp\n" "${fields[@]}" | $ROFI_CMD -p "pass ($entry) > ") + case $field in + password) pass -c "$entry" ;; + otp) printf "%s" "$(pass otp -c "$entry")" ;; + *) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;; + esac + notify-send --urgency=low "$entry -> $field" "Copied to clipboard for 45s" +else + notify-send --urgency=critical "Failed to retrieve $entry" + exit 2 +fi diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index a3c28872..35296078 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -30,10 +30,10 @@ super + shift + grave emacsclient -e '(open-scratch-frame)' super + space - rofi -monitor -4 -show drun -show-icons + ~/.config/rofi/bin/appmenu super + backslash - rofi-pass + ~/.config/rofi/bin/passmenu super + Escape pkill -USR1 -x sxhkd diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh index 964bcd3b..ba2b35bc 100644 --- a/config/zsh/aliases.zsh +++ b/config/zsh/aliases.zsh @@ -1,4 +1,12 @@ -### ReDefs +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias -- -='cd -' + +alias q=exit +alias clr=clear +alias sudo='sudo ' + alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' @@ -12,17 +20,6 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' - -### convenience -alias ..='cd ..' -alias ...='cd ../..' -alias ....='cd ../../..' -alias -- -='cd -' - -alias q=exit -alias clr=clear -alias sudo='sudo ' - if command -v exa >/dev/null; then alias exa='exa --group-directories-first' alias l='exa -1' @@ -50,7 +47,6 @@ alias nc=nix-channel alias ngc=nix-garbage-collect alias nre=nixos-rebuild -### Tools autoload -U zmv take() { diff --git a/default.nix b/default.nix index f2320c03..0209e9e3 100644 --- a/default.nix +++ b/default.nix @@ -17,6 +17,7 @@ autoOptimiseStore = true; trustedUsers = [ "root" "@wheel" ]; }; + # Forgive me Stallman senpai nixpkgs.config.allowUnfree = true; # Nothing in /tmp should survive a reboot @@ -41,7 +42,9 @@ ntfs3g hfsprogs ]; - variables = { + # These are the defaults, but some applications are buggy when these lack + # explicit values. + sessionVariables = { XDG_CONFIG_HOME = "$HOME/.config"; XDG_CACHE_HOME = "$HOME/.cache"; XDG_DATA_HOME = "$HOME/.local/share"; diff --git a/modules/desktop/bspwm.nix b/modules/desktop/bspwm.nix index d28c4574..0e6c1b5f 100644 --- a/modules/desktop/bspwm.nix +++ b/modules/desktop/bspwm.nix @@ -46,16 +46,20 @@ services = { xserver = { desktopManager.xterm.enable = false; - displayManager.lightdm.enable = true; windowManager.bspwm.enable = true; + displayManager.lightdm = { + enable = true; + greeters.mini = { + enable = true; + user = "hlissner"; + }; + }; }; compton = { enable = true; backend = "glx"; vSync = true; - inactiveOpacity = "0.90"; - opacityRules = ["100:class_g = 'Firefox'"]; }; }; diff --git a/modules/shell/pass.nix b/modules/shell/pass.nix index b1ebc868..c9a309bd 100644 --- a/modules/shell/pass.nix +++ b/modules/shell/pass.nix @@ -7,7 +7,6 @@ exts.pass-otp exts.pass-genphrase ])) - (lib.mkIf (config.services.xserver.enable) rofi-pass) ]; variables.PASSWORD_STORE_DIR = "$HOME/.secrets/password-store"; diff --git a/themes/glimpse/Xresources b/themes/glimpse/Xresources index ae01279c..f7be8861 100644 --- a/themes/glimpse/Xresources +++ b/themes/glimpse/Xresources @@ -1,19 +1,19 @@ !! Colors -#define blk #131519 +#define blk #101216 #define bblk #969896 #define red #cc6666 #define bred #de935f -#define grn #b5bd68 +#define grn #8BD49C #define bgrn #757d28 #define ylw #f0c674 #define bylw #f9a03f -#define blu #81a2be +#define blu #5EC4FF #define bblu #2a8fed -#define mag #b294bb +#define mag #E27E8D #define bmag #bc77a8 #define cyn #8abeb7 #define bcyn #a3685a -#define wht #c5c8c6 +#define wht #bbc2cf #define bwht #ffffff #define bg blk #define fg wht @@ -48,22 +48,8 @@ *.color240: #544c49 *.color241: #665c54 -st.opacity: 245 - -!! Fonts -rofi.font: Fira Code 15 +!! xst +st.opacity: 200 st.font: Fira Code:pixelsize=12 st-scratch.font: Fira Code:pixelsize=15 - - -!! Rofi -rofi.padding: 12 -! bg fg bgalt hlbg hlfg -rofi.color-normal: argb:00131519, #bbc2cf, #131519, #191b1f, #f0c674 -rofi.color-urgent: argb:00131519, #bbc2cf, #131519, #191b1f, #f0c674 -rofi.color-active: argb:00131519, #bbc2cf, #131519, #191b1f, #f0c674 -! bg border sep -rofi.color-window: argb:ee131519, argb:00bbc2cf, #292d35 -! Separator style (none, dash, solid) -rofi.separator-style: solid diff --git a/themes/glimpse/bspwmrc b/themes/glimpse/bspwmrc index e91d6ef7..f2ddb064 100755 --- a/themes/glimpse/bspwmrc +++ b/themes/glimpse/bspwmrc @@ -1,14 +1,14 @@ -#!/bin/sh +#!/usr/bin/env sh bspc config borderless_monocle true bspc config gapless_monocle true -bspc config border_width 2 -bspc config window_gap 8 +bspc config border_width 1 +bspc config window_gap 12 -bspc config normal_border_color "#131519" -bspc config active_border_color "#131519" -bspc config focused_border_color "#f0c674" +bspc config normal_border_color "#11141b" +bspc config active_border_color "#21242b" +bspc config focused_border_color "#798cb3" # Extra padding for polybar bspc config -m $MONITOR window_gap 12 diff --git a/themes/glimpse/default.nix b/themes/glimpse/default.nix index 701a7c76..e1f5e173 100644 --- a/themes/glimpse/default.nix +++ b/themes/glimpse/default.nix @@ -3,25 +3,61 @@ { imports = [ ../. ]; # Load framework for themes - environment.systemPackages = with pkgs; [ arc-theme ]; + environment.systemPackages = with pkgs; [ + nordic + paper-icon-theme # for rofi + ]; + + fonts.fonts = [ pkgs.nerdfonts ]; + + services.compton = { + activeOpacity = "0.96"; + inactiveOpacity = "0.75"; + opacityRules = [ + "100:class_g = 'Firefox'" + "100:class_g = 'Gimp'" + "100:class_g = 'feh'" + "100:class_g = 'mpv'" + ]; + settings = { + blur-background = true; + blur-background-frame = true; + blur-background-fixed = true; + blur-kern = "7x7box"; + blur-strength = 340; + blur-background-exclude = [ + "window_type = 'dock'" + "window_type = 'desktop'" + ]; + }; + }; + + services.xserver.displayManager.lightdm = { + background = "${./wallpaper.blurred.jpg}"; + greeters.mini.extraConfig = '' + text-color = "#bbc2cf" + window-color = "#29323d" + border-color = "#29323d" + ''; + }; - services.xserver.displayManager.lightdm.background = "${./wallpaper.png}"; home-manager.users.hlissner = { - home.file.".background-image".source = ./wallpaper.png; + home.file.".background-image".source = ./wallpaper.jpg; xdg.configFile = { "xtheme/90-theme".source = ./Xresources; "dunst/dunstrc".source = ./dunstrc; "bspwm/rc.d/theme".source = ./bspwmrc; "bspwm/rc.d/polybar".source = ./polybar/run.sh; - "rofi/theme".source = ./rofi.theme; "polybar" = { source = ./polybar; recursive = true; }; + "rofi/theme" = { source = ./rofi; recursive = true; }; + "zsh/prompt.zsh".source = ./zsh/prompt.zsh; # GTK "gtk-3.0/settings.ini".text = '' [Settings] - gtk-theme-name=Arc-Dark - gtk-icon-theme-name=Arc-Dark + gtk-theme-name=Nordic-blue + gtk-icon-theme-name=Paper gtk-fallback-icon-theme=gnome gtk-application-prefer-dark-theme=true gtk-cursor-theme-name=Numix @@ -32,15 +68,15 @@ # GTK2 global theme (widget and icon theme) "gtk-2.0/gtkrc".text = '' - gtk-theme-name="Arc-Dark" - gtk-icon-theme-name="adwaita" + gtk-theme-name="Nordic-blue" + gtk-icon-theme-name="Paper-Mono-Dark" gtk-font-name="Sans 10" ''; # QT4/5 global theme "Trolltech.conf".text = '' [Qt] - style=Arc-Dark + style=Nordic-blue ''; }; }; diff --git a/themes/glimpse/polybar/config b/themes/glimpse/polybar/config index 3025cf46..c5abb933 100644 --- a/themes/glimpse/polybar/config +++ b/themes/glimpse/polybar/config @@ -1,6 +1,6 @@ [colors] bg = ${xrdb:background} -fg = ${xrdb:foreground} +fg = ${xrdb:color4} black = ${xrdb:color0} bblack = ${xrdb:color8} red = ${xrdb:color1} @@ -19,7 +19,7 @@ white = ${xrdb:color7} bwhite = ${xrdb:color15} bg-alt = #0F1013 -fg-alt = #25282a +fg-alt = #25283a icons = #555856 alert = ${colors.red} @@ -86,8 +86,8 @@ format = label-padding = 1 label-focused = %icon% -label-focused-background = #33000000 -label-focused-foreground = ${colors.green} +label-focused-background = #44000000 +label-focused-foreground = ${colors.blue} ; label-focused-underline = ${colors.magenta} ; label-focused-foreground = ${xrdb:color2} label-focused-padding = 1 diff --git a/themes/glimpse/rofi.theme b/themes/glimpse/rofi.theme deleted file mode 100644 index 2180f18b..00000000 --- a/themes/glimpse/rofi.theme +++ /dev/null @@ -1,100 +0,0 @@ -/* - * ROFI One Dark - * - * Based on OneDark.vim (https://github.com/joshdick/onedark.vim) - * - * Author: Benjamin Stauss - * User: me-benni - * - */ - - -* { - black: #000000; - red: #eb6e67; - green: #95ee8f; - yellow: #f8c456; - blue: #6eaafb; - mangenta: #d886f3; - cyan: #6cdcf7; - emphasis: #50536b; - text: #dfdfdf; - text-alt: #b2b2b2; - fg: #abb2bf; - bg: #282c34; - - spacing: 0; - background-color: transparent; - - font: "Knack Nerd Font 14"; - text-color: @text; -} - -window { - transparency: "real"; - fullscreen: true; - background-color: #282c34dd; -} - -mainbox { - padding: 30% 30%; -} - -inputbar { - margin: 0px 0px 20px 0px; - children: [prompt, textbox-prompt-colon, entry, case-indicator]; -} - -prompt { - text-color: @blue; -} - -textbox-prompt-colon { - expand: false; - str: ":"; - text-color: @text-alt; -} - -entry { - margin: 0px 10px; -} - -listview { - spacing: 5px; - dynamic: true; - scrollbar: false; -} - -element { - padding: 5px; - text-color: @text-alt; - highlight: bold #95ee8f; /* green */ - border-radius: 3px; -} - -element selected { - background-color: @emphasis; - text-color: @text; -} - -element urgent, element selected urgent { - text-color: @red; -} - -element active, element selected active { - text-color: @purple; -} - -message { - padding: 5px; - border-radius: 3px; - background-color: @emphasis; - border: 1px; - border-color: @cyan; -} - -button selected { - padding: 5px; - border-radius: 3px; - background-color: @emphasis; -} diff --git a/themes/glimpse/rofi/appmenu.rasi b/themes/glimpse/rofi/appmenu.rasi new file mode 100644 index 00000000..a5d35d21 --- /dev/null +++ b/themes/glimpse/rofi/appmenu.rasi @@ -0,0 +1,48 @@ +/** -*- mode: css; -*- + * This theme is intended for a 8x2 items list menu with a headerbar. + */ +@import "config.rasi" +* { + background-color: @background; + text-color: @foreground-list; + font: @text-font; +} +#window { + padding: @list-8-window-padding; +} +inputbar, +prompt, +textbox-prompt-colon, +entry { + background-color: @background-light; +} +#inputbar { + children: [ prompt, textbox-prompt-colon, entry ]; + margin: @inputbar-margin; +} +#prompt { + padding: @prompt-padding; + background-color: @accent; + text-color: @background; +} +#textbox-prompt-colon { + expand: false; + str: " : : "; + padding: @apps-textbox-prompt-colon-padding; +} +#entry { + text-color: @accent; + padding: @entry-padding; +} +#element { + padding: @list-element-padding; + margin: @list-element-margin; + border: @list-element-border; + background-color: @background-light; + border-color: @background-light; +} +#element.selected { + background-color: @background-focus; + text-color: @accent; + border-color: @accent; +} diff --git a/themes/glimpse/rofi/config.rasi b/themes/glimpse/rofi/config.rasi new file mode 100644 index 00000000..cc4416ca --- /dev/null +++ b/themes/glimpse/rofi/config.rasi @@ -0,0 +1,49 @@ +/* -*- mode: css; -*- */ +configuration { + icon-theme: "Paper"; + cycle: true; + hide-scrollbar: true; + disable-history: false; + /* + modi: "drun"; + display-drun: "apps"; + */ + columns: 2; +} + +* { + accent: #51afef; + background: #101216; + background-light: #1f1f1f; + background-focus: #282828; + foreground: #888888; + foreground-list: #bbbbbb; + on: #98be65; + off: #ff6c6b; + + text-font: "Fira Sans 16"; + text-font-mono: "Fira Mono 16"; + icon-font: "Hurmit Nerd Font Mono 60"; + icon-font-small: "Hurmit Nerd Font Mono 24"; + + /* General */ + inputbar-margin: 4px 4px; + prompt-padding: 14px 18px; + entry-padding: 16px 14px 14px 0px; + /* list menus: appsmenu, networkmenu and nmvpnmenu */ + list-element-padding: 20px; + list-element-margin: @inputbar-margin; + list-element-border: 0px 0px 0px 8px; + list-8-window-padding: 240px 18%; + /* appsmenu */ + apps-textbox-prompt-colon-padding: 16px; + /* networkmenu */ + network-textbox-prompt-colon-padding: 14px 10px 10px 10px; + /* nmvpnmenu */ + nmvpn-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding; +} + +#window { + width: 100%; + height: 100%; +} diff --git a/themes/glimpse/rofi/passmenu.rasi b/themes/glimpse/rofi/passmenu.rasi new file mode 100644 index 00000000..46905809 --- /dev/null +++ b/themes/glimpse/rofi/passmenu.rasi @@ -0,0 +1,16 @@ +/* -*- mode: css; -*- */ + +@import "appmenu.rasi" + +#prompt { + background-color: #c678dd; +} + +#entry { + text-color: #c678dd; +} + +#element.selected { + text-color: #c678dd; + border-color: #c678dd; +} diff --git a/themes/glimpse/wallpaper.blurred.jpg b/themes/glimpse/wallpaper.blurred.jpg new file mode 100644 index 00000000..da683b3f Binary files /dev/null and b/themes/glimpse/wallpaper.blurred.jpg differ diff --git a/themes/glimpse/wallpaper.jpg b/themes/glimpse/wallpaper.jpg new file mode 100644 index 00000000..626fcbde Binary files /dev/null and b/themes/glimpse/wallpaper.jpg differ diff --git a/themes/glimpse/wallpaper.png b/themes/glimpse/wallpaper.png deleted file mode 100644 index 68e90a03..00000000 Binary files a/themes/glimpse/wallpaper.png and /dev/null differ diff --git a/config/zsh/prompt.zsh b/themes/glimpse/zsh/prompt.zsh similarity index 94% rename from config/zsh/prompt.zsh rename to themes/glimpse/zsh/prompt.zsh index 201195e3..1d83100c 100644 --- a/config/zsh/prompt.zsh +++ b/themes/glimpse/zsh/prompt.zsh @@ -42,7 +42,7 @@ prompt_init() { zle-keymap-select() { case $KEYMAP in vicmd) PROMPT_SYMBOL="%F{magenta}« " ;; - main|viins) PROMPT_SYMBOL="%(?.%F{green}.%F{red})λ " ;; + main|viins) PROMPT_SYMBOL="%(?.%F{blue}.%F{red})λ " ;; esac zle reset-prompt zle -R @@ -65,7 +65,7 @@ prompt_init() { fi RPROMPT='%F{blue}%~%F{magenta}${vcs_info_msg_0_}$(prompt_git_dirty)%f' - PROMPT='%F{blue}${prompt_username}%f${PROMPT_SYMBOL:-$ }' + PROMPT='%F{green}${prompt_username}%f${PROMPT_SYMBOL:-$ }' } prompt_init "$@"