diff --git a/config/bspwm/bin/bspc-focus b/bin/bspwm/bspc-focus similarity index 100% rename from config/bspwm/bin/bspc-focus rename to bin/bspwm/bspc-focus diff --git a/config/bspwm/bin/bspc-swap b/bin/bspwm/bspc-swap similarity index 100% rename from config/bspwm/bin/bspc-swap rename to bin/bspwm/bspc-swap diff --git a/bin/scratch b/bin/scratch new file mode 100755 index 00000000..c1e57dc7 --- /dev/null +++ b/bin/scratch @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +SCRID=scratch +CMD='tmux new-session -A -s scratch -n scratch' +focused=$(xdotool getactivewindow) +scratch=$(xdotool search --onlyvisible --classname $SCRID) +if [[ -n $scratch ]]; then + if [[ $focused == $scratch ]]; then + xdotool windowkill $scratch + else + xdotool windowactivate $scratch + fi +elif command -v alacritty >/dev/null; then + alacritty --class $SCRID \ + -d 90 26 \ + -e $SHELL -c "$CMD" +elif command -v urxvt >/dev/null; then + urxvt -name $SCRID \ + -geometry 100x26 \ + -e $SHELL -c '${tmux}/bin/tmux new-session -A -s scratch -n scratch' +elif command -v xst >/dev/null; then + xst -t $SCRID -n $SCRID -c $SCRID \ + -f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \ + -g 100x26 \ + -e $SHELL +else + >&2 echo "No shell to launch the scratch terminal with" + exit 1 +fi diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 2b2bb2a2..8f071920 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -21,8 +21,7 @@ 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 URxvt:urxvt-scratch state=floating sticky=on center=on -bspc rule -a URxvt:urxvt-calc state=floating sticky=on center=on +bspc rule -a '*:scratch' state=floating sticky=on center=on # diff --git a/config/rofi/bin/rofi-filemenu b/config/rofi/bin/rofi-filemenu index 1a5a80b8..a5ee94ec 100755 --- a/config/rofi/bin/rofi-filemenu +++ b/config/rofi/bin/rofi-filemenu @@ -3,7 +3,7 @@ DIR="$(fd -L --type d . $HOME | rofi -dmenu -i -p files -columns 1 -theme theme/ if [ -d "$DIR" ]; then cd "$DIR" if [[ $1 == "-x" ]]; then - st-scratch + scratch else xst fi diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index f37285dd..346f9b92 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -21,10 +21,10 @@ super + {_,shift +}{1-9,0} bspc {desktop -f,node -d} {1-9,10} super + Return - urxvt -e bash -c "tmux new || tmux attach" + $TERMINAL -e bash -c "tmux new || tmux attach" super + grave - urxvt-scratch + scratch super + shift + grave emacsclient -e '(open-scratch-frame)' @@ -61,10 +61,10 @@ Print scrcap # screencast region to mp4 super + Print - scrrec -s ~/recordings/$(date +%F-%T).mp4 + scrrec -s ~/shared/$(date +%F-%T).mp4 # screencast region to gif super + ctrl + Print - scrrec -s ~/recordings/$(date +%F-%T).gif + scrrec -s ~/shared/$(date +%F-%T).gif XF86MonBrightnessUp light -A 5 @@ -73,10 +73,8 @@ XF86MonBrightnessDown XF86AudioMute amixer -q set Master toggle - XF86AudioLowerVolume amixer -q set Master 10%- unmute - XF86AudioRaiseVolume amixer -q set Master 10%+ unmute diff --git a/modules/desktop/apps/st.nix b/modules/desktop/apps/st.nix index c8992b85..c179a825 100644 --- a/modules/desktop/apps/st.nix +++ b/modules/desktop/apps/st.nix @@ -5,8 +5,6 @@ my.zsh.rc = ''[ "$TERM" = xst-256color ] && export TERM=xterm-256color''; my.packages = with pkgs; [ - libqalculate # calculator cli w/ currency & unit conversion - xst # st + nice-to-have extensions (makeDesktopItem { name = "xst"; @@ -16,41 +14,5 @@ exec = "${xst}/bin/xst"; categories = "Development;System;Utility"; }) - - (writeScriptBin "st-scratch" '' - #!${stdenv.shell} - SCRID=st-scratch - focused=$(xdotool getactivewindow) - scratch=$(xdotool search --onlyvisible --classname $SCRID) - if [[ -n $scratch ]]; then - if [[ $focused == $scratch ]]; then - xdotool windowkill $scratch - else - xdotool windowactivate $scratch - fi - else - xst -t $SCRID -n $SCRID -c $SCRID \ - -f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \ - -g 100x26 \ - -e $SHELL - fi - '') - (writeScriptBin "st-calc" '' - #!${stdenv.shell} - SCRID=st-calc - scratch=$(xdotool search --onlyvisible --classname $SCRID) - [ -n "$scratch" ] && xdotool windowkill $scratch - xst -t $SCRID -n $SCRID -c $SCRID \ - -f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \ - -g 80x12 \ - -e $SHELL -c qalc - '') - (makeDesktopItem { - name = "st-calc"; - desktopName = "Calculator"; - icon = "calc"; - exec = "st-calc"; - categories = "Development"; - }) ]; } diff --git a/modules/desktop/apps/urxvt.nix b/modules/desktop/apps/urxvt.nix index 2175524a..07cd46bb 100644 --- a/modules/desktop/apps/urxvt.nix +++ b/modules/desktop/apps/urxvt.nix @@ -2,41 +2,6 @@ { my.packages = with pkgs; [ - libqalculate # calculator cli w/ currency & unit conversion - rxvt_unicode - (writeScriptBin "urxvt-scratch" '' - #!${stdenv.shell} - SCRID=urxvt-scratch - focused=$(xdotool getactivewindow) - scratch=$(xdotool search --onlyvisible --classname $SCRID) - if [[ -n $scratch ]]; then - if [[ $focused == $scratch ]]; then - xdotool windowkill $scratch - else - xdotool windowactivate $scratch - fi - else - urxvt -name $SCRID \ - -geometry 100x26 \ - -e $SHELL -c '${tmux}/bin/tmux new-session -A -s scratch -n scratch' - fi - '') - (writeScriptBin "urxvt-calc" '' - #!${stdenv.shell} - SCRID=urxvt-calc - scratch=$(xdotool search --onlyvisible --classname $SCRID) - [ -n "$scratch" ] && xdotool windowkill $scratch - urxvt -name $SCRID \ - -geometry 80x20 \ - -e $SHELL -c 'qalc' - '') - (makeDesktopItem { - name = "urxvt-calc"; - desktopName = "Calculator"; - icon = "calc"; - exec = "urxvt-calc"; - categories = "Development"; - }) ]; } diff --git a/modules/desktop/bspwm.nix b/modules/desktop/bspwm.nix index d0acfc01..2d9b4f99 100644 --- a/modules/desktop/bspwm.nix +++ b/modules/desktop/bspwm.nix @@ -2,21 +2,11 @@ { imports = [ - ./. # common settings - # My launcher - ./apps/rofi.nix - # I often need a thumbnail browser to show off, peruse or organize photos, - # design work, or digital art. - ./apps/thunar.nix - # - ./apps/redshift.nix - # - ./apps/urxvt.nix + ./. # common settings ]; environment.systemPackages = with pkgs; [ lightdm - bspwm dunst libnotify (polybar.override { @@ -26,24 +16,17 @@ ]; services = { - xserver = { - enable = true; - windowManager.bspwm.enable = true; - desktopManager.xterm.enable = lib.mkDefault false; - displayManager.lightdm = { - enable = true; - greeters.mini = { - enable = true; - user = config.my.username; - }; - }; - }; compton.enable = true; + xserver = { + windowManager.default = "bspwm"; + windowManager.bspwm.enable = true; + displayManager.lightdm.enable = true; + displayManager.lightdm.greeters.mini.enable = true; + }; }; - # For polybar my = { - env.PATH = [ ]; + env.PATH = [ ]; home.xdg.configFile = { "sxhkd".source = ; # link recursively so other modules can link files in their folders diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 2a448d07..22508c43 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,17 +1,37 @@ { config, lib, pkgs, ... }: { - my = { - packages = with pkgs; [ - calibre # managing my ebooks - evince # pdf reader - feh # image viewer - mpv # video player - xclip - xdotool - ]; + imports = [ + ## Desktop apps + ./apps/redshift.nix + ./apps/rofi.nix # My launcher + ./apps/thunar.nix # I often need a thumbnail browser to show off, peruse + # or organize photos, design work, or digital art. + + ## Terminal + # ./apps/alacritty.nix + # ./apps/st.nix + ./apps/urxvt.nix + ]; + + my.env.TERMINAL = "urxvt"; + + services.xserver = { + enable = true; + desktopManager.xterm.enable = lib.mkDefault false; + displayManager.lightdm.greeters.mini.user = config.my.username; }; + my.packages = with pkgs; [ + calibre # managing my ebooks + evince # pdf reader + feh # image viewer + mpv # video player + xclip + xdotool + libqalculate # calculator cli w/ currency conversion + ]; + ## Sound sound.enable = true; hardware.pulseaudio.enable = true; diff --git a/modules/themes/aquanaut/Xresources b/modules/themes/aquanaut/Xresources index a762084f..985fee6c 100644 --- a/modules/themes/aquanaut/Xresources +++ b/modules/themes/aquanaut/Xresources @@ -49,28 +49,33 @@ *.color241: #665c54 +!! general +scratch.font: Fira Code:pixelsize=16 + + +!! xst +st.opacity: 200 +st.font: Fira Code:pixelsize=12 + + !! urxvt URxvt*depth: 32 URxvt*.background: [80]#101216 ! URxvt*.termName: xterm-256color +URxvt*.borderless: 1 URxvt*.buffered: true URxvt*.cursorBlink: true -URxvt*.underlineColor: grey -URxvt*.borderless: 1 -URxvt.iso14755: false -URxvt.iso14755_52: false +URxvt*.font: xft:Fira Code:pixelsize=12 URxvt*.internalBorder: 10 -URxvt*.scrollBar: false -URxvt*.saveLines: 5000 +URxvt*.letterSpace: 0 +URxvt*.lineSpace: 0 URxvt*.loginShell: false -URxvt.perl-ext-common: default,matcher URxvt*.matcher.button: 1 URxvt*.matcher.rend.0: Uline Bold fg5 +URxvt*.saveLines: 5000 +URxvt*.scrollBar: false +URxvt*.underlineColor: grey URxvt.clipboard.autocopy: true - -! fonts -URxvt*.lineSpace: 0 -URxvt*.letterSpace: 0 -URxvt*.font: xft:Fira Code:pixelsize=12 -urxvt-scratch.font: xft:Fira Code:pixelsize=16 -urxvt-calc.font: xft:Fira Code:pixelsize=22 +URxvt.iso14755: false +URxvt.iso14755_52: false +URxvt.perl-ext-common: default,matcher