From 91c28bdd1ea7d4b6071466b86a1b24814f1e3dcc Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Sat, 2 Oct 2021 11:21:15 -0400 Subject: [PATCH] General overhaul Updated zsh files, added aliases and scripts Programs list updated to be more OS-agnostic --- .config/zsh/.zshrc | 33 ++++++++++++++++++++++---------- .config/zsh/aliases.zsh | 13 +++++++++++++ .local/bin/cleanup | 14 ++++++++++++++ .local/bin/kcon | 30 +++++++++++++++++++++++++++++ .local/bin/mon-on | 1 - .local/bin/notification-sound.sh | 4 ++++ .local/bin/s.sh | 5 +++++ .local/bin/ss.sh | 5 +++++ .local/bin/update-grub | 9 +++++++++ .zshenv | 22 +++++++++++++++++++++ README.md | 8 ++------ programs | 4 ++++ programs-aur | 1 - 13 files changed, 131 insertions(+), 18 deletions(-) create mode 100644 .config/zsh/aliases.zsh create mode 100755 .local/bin/cleanup create mode 100755 .local/bin/kcon delete mode 100755 .local/bin/mon-on create mode 100755 .local/bin/s.sh create mode 100755 .local/bin/ss.sh create mode 100755 .local/bin/update-grub delete mode 100644 programs-aur diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 8166f48..6d28764 100755 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,14 +1,27 @@ autoload -Uz compinit promptinit -compinit -promptinit - -prompt redhat -alias ls='ls --color=auto' -alias nvid='neovide --multiGrid' - -PATH=$PATH:~/.local/bin/ bindkey -v -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +compinit + +promptinit +prompt redhat + +SAVEHIST=500 + +PATH=$PATH:~/.local/bin/ + + +# This is where these files are on my Gentoo system +source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh +source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh + +# On my Arch systems +# source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +# Load aliases +source ~/.config/zsh/aliases.zsh + +# Fix bug with curses pinentry +gpgt diff --git a/.config/zsh/aliases.zsh b/.config/zsh/aliases.zsh new file mode 100644 index 0000000..d93bd4b --- /dev/null +++ b/.config/zsh/aliases.zsh @@ -0,0 +1,13 @@ +# Color ls +alias ls='ls --color=auto' +# Limit mpv to 1080p so it doesn't buffer +alias mpv='mpv --ytdl-format="bestvideo[ext=mp4][height<=?1080]+bestaudio[ext=m4a]"' +# Set gpg tty so curses pinentry works +alias gpgt='export GPG_TTY=$(tty)' +# Remove newlines from clipboard (for competitive programming) +alias dnl='xsel -b | tr "\n" " " | xsel -ib' +# Private neovim +alias nvimp='nvim -u NONE -c "setlocal history=0 nobackup nomodeline noshelltemp noswapfile noundofile nowritebackup secure viminfo=\"\""' +# Specific to my Gentoo system +alias genlop='doas -u portage /usr/bin/genlop' +alias loginctl='doas /bin/loginctl' diff --git a/.local/bin/cleanup b/.local/bin/cleanup new file mode 100755 index 0000000..f00c248 --- /dev/null +++ b/.local/bin/cleanup @@ -0,0 +1,14 @@ +#!/bin/sh + +# Clean up useless dotfiles + +rm -rf \ +.audacity-data \ +.mplayer \ +.w3m \ +.wget-hsts \ +.python_history \ +.units_history \ +.xsel.log + +rmdir Downloads Desktop 2>/dev/null diff --git a/.local/bin/kcon b/.local/bin/kcon new file mode 100755 index 0000000..b50c530 --- /dev/null +++ b/.local/bin/kcon @@ -0,0 +1,30 @@ +#!/bin/sh + +# Configure the Gentoo kernel, then compile and install it + +cd /usr/src/linux + +make menuconfig + +# Stop the script here if you only need to configure +sleep 2 + +# Compile kernel +make -j8 +notify-send "Kernel compilation finished." + +# Loadable modules are disabled in my configuration. +#make modules_install + +# Install kernel to /boot +make install + +# Generate initramfs +genkernel --install --kernel-config=.config --luks initramfs --no-ramdisk-modules + +# Regenerate grub config +update-grub + +# Notify when finished +tput bel +notify-send "Kernel installation finished." diff --git a/.local/bin/mon-on b/.local/bin/mon-on deleted file mode 100755 index bee0bb5..0000000 --- a/.local/bin/mon-on +++ /dev/null @@ -1 +0,0 @@ -xrandr --output eDP1 --mode 1920x1080 --pos 2560x673 --rotate normal --output DP2-1 --primary --mode 2560x1440 --left-of DP1 --rotate normal --output DP1 --mode 2560x1440 --pos 0x0 --rotate normal --output HDMI1 --off --output HDMI2 --off --output VIRTUAL1 --off diff --git a/.local/bin/notification-sound.sh b/.local/bin/notification-sound.sh index 92a7719..fa6cc5d 100755 --- a/.local/bin/notification-sound.sh +++ b/.local/bin/notification-sound.sh @@ -1 +1,5 @@ +#!/bin/sh + +# Dunst notification sound script + mpv ~/med/aud/not.mp3 diff --git a/.local/bin/s.sh b/.local/bin/s.sh new file mode 100755 index 0000000..f7b24dc --- /dev/null +++ b/.local/bin/s.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Screenshot to clipboard, and leave a copy at ~/med/screen/latest.png + +sleep 0.1 && scrot -sf '/tmp/%F_%T_$wx$h.png' -e 'cp $f ~/med/screen/latest.png && xclip -selection clipboard -target image/png -i $f' diff --git a/.local/bin/ss.sh b/.local/bin/ss.sh new file mode 100755 index 0000000..d5c9b8c --- /dev/null +++ b/.local/bin/ss.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Screenshot and save to disk. + +sleep 0.1 && scrot -sf '/tmp/%F_%T_$wx$h.png' -e 'cp $f ~/med/screen/latest.png && mv $f ~/med/screen/' diff --git a/.local/bin/update-grub b/.local/bin/update-grub new file mode 100755 index 0000000..b80b346 --- /dev/null +++ b/.local/bin/update-grub @@ -0,0 +1,9 @@ +#!/bin/sh + +# Regenerate grub config + +grub-mkconfig -o /boot/grub/grub.cfg + +# I don't mount the efi partition normally. +mount /dev/nvme0n1p1 /boot/efi +grub-mkconfig -o /boot/efi/EFI/gentoo/grub.cfg diff --git a/.zshenv b/.zshenv index 0936776..dd64c2b 100644 --- a/.zshenv +++ b/.zshenv @@ -1,13 +1,35 @@ #/bin/sh +# Set XDG directories export XDG_CONFIG_HOME="$HOME"/.config export XDG_CACHE_HOME="$HOME"/.cache export XDG_DATA_HOME="$HOME"/.local/share +# Clean up home directory dotfiles + +# XAuthority export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority +# GTK2 export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc +# zsh export ZDOTDIR="$HOME"/.config/zsh export HISTFILE="$XDG_DATA_HOME"/zsh/history +# less export LESSHISTFILE=- +# gpg export GNUPGHOME="$XDG_DATA_HOME"/gnupg +# pass export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass +# tuir +export MAILCAPS="$XDG_CONFIG_HOME"/tuir/mailcap +# terminfo +export TERMINFO="$XDG_DATA_HOME"/terminfo +export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo + +# Set editor +export EDITOR="nvim" + +# Variables for passphrase2pgp +export REALNAME="DogeyStamp" +export EMAIL="dogeystamp@disroot.org" +export KEYID="48B4FA19F1BC1603C85762514C53B0126F579F36" diff --git a/README.md b/README.md index 1221e7e..e12b84f 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,9 @@ My dotfiles. ## Installation Copy all the folders in here (including hidden ones like .config) to your home directory. -You don't need .git, and you probably don't need my scripts in .local/bin (like mon-on or notification-sound.sh). +You don't need .git, and you probably don't need my scripts in .local/bin. -After, install the programs that I have dots for (you can remove the ones you don't use): - -`pacman -S - < programs` - -Then install the AUR programs in programs-aur using your preferred method. If you don't need picom dual kawase blur, install regular picom instead of picom-git. +After, install the programs that I have dots for. A list is provided in the programs file. You should install [my dwm](https://github.com/dogeystamp/dwm), [dmenu](https://github.com/dogeystamp/dmenu), [slock](https://github.com/dogeystamp/slock) and [st](https://github.com/dogeystamp/st) builds as well as this for a complete desktop environment. diff --git a/programs b/programs index f02b071..a7a53c9 100644 --- a/programs +++ b/programs @@ -4,9 +4,13 @@ dunst zathura zsh zsh-syntax-highlighting +# Unavailable in Gentoo, you need to download from GitHub zsh-autosuggestions xorg-setxkbmap xorg-xrandr xorg-xset xss-lock qutebrowser +# This needs to be the development branch for dual-kawase blur +# Either get picom-git from the AUR or picom-9999 in Gentoo +picom diff --git a/programs-aur b/programs-aur deleted file mode 100644 index c71df78..0000000 --- a/programs-aur +++ /dev/null @@ -1 +0,0 @@ -picom-git