From c6cc202ab95e6f199e63d59ea68d4bcb39940945 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Tue, 9 Apr 2024 18:29:39 -0600 Subject: redid bash config and update script, experimenting with doom emacs --- alacritty/alacritty.toml | 56 +++++++++++++ alacritty/alacritty.yml | 189 ------------------------------------------- bash/.bash/00-global.bash | 14 ---- bash/.bash/01-aliases.bash | 85 -------------------- bash/.bash/02-prompt.bash | 135 ------------------------------- bash/.bash/03-boot.bash | 32 -------- bash/.bash/04-other.bash | 7 -- bash/.bash_profile | 20 ----- bash/.bashrc | 15 ---- doom/config.el | 76 ++++++++++++++++++ doom/init.el | 195 +++++++++++++++++++++++++++++++++++++++++++++ doom/packages.el | 50 ++++++++++++ sh/.profile | 15 ++++ sh/bash/.bash_profile | 53 ++++++++++++ sh/bash/.bashrc | 167 ++++++++++++++++++++++++++++++++++++++ update.sh | 11 ++- vscode/settings.json | 8 +- x/.xinitrc | 26 +++--- xmobar/xmobar.hs | 18 +++-- xmonad/xmonad.hs | 43 ++++++---- 20 files changed, 677 insertions(+), 538 deletions(-) create mode 100644 alacritty/alacritty.toml delete mode 100644 alacritty/alacritty.yml delete mode 100644 bash/.bash/00-global.bash delete mode 100644 bash/.bash/01-aliases.bash delete mode 100644 bash/.bash/02-prompt.bash delete mode 100644 bash/.bash/03-boot.bash delete mode 100644 bash/.bash/04-other.bash delete mode 100644 bash/.bash_profile delete mode 100644 bash/.bashrc create mode 100644 doom/config.el create mode 100644 doom/init.el create mode 100644 doom/packages.el create mode 100644 sh/.profile create mode 100644 sh/bash/.bash_profile create mode 100644 sh/bash/.bashrc diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml new file mode 100644 index 0000000..5bf139a --- /dev/null +++ b/alacritty/alacritty.toml @@ -0,0 +1,56 @@ +[colors.bright] +black = "#7c6f64" +blue = "#83a598" +cyan = "#8ec07c" +green = "#b8bb26" +magenta = "#d3869b" +red = "#fb4934" +white = "#ebdbb2" +yellow = "#fabd2f" + +[colors.normal] +black = "#282828" +blue = "#458588" +cyan = "#689d6a" +green = "#98971a" +magenta = "#b16286" +red = "#cc241d" +white = "#a89984" +yellow = "#d79921" + +[colors.primary] +background = "#282828" +foreground = "#fbf1c7" + +[font] +size = 14.5 + +[font.bold] +family = "JetBrains Mono Nerd Font" +style = "Bold" + +[font.bold_italic] +family = "JetBrains Mono Nerd Font" +style = "Bold Italic" + +[font.italic] +family = "JetBrains Mono Nerd Font" +style = "Italic" + +[font.normal] +family = "JetBrains Mono Nerd Font" +style = "Regular" + +[font.offset] +x = 0 +y = 1 + +[mouse] +hide_when_typing = true + +[window] +opacity = 1 + +[window.padding] +x = 10 +y = 7 diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml deleted file mode 100644 index ce70c08..0000000 --- a/alacritty/alacritty.yml +++ /dev/null @@ -1,189 +0,0 @@ -font: - normal: - family: JetBrains Mono Nerd Font - # family: SF Mono - # family: Roboto Mono - # family: Monocraft - # family: Scientifica - style: Regular - bold: - family: JetBrains Mono Nerd Font - # family: SF Mono - # family: Roboto Mono - # family: Monocraft - # family: Scientifica - style: Bold - italic: - family: JetBrains Mono Nerd Font - # family: SF Mono - # family: Roboto Mono - # family: Monocraft - # family: Scientifica - style: Italic - bold_italic: - family: JetBrains Mono Nerd Font - # family: SF Mono - # family: Roboto Mono - # family: Monocraft - # family: Scientifica - style: Bold Italic - - size: 13.5 - - offset: - x: 0 - y: 1 - -window: - padding: - x: 10 - y: 7 - opacity: 1 - -mouse: - hide_when_typing: true - -#colors: -# primary: -# background: '#000000' -# foreground: '#ffffff' -# -# normal: -# black: '#000000' -# red: '#B00508' -# green: '#1B8F06' -# yellow: '#E9E700' -# blue: '#0858B5' -# magenta: '#830CB4' -# cyan: '#0CB488' -# white: '#9e9e9e' -# -# bright: -# black: '#373737' -# red: '#FF1313' -# green: '#44FF3A' -# yellow: '#FFAE11' -# blue: '#0095FF' -# magenta: '#D400D2' -# cyan: '#28FCB8' -# white: '#ffffff' - -# Colors (Ayu Dark) -#colors: - # Default colors - # primary: - # background: '0x0A0E14' - # foreground: '0xB3B1AD' - - # Normal colors - #normal: - # black: '0x01060E' - # red: '0xEA6C73' - # green: '0x91B362' - # yellow: '0xF9AF4F' - # blue: '0x53BDFA' - # magenta: '0xFAE994' - # cyan: '0x90E1C6' - # white: '0xC7C7C7' - - # Bright colors - #bright: - # black: '0x686868' - # red: '0xF07178' - # green: '0xC2D94C' - # yellow: '0xFFB454' - # blue: '0x59C2FF' - # magenta: '0xFFEE99' - # cyan: '0x95E6CB' - # white: '0xFFFFFF' - -# Gruvbox dark -colors: - primary: - background: '#282828' - # background: '#1A1D1E' - # background: '#3c3836' - # background: '#32302f' -# background: '#000000' - foreground: '#fbf1c7' - - normal: - black: '#282828' - red: '#cc241d' - green: '#98971a' - yellow: '#d79921' - blue: '#458588' - magenta: '#b16286' - cyan: '#689d6a' - white: '#a89984' - - bright: - # black: '#928374' - black: '#7c6f64' - red: '#fb4934' - # red: '#fe8019' - green: '#b8bb26' - yellow: '#fabd2f' - blue: '#83a598' - magenta: '#d3869b' - cyan: '#8ec07c' - white: '#ebdbb2' - -# Colors (Gnome Terminal) -#colors: - # Default colors - # primary: - # background: '#1e1e1e' - # foreground: '#ffffff' - - # Normal colors - #normal: - # black: '#171421' - # red: '#c01c28' - # green: '#26a269' - # yellow: '#a2734c' - # blue: '#12488b' - # magenta: '#a347ba' - # cyan: '#2aa1b3' - # white: '#d0cfcc' - - # Bright colors - #bright: - # black: '#5e5c64' - # red: '#f66151' - # green: '#33d17a' - # yellow: '#e9ad0c' - # blue: '#2a7bde' - # magenta: '#c061cb' - # cyan: '#33c7de' - # white: '#ffffff' - -# Colors (Nord) -#colors: - # Default colors -# primary: -# background: '#2E3440' -# foreground: '#D8DEE9' - - # Normal colors -# normal: -# black: '#3B4252' -# red: '#BF616A' -# green: '#A3BE8C' -# yellow: '#EBCB8B' -# blue: '#81A1C1' -# magenta: '#B48EAD' -# cyan: '#88C0D0' -# white: '#E5E9F0' - -# # Bright colors -# bright: -# black: '#4C566A' -# red: '#BF616A' -# green: '#A3BE8C' -# yellow: '#EBCB8B' -# blue: '#81A1C1' -# magenta: '#B48EAD' -# cyan: '#8FBCBB' -# white: '#ECEFF4' - diff --git a/bash/.bash/00-global.bash b/bash/.bash/00-global.bash deleted file mode 100644 index 1700755..0000000 --- a/bash/.bash/00-global.bash +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# 00-global.bash -# define global bash things -# - -# expand history size -export HISTSIZE=100000 - -# source global definitions -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi - diff --git a/bash/.bash/01-aliases.bash b/bash/.bash/01-aliases.bash deleted file mode 100644 index 3786b8f..0000000 --- a/bash/.bash/01-aliases.bash +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# -# 01-aliases.bash -# bryson's bash aliases -# - -shopt -s expand_aliases - -alias sudo="doas" - -# typos -alias l='ls' -alias sl='ls' -alias balls='sudo $(fc -ln -1)' - -# always run with args -alias grep='grep --color=auto' -alias fgrep='fgrep --color=auto' -alias egrep='egrep --color=auto' -alias ls='ls --color=auto' -alias la='ls -a' -alias ll='ls -lh' -alias cp='cp -iv' -alias mv='mv -iv' -alias rm='rm -vI' -alias diff='diff --color=auto' -alias g++='g++ --std=c++20' -alias vim='vim -p' -alias gs='gs -dNOSAFER' - -# cd shortcuts -alias ..='cd ..' -alias ...='cd ../..' -alias ....='cd ../../..' -alias b='cd -' - -# portage aliases -alias emerge-update="sudo emerge --ask --verbose --update --deep --changed-use @world" -alias package.use='sudo vim /etc/portage/package.use' -alias make.conf='sudo vim /etc/portage/make.conf' -alias package.license='sudo vim /etc/portage/package.license' -alias world='vim -R /var/lib/portage/world' - -# copy an entire file -alias copy='xclip -sel c <' - -# binary substitutions -alias java='/usr/local/java/jdk-18.0.1.1/bin/java' -alias java11='/usr/bin/java' -alias python='python3' -alias ed='fzf --height=15 --layout=reverse | sed "s/^/\"/g;s/$/\"/g" | xargs -ro vim' - -# common combinations -alias dj='python manage.py' -alias smci='sudo make clean install' -alias smi='sudo make install' -alias lib='xrandr --output HDMI-A-0 --auto --output eDP --off && xset r rate 300 50 && feh --bg-fill ~/git/wallpapers-exorcist/gruvbox/mountains-2.jpg && xmodmap ~/.Xmodmap' -alias nolib='xrandr --output HDMI-A-0 --off --output eDP --auto && feh --bg-fill ~/git/wallpapers-exorcist/gruvbox/mountains-2.jpg' -alias hgrep='history | grep' -alias keys='xset r rate 300 50' -alias gits='git status' -alias mac="rm -rf __MACOSX/; rm \$(find . -name '.DS_Store')" -alias super='xmodmap -e "remove mod1 = Alt_L"; xmodmap -e "remove mod4 = Super_L"; xmodmap -e "add mod1 = Super_L"; xmodmap -e "add mod4 = Alt_L"' -alias make-kernel='sudo genkernel --luks --lvm --install --kernel-config=/proc/config.gz --microcode=intel all && sudo grub-mkconfig -o /boot/grub/grub.cfg' - -# bash navigation -alias aa='vim ~/.bash/01-aliases.bash; . ~/.bash_profile' - -ssh-pixel() { - ssh -p 8022 uO_14O@${1} -} - -# fixes -alias fixwifi='sudo rc-service wpa_supplicant restart' -alias fixaudio='pacmd set-default-sink alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo' -alias fixjava='export _JAVA_AWT_WM_NONREPARENTING=1 && export AWT_TOOLKIT=MToolkit && wmname LG3D' -alias fixkeb='xmodmap ~/.Xmodmap ; xset r rate 200 80 ' - -# auto elevate -alias mount='sudo mount' -alias umount='sudo umount' - -# other garbage -alias server="python3 /home/bryson/git/webserver/server.py" - diff --git a/bash/.bash/02-prompt.bash b/bash/.bash/02-prompt.bash deleted file mode 100644 index 035f216..0000000 --- a/bash/.bash/02-prompt.bash +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash -# -# 02-prompt.bash -# bryson's gnarly bash prompt config -# -shopt -s histappend - -# color definitions -black='\e[0;30m' -BLACK='\e[1;30m' -dgray='\e[0;90m' -DGRAY='\e[1;90m' -red='\e[0;31m' -RED='\e[1;31m' -lred='\e[0;91m' -LRED='\e[1;91m' -green='\e[0;32m' -GREEN='\e[1;32m' -lgreen='\e[0;92m' -LGREEN='\e[1;92m' -yellow='\e[0;33m' -YELLOW='\e[1;33m' -lyellow='\e[0;93m' -LYELLOW='\e[1;93m' -blue='\e[0;34m' -BLUE='\e[1;34m' -lblue='\e[0;94m' -LBLUE='\e[1;94m' -magenta='\e[0;35m' -MAGENTA='\e[1;35m' -lmagenta='\e[0;95m' -LMAGENTA='\e[1;95m' -cyan='\e[0;36m' -CYAN='\e[1;36m' -lcyan='\e[0;96m' -LCYAN='\e[1;96m' -lgray='\e[0;37m' -LGRAY='\e[1;37m' -NC='\e[0m' # No Color - -# 256color prompt variables -color1='\e[38;5;39m' -color2='\e[38;5;81m' -color3='\e[38;5;77m' -color4='\e[38;5;226m' - -# return exit code of last program if not 0 -function exit_code() { - local ERROR="$?" - if [[ ERROR -ne 0 ]]; then - echo -n ''"$dgray"'\]/\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]\\' - # echo -n '\['"$RED"'\]'"$ERROR"' ' - else - echo -n ''"$dgray"'\]/\['"$LCYAN"'\]'"$ERROR"'\['"$dgray"'\]\\' - fi -} - -# get current git branch and status -# http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/ -function _git_prompt() { - local git_status="`git status -unormal 2>&1`" - if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then - if [[ "$git_status" =~ nothing\ to\ commit ]]; then - local ansi="" - local color="$lgreen" - elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then - local ansi="!" - local color="$lred" - else - local ansi="*" - local color="$lyellow" - fi - if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then - branch=${BASH_REMATCH[1]} - else - # Detached HEAD. (branch=HEAD is a faster alternative.) - branch="`git describe --all --contains --abbrev=4 HEAD 2> /dev/null || - echo local`" - fi - if ! [[ "$branch" =~ local ]]; then - # echo -n '\['"$color"'\] ('"$ansi"''"$branch"') ' - echo -n '\['"$dgray"'\](\['"$color"'\]'"$branch"''"$ansi"'\['"$dgray"'\])' - fi - fi -} - -export -f exit_code -export -f _git_prompt - -# prompt building -# (2 unicode)[ bryson@hostname ] { /current/path } -# (unicode) $ -#export _PS1="\[$dgray\]╭─[ \[$LGREEN\]\u\[$lgray\]@\[$YELLOW\]\h\[$dgray\] ] {\[$LBLUE\] \w\[$dgray\] } " -#export _PS2="\[$dgray\]╰ " - -# same as above, no unicode -#export _PS1="\[$dgray\][ \[$GREEN\]\u\[$lgray\]@\[$LRED\]\h\[$dgray\] ] { \[$LCYAN\]\w\[$dgray\] } " - -# bryson@hostname /current/path/ bash 10:00:00 PM -#export _PS1="\[\e[1m$color1\]\u\[$color2\]@\[$color3\]\h \[$color4\]\w \[$color3\]\@ \[$color2\]\s " - -# [ bryson@hostname /current/path ] -# $ -#export _PS1="\[$lgray\][ \[\e[1m$color1\]\u\[$color2\]@\[$color3\]\h \[$color4\]\w \[\e[0m$lgray\]]" -#export _PS1="\[\e[$lgray\][ \[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\w \[$lgray\]]" -#export _PS2="\[$dgray\]" - -# [ bryson@hostname path ] -# $ -#export _PS1="\[\e[$lgray\][ \[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\W \[$lgray\]]" -#export _PS2="\[$dgray\]" - -#export _PS1="\[\e[$lgray\]\[$LBLUE\]\u\[$lcyan\]@\[$GREEN\]\h \[$LYELLOW\]\W\[$lgray\]" - -# [ hostname ] Thu Mar 25, 10:00:00 AM, /dev/pts/0 -# { /current/path } 8 files, 64 KB (master) -# $ -# export _PS1="\[$lgray\][ \[$LMAGENTA\]\h\[$lgray\] ] \[$LYELLOW\]\d, \[$LRED\]\T" -# export _PS2="\[$lgray\]{ \[$CYAN\]\w\[$lgray\] }" - -# bryson@hostname:/current/path:master -# $ -# export _PS1="\[$LBLUE\]\u\[$dgray\]@\[$LGREEN\]\h\[$dgray\]:\[$LYELLOW\]\w" - -# hostname[/current/path]{12:00:00}[255](master) -# $ -export _PS1="\[$LGREEN\]\h\[$dgray\][\[$LYELLOW\]\w\[$dgray\]]<\[$LBLUE\]\u\[$dgray\]>{\[$LMAGENTA\]\@\[$dgray\]}" - -# define x titlebar -TITLEBAR='\[\033]0;\u@\h:\w ($(history 1 | cut -c 8-))\]' - -# apply prompt and functions -# export PROMPT_COMMAND='export PS1="$TITLEBAR$(exit_code)${_PS1}\n${_PS2}$(_git_prompt)\n\[$NC\]\$ ";history -a' -export PROMPT_COMMAND='export PS1="$TITLEBAR${_PS1}$(exit_code)$(_git_prompt)\n\[$NC\]\$ ";history -a' - diff --git a/bash/.bash/03-boot.bash b/bash/.bash/03-boot.bash deleted file mode 100644 index 952dd83..0000000 --- a/bash/.bash/03-boot.bash +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# 03-boot.bash -# startup scripts for systems - -# run startup script if tty -# for dingo -if [[ $TERM == 'linux' && $(hostname) == 'landseer' ]]; then - cat ~/bin/house.txt - printf "\n${CYAN}Welcome back Bryson :)\n\n" - printf "${LGREEN}What should landseer do?\n${magenta}" - echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n" - - while read -rs -N 1 key; do - printf "${NC}" - case $key in - n) startx ;; - q) echo "Are you sure you want to shutdown? (y/n)"; - read -rs -N 1 key2; case $key2 in y) doas shutdown -Ph now ;; esac; ;; - r) echo "Are you sure you want to reboot? (y/n)"; - read -rs -N 1 key3; case $key3 in y) doas reboot ;; esac; ;; - l) logout ;; - b) break ;; - [h?]) echo "$USAGE";; - esac - clear - cat ~/bin/house.txt - printf "\n${LGREEN}What should landseer do?\n${magenta}" - echo -e "\tn: start x\n\tq: shutdown\n\tr: reboot\n\tl: logout\n\tb: bash\n\n" - done -fi - diff --git a/bash/.bash/04-other.bash b/bash/.bash/04-other.bash deleted file mode 100644 index 63271b5..0000000 --- a/bash/.bash/04-other.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# if [[ -z $TMUX ]] && [[ -n $SSH_TTY ]]; then -# exec tmux new-session -A -s ssh -# fi -# -export DOTNET_CLI_TELEMETRY_OPTOUT="true" diff --git a/bash/.bash_profile b/bash/.bash_profile deleted file mode 100644 index dba61c3..0000000 --- a/bash/.bash_profile +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# .bash_profile - -PATH=$PATH:$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools - -# Get the aliases and functions -if [ -f ~/.bashrc ]; then - . ~/.bashrc -fi - -# User specific environment and startup programs -export EDITOR=/usr/bin/vim -export TERMINAL=/usr/bin/alacritty -export BROWSER=/usr/bin/librewolf-bin -export XZ_OPT='-9 -T0 -M 32000000000' - -export PATH -complete -cf doas -source /usr/share/bash-completion/completions/fzf -source /usr/share/fzf/key-bindings.bash diff --git a/bash/.bashrc b/bash/.bashrc deleted file mode 100644 index 821a3fb..0000000 --- a/bash/.bashrc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# get custom bash scripts -if [ -d ~/.bash/ ]; then - for f in ~/.bash/*; do . $f; done -fi - -# install asdf -#. $HOME/.asdf/asdf.sh -#. $HOME/.asdf/completions/asdf.bash - -# devkitpro -DEVKITPRO=/opt/devkitpro -DEVKITARM=/opt/devkitpro/devkitARM -DEVKITPPC=/opt/devkitpro/devkitPPC diff --git a/doom/config.el b/doom/config.el new file mode 100644 index 0000000..6e8fb96 --- /dev/null +++ b/doom/config.el @@ -0,0 +1,76 @@ +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Place your private configuration here! Remember, you do not need to run 'doom +;; sync' after modifying this file! + + +;; Some functionality uses this to identify you, e.g. GPG configuration, email +;; clients, file templates and snippets. It is optional. +;; (setq user-full-name "John Doe" +;; user-mail-address "john@doe.com") + +;; Doom exposes five (optional) variables for controlling fonts in Doom: +;; +;; - `doom-font' -- the primary font to use +;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) +;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; - `doom-symbol-font' -- for symbols +;; - `doom-serif-font' -- for the `fixed-pitch-serif' face +;; +;; See 'C-h v doom-font' for documentation and more examples of what they +;; accept. For example: +;; +(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 19) + doom-variable-pitch-font (font-spec :family "Inter" :size 17)) +;; +;; If you or Emacs can't find your font, use 'M-x describe-font' to look them +;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to +;; refresh your font settings. If Emacs still can't find your font, it likely +;; wasn't installed correctly. Font issues are rarely Doom issues! + +;; 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-gruvbox) + +;; 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 'relative) + +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq org-directory "~/org/") + +;; Whenever you reconfigure a package, make sure to wrap your config in an +;; `after!' block, otherwise Doom's defaults may override your settings. E.g. +;; +;; (after! PACKAGE +;; (setq x y)) +;; +;; The exceptions to this rule: +;; +;; - Setting file/directory variables (like `org-directory') +;; - Setting variables which explicitly tell you to set them before their +;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). +;; - Setting doom variables (which start with 'doom-' or '+'). +;; +;; Here are some additional functions/macros that will help you configure Doom. +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, +;; etc). +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. +(setq scroll-margin 5) diff --git a/doom/init.el b/doom/init.el new file mode 100644 index 0000000..d4ae151 --- /dev/null +++ b/doom/init.el @@ -0,0 +1,195 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;bidi ; (tfel ot) thgir etirw uoy gnipleh + ;;chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + company ; the ultimate code completion backend + ;;(corfu +orderless) ; complete with cap(f), cape and a flying feather! + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;;ivy ; a search engine for love and life + vertico ; the search engine of the future + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + ;;(emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;;indent-guides ; highlighted indent columns + ;;ligatures ; ligatures and symbols to make your code pretty again + ;;minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + ;;nav-flash ; blink cursor line after big motions + neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + ;;tabs ; a tab bar for Emacs + ;; treemacs ; a project drawer, like neotree but cooler + unicode ; extended unicode support for various languages + (vc-gutter +pretty) ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + ;;workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + ;;(format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + ;;multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + word-wrap ; soft wrapping with language-aware indent + + :emacs + dired ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + ibuffer ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + (spell +flyspell) ; tasing you for misspelling mispelling + grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + ;;biblio ; Writes a PhD for you (citation needed) + ;;collab ; buffers with friends + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + lookup ; navigate your code and its documentation + lsp ; M-x vscode + magit ; a git porcelain for Emacs + make ; run make tasks from Emacs + ;;pass ; password manager for nerds + pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;;tree-sitter ; syntax and parsing, sitting in a tree... + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if (featurep :system 'macos) macos) ; improve compatibility with macOS + tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + (cc +lsp) ; C > C++ == 1 + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + csharp ; unity, .NET, and mono shenanigans + ;;data ; config/data formats + (dart +flutter) ; paint ui and not much else + ;;dhall + elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + gdscript ; the language you waited for + (go +lsp) ; the hipster dialect + ;;(graphql +lsp) ; Give queries a REST + (haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + ;;json ; At least it ain't XML + (java +lsp) ; the poster child for carpal tunnel syndrome + javascript ; all(hope(abandon(ye(who(enter(here)))))) + julia ; a better, faster MATLAB + kotlin ; a better, slicker Java(Script) + (latex +lsp) ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + ;;nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + org ; organize your plain life in plain text + php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + (python +lsp +pyright) ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + web ; the tubes + yaml ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;;(mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;emms + ;;everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) diff --git a/doom/packages.el b/doom/packages.el new file mode 100644 index 0000000..364e6e9 --- /dev/null +++ b/doom/packages.el @@ -0,0 +1,50 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: +;; (package! some-package) + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/radian-software/straight.el#the-recipe-format +;; (package! another-package +;; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': +;; (package! this-package +;; :recipe (:host github :repo "username/repo" +;; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: +;; (package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: +;; (package! builtin-package :recipe (:nonrecursive t)) +;; (package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see radian-software/straight.el#279) +;; (package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. +;; (package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... +;; (unpin! pinned-package) +;; ...or multiple packages +;; (unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) +;; (unpin! t) diff --git a/sh/.profile b/sh/.profile new file mode 100644 index 0000000..99da34c --- /dev/null +++ b/sh/.profile @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# +# bryson's shell-agnostic profile +# + +# shell variables +PATH=$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools:$HOME/bin:$HOME/.config/emacs/bin:$PATH +EDITOR=/usr/bin/vim +TERMINAL=/usr/bin/alacritty +BROWSER=/usr/bin/librewolf-bin +XZ_OPT='-9 -T0 -M 32000000000' +DOTNET_CLI_TELEMETRY_OPTOUT="true" + +# finally export all variables +export PATH EDITOR TERMINAL BROWSER XZ_OPT DOTNET_CLI_TELEMETRY_OPTOUT diff --git a/sh/bash/.bash_profile b/sh/bash/.bash_profile new file mode 100644 index 0000000..d2d4cc3 --- /dev/null +++ b/sh/bash/.bash_profile @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# +# bryson's bash profile +# + +# import shell-agnostic profile +if [ -f ~/.profile ]; then + . ~/.profile +fi + +# import global bashrc +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# if login shell, run tty menu +if [[ $TERM == 'linux' ]]; then + while true; do + echo -e "\e[0;35m***** MAIN MENU *****\e[0m" + echo "1: Start XMonad" + echo "2: Exit to Bash" + echo -e "\e[0;35m---\e[0m" + echo "8: Logout" + echo "9: Reboot" + echo "0: Shutdown" + read -rs -N 1 key + case $key in + 1) startx ;; + 2) break ;; + 8) logout ;; + 9) echo "Are you sure you want to reboot? (y will reboot)"; + read -rs -N 1 confirm; [ "$confirm" = 'y' ] && (doas reboot; break) ;; + 0) echo "Are you sure you want to shutdown? (y will shutdown)"; + read -rs -N 1 confirm; [ "$confirm" = 'y' ] && (doas reboot; break) ;; + esac + done +fi +# end tty menu + +# bash specific variables +HISTSIZE=100000 + +# enable command completion for doas +complete -cf doas +shopt -s expand_aliases + +# export variables +export HISTSIZE black BLACK dgray DGRAY red RED lred LRED green GREEN lgreen LGREEN yellow LYELLOW blue BLUE lblue LBLUE magenta MAGENTA lmagenta LMAGENTA cyan CYAN lcyan LCYAN lgray LGRAY NC + +# import bashrc +# if [ -f ~/.bashrc ]; then +# . ~/.bashrc +# fi diff --git a/sh/bash/.bashrc b/sh/bash/.bashrc new file mode 100644 index 0000000..1315e51 --- /dev/null +++ b/sh/bash/.bashrc @@ -0,0 +1,167 @@ +#!/usr/bin/env bash +# +# bryson's bashrc +# + +### aliases ### +alias sudo="doas" + +# typos +alias l='ls' +alias sl='ls' + +# always run with args +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias ls='ls --color=auto' +alias la='ls -a' +alias ll='ls -lh' +alias lla='ls -lha' +alias cp='cp -iv' +alias mv='mv -iv' +alias rm='rm -vI' +alias diff='diff --color=auto' +alias g++='g++ --std=c++20' +alias vim='vim -p' +alias gs='gs -dNOSAFER' +alias emacsclient='emacsclient -cn' + +# cd shortcuts +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias b='cd -' + +# copy an entire file +alias copy='xclip -sel c <' + +# binary substitutions +# alias ed='fzf --height=15 --layout=reverse | sed "s/^/\"/g;s/$/\"/g" | xargs -ro vim' + +# common combinations +alias dj='python manage.py' +alias smci='sudo make clean install' +alias smi='sudo make install' +alias lib='xrandr --output HDMI-A-0 --auto --output eDP --off && xset r rate 300 50 && feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox-2.png && xmodmap ~/.Xmodmap' +alias laptop='xrandr --output HDMI-A-0 --off --output eDP --auto && feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox-2.png' +alias mirror='xrandr --output HDMI-A-0 --auto && feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox-2.png && xmodmap ~/.Xmodmap' +alias hgrep='history | grep' +alias keys='xset r rate 300 50' +alias gits='git status' +alias mac="rm -rf __MACOSX/; rm \$(find . -name '.DS_Store')" + +# fixes +alias fixwifi='sudo rc-service wpa_supplicant restart' +alias fixaudio='pacmd set-default-sink alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo' +alias fixjava='export _JAVA_AWT_WM_NONREPARENTING=1 && export AWT_TOOLKIT=MToolkit && wmname LG3D' +alias fixkeb='xmodmap ~/.Xmodmap ; xset r rate 200 80 ' + +# auto elevate +alias mount='sudo mount' +alias umount='sudo umount' + +# other garbage +alias server="python3 /home/bryson/git/webserver/server.py" + +### colors ### +# capitals are bold +# 'l' is 'light' +# 'd' is 'dark' +black='\e[0;30m' +BLACK='\e[1;30m' +dgray='\e[0;90m' +DGRAY='\e[1;90m' +red='\e[0;31m' +RED='\e[1;31m' +lred='\e[0;91m' +LRED='\e[1;91m' +green='\e[0;32m' +GREEN='\e[1;32m' +lgreen='\e[0;92m' +LGREEN='\e[1;92m' +yellow='\e[0;33m' +YELLOW='\e[1;33m' +lyellow='\e[0;93m' +LYELLOW='\e[1;93m' +blue='\e[0;34m' +BLUE='\e[1;34m' +lblue='\e[0;94m' +LBLUE='\e[1;94m' +magenta='\e[0;35m' +MAGENTA='\e[1;35m' +lmagenta='\e[0;95m' +LMAGENTA='\e[1;95m' +cyan='\e[0;36m' +CYAN='\e[1;36m' +lcyan='\e[0;96m' +LCYAN='\e[1;96m' +lgray='\e[0;37m' +LGRAY='\e[1;37m' +NC='\e[0m' # No Color + +### functions galore! ### +# upload item to webserver +function upload() { + scp $1 paul:/home/PUBLIC/upload && echo https://brysonsteck.xyz/pub/upload/$(echo $1 | rev | cut -d '/' -f 1 | rev) +} + +# return exit code of last program if not 0 +function exit_code() { + local ERROR="$?" + if [[ ERROR -ne 0 ]]; then + # echo -n ''"$dgray"'\]/\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]\\' + echo -n '\['"$dgray"'\]<\['"$RED"'\]'"$ERROR"'\['"$dgray"'\]> ' + # else + # # echo -n ''"$dgray"'\]/\['"$LBLUE"'\]'"$ERROR"'\['"$dgray"'\]\\' + # echo -n '\['"$RED"'\]'"$ERROR"' ' + fi +} + +# get current git branch and status +# http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/ +function _git_prompt() { + local git_status="`git status -unormal 2>&1`" + if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then + if [[ "$git_status" =~ nothing\ to\ commit ]]; then + local ansi="" + local color="$lcyan" + elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then + local ansi="!" + local color="$lred" + else + local ansi="*" + local color="$lyellow" + fi + if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then + branch=${BASH_REMATCH[1]} + else + # Detached HEAD. (branch=HEAD is a faster alternative.) + branch="`git describe --all --contains --abbrev=4 HEAD 2> /dev/null || + echo local`" + fi + if ! [[ "$branch" =~ local ]]; then + # echo -n '\['"$color"'\] ('"$ansi"''"$branch"') ' + echo -n '\['"$dgray"'\](\['"$color"'\]'"$branch"''"$ansi"'\['"$dgray"'\])' + fi + fi +} + +export -f exit_code +export -f _git_prompt + +### shell prompt ### +# bryson@hostname [/current/path] {12:00:00} <255> (master) +# $ +export _PS1="\[$LCYAN\]\u\[$dgray\]@\[$LGREEN\]\h \[$dgray\][\[$YELLOW\]\w\[$dgray\]] {\[$LBLUE\]\@\[$dgray\]} " + +# define x titlebar +TITLEBAR='\[\033]0;\u@\h \w\]' + +# apply prompt and functions +# ignore titlebar if xterm, likely don't need a title anyway +if [[ "$TERM" =~ xterm-256color ]]; then + export PROMPT_COMMAND='export PS1="${_PS1}$(exit_code)$(_git_prompt)\n\[$NC\]\$ ";echo' +else + export PROMPT_COMMAND='export PS1="$TITLEBAR${_PS1}$(exit_code)$(_git_prompt)\n\[$LGRAY\]\$\[$NC\] ";echo' +fi diff --git a/update.sh b/update.sh index f3bd820..68430b1 100755 --- a/update.sh +++ b/update.sh @@ -2,10 +2,7 @@ # important config files echo copying files... -cp ~/.config/alacritty.yml ./alacritty/alacritty.yml -cp -r ~/.bash ./bash -cp ~/.bash_profile ./bash -cp ~/.bashrc ./bash +cp ~/.config/alacritty.toml ./alacritty/alacritty.toml cp ~/.config/tmux/tmux.conf ./tmux cp ~/.vimrc ./vim cp ~/.vim/coc-settings.json ./vim @@ -20,10 +17,12 @@ cp ~/bin/startdwm ./x cp ~/.config/xmobar/xmobar.hs ./xmobar cp ~/.config/xmonad/xmonad.hs ./xmonad cp ~/.config/VSCodium/User/settings.json ./vscode - -# other config files +cp ~/.profile ./sh +cp ~/.bash_profile ./sh/bash +cp ~/.bashrc ./sh/bash cp ~/.config/dunst/dunstrc ./dunst cp ~/.config/htop/htoprc ./htop +cp ~/.config/doom/* ./doom # update submodules echo pulling submodules... diff --git a/vscode/settings.json b/vscode/settings.json index 47d364e..9d26365 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -77,5 +77,11 @@ "avdmanager.sdkPath": "/home/bryson/.android/sdk", "avdmanager.executable": "/home/bryson/.android/sdk/tools/bin/avdmanager", "avdmanager.sdkManager": "/home/bryson/.android/sdk/tools/bin/sdkmanager", - "haskell.manageHLS": "GHCup" + "haskell.manageHLS": "GHCup", + "jupyter.widgetScriptSources": [ + "jsdelivr.com", + "unpkg.com" + ], + "rust-client.engine": "rust-analyzer", + "rust-client.disableRustup": true, } \ No newline at end of file diff --git a/x/.xinitrc b/x/.xinitrc index 85323f7..f81a47c 100644 --- a/x/.xinitrc +++ b/x/.xinitrc @@ -1,8 +1,4 @@ #!/bin/sh -# executed by startx-not-docked -# for use when dingo is NOT docked -export DOCKED=false - # load xinitrc.d stuff userresources=$HOME/.Xresources @@ -43,20 +39,19 @@ fi # start picom compositor picom --config ~/.config/picom.conf & -#spotifyd & - # add network, battery, date and time to xsetroot -slstatus & +# slstatus & # reset backlight -light -S 30 & +# light -S 30 & # set default audio device to be laptop speakers # pacmd set-default-sink alsa_output.pci-0000_03_00.6.HiFi__hw_Generic_1__sink & # pacmd set-sink-volume alsa_output.pci-0000_03_00.6.HiFi__hw_Generic_1__sink 0 & # set up wallpaper -feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox.png & +feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox-2.png & +# sleep 1 && feh --bg-fill ~/Pictures/Wallpapers/solid-gruvbox-2.png & # apply Xresources xrdb -merge ~/.Xresources @@ -65,7 +60,7 @@ xrdb -merge ~/.Xresources xbanish & # turn tearfree on -xrandr --output eDP --auto --set TearFree on --output HDMI-A-0 --set TearFree on & +xrandr --output eDP --auto & #--set TearFree on --output HDMI-A-0 --set TearFree on & # run battery checker ~/bin/battery & @@ -73,6 +68,9 @@ xrandr --output eDP --auto --set TearFree on --output HDMI-A-0 --set TearFree on # start keepassxc for passwords keepassxc ~/.passwords/Passwords.kdbx & +# start emacs daemon +emacs --daemon & + # if logitech keyboard detected, turn alt into super if $(lsusb | grep -qi "Logitech Mechanical Keyboard"); then xmodmap -e "remove mod1 = Alt_L" @@ -81,9 +79,13 @@ if $(lsusb | grep -qi "Logitech Mechanical Keyboard"); then xmodmap -e "add mod4 = Alt_L" fi -# start dwm +# lock screen and suspend after 20 minutes of inactivity +xautolock -time 20 -locker slock -secure & + +# start xmonad redshift & xmobar & xset r rate 300 80 -#exec /home/bryson/bin/startdwm +# exec /home/bryson/bin/startdwm exec $HOME/.cache/xmonad/xmonad-x86_64-linux +# exec qtile start diff --git a/xmobar/xmobar.hs b/xmobar/xmobar.hs index 1bd7e22..27b9e07 100644 --- a/xmobar/xmobar.hs +++ b/xmobar/xmobar.hs @@ -1,6 +1,6 @@ import Xmobar -green, red, blue, blue2, purple, yellow, orange, lowWhite, white :: String +green, red, blue, blue2, aqua, purple, yellow, orange, lowWhite, white :: String green = "#b8bb26" red = "#fb4934" blue = "#83a598" @@ -8,6 +8,7 @@ blue2 = "#458588" purple = "#d3869b" yellow = "#fabd2f" orange = "#fe8019" +aqua = "#8ec07c" lowWhite = "#a89984" white = "#ebdbb2" @@ -15,16 +16,23 @@ config :: Config config = defaultConfig { overrideRedirect = False - , font = "xft:JetBrains Mono NF:style=medium:size=10" - , bgColor = "#3c3836" + , font = "xft:JetBrains Mono NF Medium-10" + , bgColor = "#282828" , fgColor = "#ebdbb2" - , position = Top + , position = Static { xpos=0, ypos=0, width=2256, height=23 } , commands = [ Run $ Cpu ["--template", "\63521 %" , "-L", "30" , "-H", "70" , "--high", red , "--normal", yellow ] 10 + , Run $ CoreTemp [ "--template" , "\63687 °C" + , "--Low" , "50" -- units: °C + , "--High" , "80" -- units: °C + , "--low" , aqua + , "--normal" , orange + , "--high" , red + ] 20 , Run $ Alsa "default" "Master" [ "--template", "墳 " , "--suffix", "True" @@ -69,7 +77,7 @@ config = ] , sepChar = "%" , alignSep = "}{" - , template = " %XMonadLog% }{%alsa:default:Master%|\62941 %brightness%|%battery%|%dynnetwork%|%cpu%|%memory%%swap%|%date% " + , template = " %XMonadLog% }{%alsa:default:Master%|\62941 %brightness%|%battery%|%dynnetwork%|%cpu%|%coretemp%|%memory%%swap%|%date% " } main :: IO() diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index 0c55e5c..c356091 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -1,5 +1,7 @@ import XMonad +import qualified XMonad.StackSet as W + import XMonad.Actions.UpdatePointer import XMonad.Actions.CycleWS import XMonad.Actions.DwmPromote @@ -21,10 +23,12 @@ import XMonad.Layout.Grid import XMonad.Util.Cursor import XMonad.Util.EZConfig import XMonad.Util.Loggers -import XMonad.Util.Ungrab import System.Exit (exitSuccess) +dmenuFormatting :: String -> String +dmenuFormatting command = command ++ " -fn 'JetBrains Mono NF:style=medium:size=11' -nb '#282828' -nf '#ebdbb2' -sb '#d3869b' -sf '#282828'" + main :: IO () main = xmonad . ewmh @@ -39,10 +43,12 @@ myConfig = def , startupHook = setDefaultCursor xC_left_ptr -- sets the cursor , handleEventHook = swallowEventHook (className =? "Alacritty") (return True) -- make alacritty swallowable , workspaces = myWorkspaces -- workspace names - , logHook = updatePointer (0.5, 0.5) (0, 0) -- warp pointer to center of window on focus + -- , logHook = dynamicLogWithPP myXmobarPP { + -- ppOutput = hPutStrLn description + -- } >> historyHook , borderWidth = 2 - , normalBorderColor = "#3c3836" - , focusedBorderColor = "#928374" + , normalBorderColor = "#282828" + , focusedBorderColor = "#fe8019" } `additionalKeysP` [ -- executables @@ -55,13 +61,15 @@ myConfig = def , ("M-", spawn "brightness-down") , ("M-", spawn "brightness-up") , ("M-", spawn "screenshot") - , ("M-p", spawn "dmenu_run_history -fn 'JetBrains Mono NF:style=medium:size=11' -nb '#3c3836' -nf '#ebdbb2' -sb '#504945' -sf '#ebdbb2'") + , ("M-p", spawn (dmenuFormatting "dmenu_run_history")) , ("M-S-", spawn "spawn-alacritty") + , ("M-S-e", spawn "emac") -- XMonad calls , ("M-", toggleWS) , ("M-", dwmpromote) -- layout jumps - , ("M-t", sendMessage $ JumpToLayout "Normal") + , ("M-S-t", sendMessage $ JumpToLayout "Normal") + , ("M-a", sendMessage $ JumpToLayout "Accrdin") -- rebound quit call , ("M-S-", io exitSuccess) ] @@ -75,33 +83,34 @@ myWorkspaces = [ "!", "@", "#", "$", "%", "^", "&", "*", "(" ] myLayout = tiled ||| full ||| threeCol ||| accordion ||| grid where - tiled = renamed [Replace "Normal"] $ spaced $ Tall nmaster delta ratio - full = renamed [Replace "Full"] $ spaced $ Full - threeCol = renamed [Replace "ThreeCol"] $ spaced $ ThreeColMid nmaster delta ratio - accordion = renamed [Replace "Accrdin"] $ spaced $ Accordion - grid = renamed [Replace "Grid"] $ spaced $ Grid + tiled = renamed [Replace "Normal"] $ Tall nmaster delta ratio + full = renamed [Replace "Full"] $ Full + threeCol = renamed [Replace "ThreeCol"] $ ThreeColMid nmaster delta ratio + accordion = renamed [Replace "Accrdin"] $ Accordion + grid = renamed [Replace "Grid"] $ Grid nmaster = 1 -- Default number of windows in the master pane ratio = 6/10 -- Default proportion of screen occupied by master pane delta = 2/100 -- Percent of screen to increment by when resizing panes - spaced = spacing 2 + -- spaced = spacing 0 myManageHook :: ManageHook myManageHook = composeAll - [ className =? "Gimp" --> doFloat - , isDialog --> doFloat + [ + -- className =? "Gimp" --> doFloat + isDialog --> doFloat ] myXmobarPP :: PP myXmobarPP = def { ppSep = magenta " • " , ppTitleSanitize = xmobarStrip - , ppCurrent = wrap "" "" . xmobarBorder "Top" "#8be9fd" 2 + , ppCurrent = wrap "" "" . xmobarBorder "Top" "#83a598" 2 , ppUrgent = red . wrap (yellow "!") (yellow "!") , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] , ppExtras = [logTitles formatFocused formatUnfocused] } where - formatFocused = wrap (white "{") (white "}") . aqua . ppWindow . shorten 80 + formatFocused = wrap (blue "{ ") (blue " }") . aqua . ppWindow . shorten 80 formatUnfocused = wrap (lowWhite "<") (lowWhite ">") . lowWhite . ppWindow . shorten 40 -- | Windows should have *some* title, which should not not exceed a @@ -117,4 +126,4 @@ myXmobarPP = def red = xmobarColor "#fb4934" "" green = xmobarColor "#b8bb26" "" lowWhite = xmobarColor "#a89984" "" - aqua = xmobarColor "#8ec07c" "" \ No newline at end of file + aqua = xmobarColor "#8ec07c" "" -- cgit v1.2.3