Introduction
Introduction Statistics Contact Development Disclaimer Help
Cleanup, update vim to neovim, improve bin scripts. - dotfiles - These are my d…
Log
Files
Refs
README
---
commit bee752b8d87c5679b3e8af65c68e573c982aecbd
parent 76b0da6317935978f70ad93a5286c8eaf57782b5
Author: Jay Scott <[email protected]>
Date: Sun, 21 Jan 2024 11:03:12 +0000
Cleanup, update vim to neovim, improve bin scripts.
Diffstat:
M .gitignore | 4 +++-
M README | 1 -
D alacritty/alacritty.yml | 40 -----------------------------…
M bashrc | 8 +++++---
M bin/dwmstatus.sh | 25 +++++++++++++++----------
M bin/game_select.sh | 59 ++++++++++++++++++++---------…
M bin/genaccount.sh | 32 +++++++++++++++++++++--------…
M bootstrap.sh | 32 ++++++++++++++++-------------…
M newsraft/config | 2 +-
M newsraft/feeds | 1 +
A nvim/init.lua | 93 +++++++++++++++++++++++++++++…
M pkg/pkglist-repo.txt | 12 +++++++++---
D vimrc | 79 -----------------------------…
13 files changed, 203 insertions(+), 185 deletions(-)
---
diff --git a/.gitignore b/.gitignore
@@ -16,13 +16,15 @@ ncmpcpp/error.log
*.swp
bin/terraform
bin/golangci-lint
+bin/neonmodem
bin/radio
# vim
-vim/bundle
+nvim/lazy-lock.json
# mutt contacts
mutt/aliases
+mutt/cache
# suckless
suckless/dwm/src
diff --git a/README b/README
@@ -7,7 +7,6 @@ Privacy is at the forefront of my mind as such some of my brows…
settings maybe too restrictive for some. I also don't use social media
at all, the closest I come is using IRC.
-
operating sys : archlinux / alpine linux
window manager : dwm
terminal : alacritty
diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml
@@ -1,40 +0,0 @@
-font:
- normal:
- family: Hack
- style: Regular
-
- size: 15
-
-env:
- TERM: xterm-256color
-
-# Colors (Gruvbox dark)
-colors:
- # Default colors
- primary:
- # hard contrast: background = '0x1d2021'
- background: '0x282828'
- # soft contrast: background = '0x32302f'
- foreground: '0xebdbb2'
-
- # Normal colors
- normal:
- black: '0x282828'
- red: '0xcc241d'
- green: '0x98971a'
- yellow: '0xd79921'
- blue: '0x458588'
- magenta: '0xb16286'
- cyan: '0x689d6a'
- white: '0xa89984'
-
- # Bright colors
- bright:
- black: '0x928374'
- red: '0xfb4934'
- green: '0xb8bb26'
- yellow: '0xfabd2f'
- blue: '0x83a598'
- magenta: '0xd3869b'
- cyan: '0x8ec07c'
- white: '0xebdbb2'
diff --git a/bashrc b/bashrc
@@ -24,8 +24,6 @@ export GOPROXY=direct
export PATH=$PATH:$GOPATH/bin:$HOME/bin:$HOME/.local/bin
export PS1="[\[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]] \\$ \[$(tput …
-export BEMENU_OPTS="-p '> ' --tb '#013220' --tf '#ffffff' --hf '#444444'"
-
# terraform config
export TF_CLOUD_ORGANIZATION="jay-scot"
export TF_WORKSPACE="hetzner"
@@ -46,11 +44,15 @@ alias voff='mullvad lockdown-mode set off; mullvad disconne…
alias von='mullvad lockdown-mode set on; mullvad connect'
alias vcheck='curl https://am.i.mullvad.net/connected'
+# neo
+alias vim='nvim'
+alias mutt='neomutt'
+
# git alias
alias ga='git add -A'
alias gs='git status -s'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset…
-alias gd='git diff'
+alias gd='git diff --color=always --word-diff=color | less -RFX'
alias gma='git commit -am'
source ~/.secret
diff --git a/bin/dwmstatus.sh b/bin/dwmstatus.sh
@@ -1,18 +1,23 @@
#!/bin/sh
+get_volume() {
+ pactl list sinks | awk '/Volume:/ {print $5; exit}'
+}
+
+get_vpn_status() {
+ mullvad status
+}
+
while true; do
+ localtime=$(date +"%T")
- localtime=$(date +"%T")
- vol=$(pactl list sinks | tr ' ' '\n' | grep -m1 '%')
- vstatus=$(mullvad status)
+ vol=$(get_volume)
+ [ -z "$vol" ] && vol="N/A"
- if [ "$vstatus" != "Disconnected" ]; then
- vstatus="On"
- else
- vstatus="Off"
- fi
+ vstatus=$(get_vpn_status)
+ [ "$vstatus" != "Disconnected" ] && vstatus="On" || vstatus="Off"
- xsetroot -name " VPN: $vstatus | VOL: $vol | $localtime |"
+ xsetroot -name " VPN: $vstatus | VOL: $vol | $localtime "
- sleep 10
+ sleep 10
done
diff --git a/bin/game_select.sh b/bin/game_select.sh
@@ -1,26 +1,43 @@
#!/bin/sh
-games=$(printf "%s\n" "Stellaris" "Gibbous" "Rimworld" "AtomRPG" "Primordia" "…
+MEDIA_GAMES_DIR=~/media/games
-[ -z "$games" ] && exit 0
+# Define game paths
+stellaris_path=$MEDIA_GAMES_DIR/stellaris/start.sh
+gibbous_path=$MEDIA_GAMES_DIR/gibbous/start.sh
+rimworld_path=$MEDIA_GAMES_DIR/rimworld/start.sh
+atomrpg_path=$MEDIA_GAMES_DIR/atomrpg/start.sh
+primordia_path=$MEDIA_GAMES_DIR/primordia/start.sh
+steam_command=steam
-case "$games" in
-"Steam")
- steam
- ;;
-"Stellaris")
- ~/media/games/stellaris/start.sh
- ;;
-"Gibbous")
- ~/media/games/gibbous/start.sh
- ;;
-"Rimworld")
- ~/media/games/rimworld/start.sh
- ;;
-"AtomRPG")
- ~/media/games/atomrpg/start.sh
- ;;
-"Primordia")
- ~/media/games/primordia/start.sh
- ;;
+# Define game list
+games=("Stellaris" "Gibbous" "Rimworld" "AtomRPG" "Steam")
+
+# Prompt user to choose a game
+selected_game=$(printf "%s\n" "${games[@]}" | dmenu -p "games »")
+
+# Exit if no game selected
+[ -z "$selected_game" ] && exit 0
+
+# Launch the selected game
+case "$selected_game" in
+ "Steam")
+ $steam_command
+ ;;
+ "Stellaris")
+ $stellaris_path
+ ;;
+ "Gibbous")
+ $gibbous_path
+ ;;
+ "Rimworld")
+ $rimworld_path
+ ;;
+ "AtomRPG")
+ $atomrpg_path
+ ;;
+ *)
+ echo "Invalid game selection"
+ exit 1
+ ;;
esac
diff --git a/bin/genaccount.sh b/bin/genaccount.sh
@@ -1,15 +1,27 @@
#!/bin/sh
-# script I use for creating accounts.
+generate_username() {
+ od -An -N3 -x /dev/random | awk '{$1=$1};1' | sed 's/ //g'
+}
-username=$(od -An -N3 -x /dev/random | awk '{$1=$1};1' | sed 's/ //g')
-password=$(
- tr </dev/urandom -dc _A-Z-a-z-0-9 | head -c"${1:-16}"
- echo
-)
+generate_password() {
+ tr </dev/urandom -dc _A-Z-a-z-0-9 | head -c"${1:-16}"
+ echo
+}
-convert -size 200x200 xc:gray +noise random /tmp/avatar.png
+generate_avatar() {
+ convert -size 200x200 xc:gray +noise random /tmp/avatar.png
+}
+
+main() {
+ username=$(generate_username)
+ password=$(generate_password)
+ generate_avatar
+
+ printf "username: %s\n" "$username"
+ printf "password: %s\n" "$password"
+ printf "image : /tmp/avatar.png\n"
+}
+
+main
-echo "username: $username"
-echo "password: $password"
-echo "image : /tmp/avatar.png"
diff --git a/bootstrap.sh b/bootstrap.sh
@@ -2,39 +2,39 @@
DOTFILES=$(pwd)
-FILES='bashrc profile vimrc'
+FILES='bashrc profile'
ROOT='bin'
-CONFIG='alacritty git isync lynx mutt newsraft mpd ncmpcpp qutebrowser X11'
+CONFIG='alacritty git isync lynx mutt newsraft mpd ncmpcpp nvim qutebrowser X1…
link() {
- for f in $FILES; do ln -sfn "$DOTFILES/$f" "$HOME/.$f"; done
- for f in $ROOT; do ln -sfn "$DOTFILES/$f" "$HOME/$f"; done
- for f in $CONFIG; do ln -sfn "$DOTFILES/$f" "$HOME/.config/$f"; done
+ for f in $FILES; do ln -sfn "$DOTFILES/$f" "$HOME/.$f"; done
+ for f in $ROOT; do ln -sfn "$DOTFILES/$f" "$HOME/$f"; done
+ for f in $CONFIG; do ln -sfn "$DOTFILES/$f" "$HOME/.config/$f"; done
}
unlink() {
- for f in $FILES; do unlink "$HOME/.$f"; done
- for f in $ROOT; do unlink "$HOME/$f"; done
- for f in $CONFIG; do unlink "$HOME/.config/$f"; done
+ for f in $FILES; do unlink "$HOME/.$f"; done
+ for f in $ROOT; do unlink "$HOME/$f"; done
+ for f in $CONFIG; do unlink "$HOME/.config/$f"; done
}
backup() {
- pacman -Qqen >pkg/pkglist-repo.txt
- pacman -Qqem >pkg/pkglist-aur.txt
+ pacman -Qqen >pkg/pkglist-repo.txt
+ pacman -Qqem >pkg/pkglist-aur.txt
}
restore() {
- crontab "$DOTFILES/crontab"
+ crontab "$DOTFILES/crontab"
}
testsh() {
- shellcheck -s sh "$DOTFILES"/bin/*.sh
- shfmt -p -w "$DOTFILES"/bin/*.sh
+ shellcheck -s sh "$DOTFILES"/bin/*.sh
+ shfmt -p -w "$DOTFILES"/bin/*.sh
}
-if [ $# -eq 0 ]; then
- echo "No arguments supplied"
- exit 1
+if [ "$#" -eq 0 ]; then
+ printf "No arguments supplied\n" >&2
+ exit 1
fi
$1
diff --git a/newsraft/config b/newsraft/config
@@ -1,5 +1,5 @@
# settings
-set open-in-browser-command /home/jay/bin/link_handler.sh "%l"
+set open-in-browser-command ~/bin/link_handler.sh "%l"
set send-user-agent-header true
set clean-database-on-startup true
diff --git a/newsraft/feeds b/newsraft/feeds
@@ -87,3 +87,4 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCfpCQ89W…
https://www.youtube.com/feeds/videos.xml?channel_id=UCcjx6m03fZwtRBFn1Cf7kKQ "…
https://www.youtube.com/feeds/videos.xml?channel_id=UCKBUeKsqzKWSxp4pahxljBw "…
https://www.youtube.com/feeds/videos.xml?channel_id=UCcKw8Eg0FfRvhIAnC0cPGAA "…
+https://www.youtube.com/feeds/videos.xml?channel_id=UCBhQuxcHU3aydk_zTXcbdTg "…
diff --git a/nvim/init.lua b/nvim/init.lua
@@ -0,0 +1,93 @@
+--- bootstrap
+
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable",
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+
+--- plugins
+
+require("lazy").setup({
+
+ {
+ "ellisonleao/gruvbox.nvim",
+ priority = 1000,
+ config = function ()
+ require("gruvbox").setup({
+ contrast = "hard"
+ })
+ vim.cmd([[colorscheme gruvbox]])
+ end,
+ },
+
+ {
+ "nvim-lualine/lualine.nvim",
+ dependencies = { 'nvim-tree/nvim-web-devicons' },
+ config = function ()
+ require("lualine").setup({
+ options = {
+ theme = 'gruvbox',
+ icons_enabled = false,
+ },
+ sections = {
+ lualine_c = {
+ {
+ 'filename',
+ file_status = true,
+ path = 1
+ }
+ }
+ }
+ })
+ end,
+ },
+
+ {
+ "lewis6991/spaceless.nvim",
+ config = function()
+ require'spaceless'.setup()
+ end
+ }
+
+})
+
+--- settings
+
+vim.opt.termguicolors = true
+vim.opt.number = true
+vim.opt.showmatch = true
+vim.opt.swapfile = false
+vim.opt.ignorecase = true
+vim.o.spelllang = 'en_gb'
+vim.o.spell = true
+vim.o.spelloptions = "camel"
+
+-- show space and tab characters
+vim.o.list = true
+vim.o.listchars = 'tab:› ,eol:¬,trail:⋅,nbsp:␣'
+
+-- map leader to <Space>
+vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })
+vim.g.mapleader = " "
+
+-- format paragraphs
+vim.keymap.set('n', '<leader>f', 'gqap', { noremap = true, silent = true })
+
+-- indent Settings
+vim.opt.expandtab = true
+vim.opt.shiftwidth = 2
+vim.opt.tabstop = 2
+vim.opt.autoindent = true
+vim.opt.wrap = true
+
+
+--- functions
+
diff --git a/pkg/pkglist-repo.txt b/pkg/pkglist-repo.txt
@@ -8,6 +8,7 @@ dhcpcd
docker
docker-compose
efibootmgr
+fzf
gamemode
git
gnu-netcat
@@ -18,10 +19,12 @@ lib32-libpng12
lib32-pipewire
linux
linux-firmware
-lutris
lynx
+mpd
mpv
-mutt
+ncmpcpp
+neomutt
+neovim
noto-fonts-emoji
ntfs-3g
pamixer
@@ -30,6 +33,8 @@ pipewire-alsa
pipewire-pulse
profanity
pulsemixer
+python-adblock
+qutebrowser
rsync
scrot
shfmt
@@ -38,13 +43,14 @@ sudo
terraform
ttf-dejavu
ttf-hack
+ttf-jetbrains-mono-nerd
ttf-liberation
unrar
unzip
-vim
vulkan-radeon
wayland
wine-staging
+xclip
xdg-utils
xf86-video-amdgpu
xorg-server
diff --git a/vimrc b/vimrc
@@ -1,79 +0,0 @@
-" vim-plug autoinstall
-if empty(glob('~/.vim/autoload/plug.vim'))
- silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
- \ https://raw.githubusercontent.com/junegunn/v…
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
-endif
-
-let mapleader = "\<space>"
-
-call plug#begin()
-Plug 'VundleVim/Vundle.vim'
-
-Plug 'morhetz/gruvbox'
- autocmd vimenter * ++nested colorscheme gruvbox
-
-Plug 'maximbaz/lightline-ale'
-
-Plug 'itchyny/lightline.vim'
- let g:lightline = {}
- set laststatus=2
-
- let g:lightline.colorscheme = 'wombat'
- let g:lightline.component_expand = {
- \ 'linter_checking': 'lightline#ale#checking',
- \ 'linter_infos': 'lightline#ale#infos',
- \ 'linter_warnings': 'lightline#ale#warnings',
- \ 'linter_errors': 'lightline#ale#errors',
- \ 'linter_ok': 'lightline#ale#ok',
- \ }
-
- let g:lightline.component_type = {
- \ 'linter_checking': 'right',
- \ 'linter_infos': 'right',
- \ 'linter_warnings': 'warning',
- \ 'linter_errors': 'error',
- \ 'linter_ok': 'right',
- \ }
-
- let g:lightline.active = {
- \ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_war…
- \ [ 'lineinfo' ],
- \ [ 'percent' ],
- \ [ 'fileformat', 'filetype'] ] }
-
-Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
-Plug 'junegunn/fzf.vim'
- map <leader>f :Files!<CR>
- nnoremap <Tab> :Buffers<CR>
-
-Plug 'airblade/vim-gitgutter'
- let g:gitgutter_enabled=1
-
-call plug#end()
-
-filetype plugin indent on
-set background=dark
-set number
-set colorcolumn=80
-highlight ColorColumn ctermbg=red guibg=red
-
-syntax enable
-
-" remove whitespaces
-autocmd BufWritePre * :%s/\s\+$//e
-
-" spell-check the current buffer
-map <leader>s :setlocal spell! spelllang=en_gb<CR>
-augroup my_colours
- autocmd!
- autocmd ColorScheme gruvbox hi SpellBad cterm=reverse
-augroup END
-
-" format paragraph
-map <leader>t :setl comments=fn\:\\|<CR>:setl formatoptions=tcorjq1l<CR>gqip
-
-au BufRead ~/.cache/mutt* set tw=72
-
-map <F7> :N<CR>
-map <F8> :n<CR>
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.