diff --git a/.gitignore b/.gitignore index 0f0acb7..7bc3c59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.swp gui/i3/wallpaper.jpg +passwords/gnupg/.* diff --git a/.gitmodules b/.gitmodules index 2e2a69b..7bc22a0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,18 +32,24 @@ [submodule "vimtex"] path = editors/vim/pack/man/start/vimtex url = https://github.com/lervag/vimtex.git +[submodule "vim-nerdtree-tabs"] + path = editors/vim/pack/man/start/vim-nerdtree-tabs + url = https://github.com/jistr/vim-nerdtree-tabs +[submodule "editors/vim/pack/man/start/vim-typescript"] + path = editors/vim/pack/man/start/vim-typescript + url = https://github.com/leafgarland/typescript-vim.git [submodule "tmux-mem-cpu-load"] path = src/tmux-mem-cpu-load url = https://github.com/thewtex/tmux-mem-cpu-load -[submodule "fzf"] - path = src/fzf - url = https://github.com/junegunn/fzf.git [submodule "vimwiki"] path = editors/vim/pack/man/start/vimwiki url = https://github.com/vimwiki/vimwiki.git [submodule "vim-markdown"] path = editors/vim/pack/man/start/vim-markdown url = https://github.com/preservim/vim-markdown.git +[submodule "fzf"] + path = src/fzf + url = https://github.com/junegunn/fzf.git [submodule "i3lock-blur"] path = src/i3lock-blur url = https://git.keegandeppe.com/kdeppe/i3lock-blur.git diff --git a/arch/base.deps b/arch/base.deps index 39e6809..3f6a9ca 100644 --- a/arch/base.deps +++ b/arch/base.deps @@ -2,3 +2,5 @@ cmake make bat calcurse +pam-gnupg +zfxtop diff --git a/bin/bright.log b/bin/bright.log deleted file mode 100644 index ab8187f..0000000 --- a/bin/bright.log +++ /dev/null @@ -1 +0,0 @@ -14:11:33 LOG diff --git a/bin/calcurse-sync.sh b/bin/calcurse-sync.sh new file mode 100755 index 0000000..ae6e745 --- /dev/null +++ b/bin/calcurse-sync.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# yellow for in progress +polybar-msg action calendar-sync hook 3 1>/dev/null +OUTPUT=$(CALCURSE_CALDAV_PASSWORD=$(pass show cal.keegandeppe.com/kdeppe 2>&1) calcurse-caldav 2>&1) +ERRORS=$(echo "$OUTPUT" | grep error) + +if [ -n "$ERRORS" ] ; then + polybar-msg action calendar-sync hook 2 1>/dev/null + exit 0 +fi + +# success, show green for a few seconds and quit +polybar-msg action calendar-sync hook 1 1>/dev/null +sleep 3 +polybar-msg action calendar-sync hook 0 1>/dev/null +exit 0 diff --git a/bin/i3-scratchpad.sh b/bin/i3-scratchpad.sh new file mode 100755 index 0000000..e697b3a --- /dev/null +++ b/bin/i3-scratchpad.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# checks if instance of arg 1 exists, will show it if it does +exists=$(i3-msg "[instance=$1] scratchpad show" 2>&1 | grep ERROR) +if [ -n "$exists" ] ; then + # creating it then showing + if [ -z "$1" ] ; then + echo "Missing class in arg 1" >&2 + exit 1 + elif [ -z "$2" ] ; then + echo "Missing command to launch application in arg 2" >&2 + exit 1 + fi + + # runs remaining commands and shows + ${@:2} 2>&1 1>/dev/null & + sleep 1 + # lets application load then shows it on scratchpad + i3-msg "[instance=$1] scratchpad show" 1>/dev/null +fi diff --git a/bin/seafile_check b/bin/seafile_check index 3aa134c..0f78b8f 100755 --- a/bin/seafile_check +++ b/bin/seafile_check @@ -7,7 +7,7 @@ SYNC_IN_PROGRESS=$(printf '%s %s' '%{F#FF0}' $(echo -e '\Uf1216')) # yellow SYNC_FAILED=$(printf '%s %s' '%{F#F00}' $(echo -e '\Uf0b98')) # red if ! command -v seaf-cli &>/dev/null ; then - echo "Seafile not downloaded to device!">2 + echo "Seafile not downloaded to device!">&2 echo "$SYNC_FAILED" exit 1 fi @@ -17,8 +17,8 @@ SEAFILE_STATUS=$(seaf-cli status | tail -n +2) ERRORS=$(echo "$SEAFILE_STATUS" | grep "error") if [[ -n "$ERRORS" ]] ; then # some directories have errors - echo "Error: Failed to sync">2 - echo "$ERRORS">2 + echo "Error: Failed to sync">&2 + echo "$ERRORS">&2 echo "$SYNC_FAILED" exit 1 fi @@ -37,5 +37,5 @@ if [[ -z "$IN_PROGRESS" ]] ; then fi # should never get here -echo "UNKNOWN_ERROR!">2 +echo "UNKNOWN_ERROR!">&2 exit 1 diff --git a/bin/ssh_agent_check b/bin/ssh_agent_check index 0161257..823dfd4 100755 --- a/bin/ssh_agent_check +++ b/bin/ssh_agent_check @@ -1,14 +1,26 @@ #!/usr/bin/env bash # checks for agent status and echos to status bar -if [ -S ~/.ssh/ssh_auth_sock ] ; then - # agent active - clr='#[fg=color34]' # green - symb=$(echo -e '\uf00c') + +#ICON=$(echo -e '\Uf08c0') + +if [[ -S ~/.ssh/ssh_auth_sock ]] ; then + ICON=$(echo -e '\uf00c') + if [[ "$1" == "-t" ]] ; then + DEFAULT=' #[default]' + clr='#[fg=color34]' + else + clr='%{F#0F0}' + fi else # agent not active - clr='#[fg=color1]' # red - symb=$(echo -e '\uf00d') + ICON=$(echo -e '\uf00d') + if [[ "$1" == "-t" ]] ; then + DEFAULT=' #[default]' + clr='#[fg=color1]' + else + clr='%{F#F00}' + fi fi -printf 'Agent %s%s #[default]' $clr $symb +printf 'Agent %s%s%s' $clr $ICON "$DEFAULT" diff --git a/bin/todo_display.sh b/bin/todo_display.sh index 1757792..dc9649d 100755 --- a/bin/todo_display.sh +++ b/bin/todo_display.sh @@ -11,18 +11,20 @@ fi source "$calindx" +# increment if [[ "$1" == "inc" ]] ; then ((INDEX+=1)) - if [[ $INDEX -ge ${#todolist[@]} ]] ; then - INDEX=0 # loops - fi +elif [[ "$1" == "dec" ]] ; then + ((INDEX-=1)) fi -if [[ "$1" == "dec" ]] ; then - ((INDEX-=1)) - if [[ $INDEX -lt 0 ]] ; then - INDEX=$((${#todolist[@]}-1)) - fi +# perform checks on the index. Adjusts to dynamic lists +if [[ $INDEX -ge ${#todolist[@]} ]] ; then + INDEX=0 # loops +elif [[ $INDEX -lt 0 ]] ; then + INDEX=$((${#todolist[@]}-1)) fi + +# saves index echo "INDEX=$INDEX" > "$calindx" printf '%s (%d/%d)\n' "${todolist[$INDEX]}" $(($INDEX+1)) ${#todolist[@]} diff --git a/bin/wallpaper.sh b/bin/wallpaper.sh new file mode 100755 index 0000000..9798fc1 --- /dev/null +++ b/bin/wallpaper.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +wallpapers_dir=~/.local/share/wallpapers +finder="rofi-dmenu Wallpaper" + +cd "$wallpapers_dir" + +# fzf selector +if [ "$1" == '-s' ] ; then + # follows links and omits the env file + selection=$(find -L -type f -printf '%P\n' | $finder) + if [ -n "$selection" ] ; then + # didnt exit + feh --bg-scale "$selection" + fi +fi + +# feh slideshow selector +if [ "$1" == '-p' ] ; then + # follows links and omits the env file + # find -L -type f -printf '%P\n' | feh -A "echo '%f';" + echo "BROKEN">&2 + exit 1 +fi diff --git a/editors/vim/pack/man/start/vim-go b/editors/vim/pack/man/start/vim-go index 582ceb4..b8a4108 160000 --- a/editors/vim/pack/man/start/vim-go +++ b/editors/vim/pack/man/start/vim-go @@ -1 +1 @@ -Subproject commit 582ceb4b14d1aaf9b0a52c7f4ede68ea29c85416 +Subproject commit b8a41085bfd67fee97ad075c6df65590ce7417a7 diff --git a/editors/vim/pack/man/start/vim-markdown b/editors/vim/pack/man/start/vim-markdown index df4be86..5d3d1b6 160000 --- a/editors/vim/pack/man/start/vim-markdown +++ b/editors/vim/pack/man/start/vim-markdown @@ -1 +1 @@ -Subproject commit df4be8626e2c5b2a42eb60e1f100fce469b81f7d +Subproject commit 5d3d1b6cbdc4be0b4c6105c1ab1f769d76d3c68f diff --git a/editors/vim/pack/man/start/vim-nerdtree-tabs b/editors/vim/pack/man/start/vim-nerdtree-tabs new file mode 160000 index 0000000..07d19f0 --- /dev/null +++ b/editors/vim/pack/man/start/vim-nerdtree-tabs @@ -0,0 +1 @@ +Subproject commit 07d19f0299762669c6f93fbadb8249da6ba9de62 diff --git a/editors/vim/pack/man/start/vim-typescript b/editors/vim/pack/man/start/vim-typescript new file mode 160000 index 0000000..52f3ca3 --- /dev/null +++ b/editors/vim/pack/man/start/vim-typescript @@ -0,0 +1 @@ +Subproject commit 52f3ca3474d51f5021696ffb7297d989e49121ac diff --git a/editors/vim/pack/man/start/vimtex b/editors/vim/pack/man/start/vimtex index 3a9180f..112e62c 160000 --- a/editors/vim/pack/man/start/vimtex +++ b/editors/vim/pack/man/start/vimtex @@ -1 +1 @@ -Subproject commit 3a9180f1d2cc984fe24bc7afaf9d4d00b3e4c20a +Subproject commit 112e62c1c873fb1910c08ed331f354ae017aac57 diff --git a/editors/vim/vimrc b/editors/vim/vimrc index 6988714..64d96ff 100644 --- a/editors/vim/vimrc +++ b/editors/vim/vimrc @@ -17,8 +17,22 @@ set nocompatible set background=dark syntax enable colorscheme hybrid +" default transparent bg +hi Normal guibg=NONE ctermbg=NONE +let t:is_transparent = 1 +"toggle func +function! ToggleTransparent() + if t:is_transparent == 0 + hi Normal guibg=NONE ctermbg=NONE + let t:is_transparent = 1 + else + set background=dark + let t:is_transparent = 0 + endif +endfunction +nnoremap b : call ToggleTransparent() -" syntax highlighting +" syntax highlighting for go let g:go_highlight_types=1 let g:go_highlight_fields=1 let g:go_highlight_functions=1 @@ -30,6 +44,8 @@ let g:go_highlight_extra_types=1 let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_math = 1 let g:vim_markdown_strikethrough = 1 +let g:vim_markdown_new_list_item_indent = 4 + " use md for vim wiki and disable global linking let g:vimwiki_list = [{'path': '~/vimwiki/', \ 'syntax': 'markdown', 'ext': '.md'}] @@ -44,6 +60,7 @@ let g:airline_powerline_fonts = 1 if !exists('g:airline_symbols') let g:airline_symbols = {} endif + " setting nf symbols let g:airline_symbols.linenr = '' let g:airline_symbols.maxlinenr = '' @@ -52,6 +69,11 @@ let g:airline_symbols.dirty = '' " nerdtree settings let NERDTreeHighlightCursorLine=1 let NERDTreeQuitOnOpen=1 +" nerdtree tab settings +let g:nerdtree_tabs_open_on_console_startup=2 +let g:nerdtree_tabs_autoclose=1 +let g:nerdtree_tabs_smart_startup_focus=1 +"let g:nerd autocmd StdinReadPre * let s:std_in=1 " auto open on empty autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif @@ -60,8 +82,8 @@ autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_ \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif " nerdtree binds -nnoremap n :NERDTree -nnoremap t :NERDTreeMirror:NERDTreeToggle +nnoremap t :NERDTreeMirrorToggle +nnoremap n :NERDTreeFocusToggle " nnoremap :NERDTreeFocus going to conflict with fzf and I dont use " this anyway " diff --git a/gui/i3-thinkpad/wallpaper.jpg b/gui/i3-thinkpad/wallpaper.jpg deleted file mode 120000 index 6394a8d..0000000 --- a/gui/i3-thinkpad/wallpaper.jpg +++ /dev/null @@ -1 +0,0 @@ -/home/spinach/.dotfiles/gui/wallpapers/pine_tree.jpg \ No newline at end of file diff --git a/gui/i3-thinkpad/config b/gui/i3/base.conf similarity index 69% rename from gui/i3-thinkpad/config rename to gui/i3/base.conf index d47bde8..581e95c 100644 --- a/gui/i3-thinkpad/config +++ b/gui/i3/base.conf @@ -1,14 +1,3 @@ -# This file has been auto-generated by i3-config-wizard(1). -# It will not be overwritten, so edit it as you like. -# -# Should you change your keyboard layout some time, delete -# this file and re-run i3-config-wizard(1). -# - -# i3 config file (v4) -# -# Please see https://i3wm.org/docs/userguide.html for a complete reference! - set $mod Mod4 # Font for window titles. Will also be used by the bar unless a different font @@ -23,21 +12,20 @@ smart_gaps on # This font is widely installed, provides lots of unicode glyphs, right-to-left # text rendering and scalability on retina/hidpi displays (thanks to pango). #font pango:DejaVu Sans Mono 8 - # Start XDG autostart .desktop files using dex. See also # https://wiki.archlinux.org/index.php/XDG_Autostart exec --no-startup-id dex --autostart --environment i3 -# The combination of xss-lock, nm-applet and pactl is a popular choice, so -# they are included here as an example. Modify as you see fit. - # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- ~/.local/bin/i3lock-blur --nofork +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-blur --nofork -# NetworkManager is the most popular way to manage wireless networks on Linux, -# and nm-applet is a desktop environment-independent system tray GUI for it. -exec --no-startup-id nm-applet +# auto starting default applications +assign [class="st-256color"] 1 +assign [class="Brave-browser"] 2 + +exec --no-startup-id st -e tmux +exec --no-startup-id brave # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status @@ -49,32 +37,35 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod -# move tiling windows via drag & drop by left-clicking into the title bar, -# or left-clicking anywhere into the window while holding the floating modifier. -#set tiling_drag modifier titlebar - # start a terminal bindsym $mod+Return exec st # lock the screen -bindsym $mod+q exec ~/.local/bin/i3lock-blur +bindsym $mod+q exec xset s activate # kill focused window bindsym $mod+Shift+q kill # start dmenu (a program launcher) -bindsym $mod+d exec --no-startup-id dmenu_run -b -# A more modern dmenu replacement is rofi: -# bindcode $mod+40 exec "rofi -modi drun,run -show drun" -# There also is i3-dmenu-desktop which only displays applications shipping a -# .desktop file. It is a wrapper around dmenu, so you need that installed. -# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop +bindsym $mod+d exec --no-startup-id rofi-launcher + +# setting up a vimscratch pad to use vimwiki +for_window [instance="todo"] move window to scratchpad +for_window [instance="cal"] move window to scratchpad +for_window [instance="spotify"] move window to scratchpad +for_window [instance="wiki"] move window to scratchpad +for_window [instance="scratch"] move window to scratchpad +# bindings +bindsym $mod+s exec i3-scratchpad.sh todo st -n todo -e vim ~/vimwiki/todo/index.md +bindsym $mod+c exec i3-scratchpad.sh cal st -n cal -e calcurse +bindsym $mod+m exec i3-scratchpad.sh spotify spotify +bindsym $mod+w exec i3-scratchpad.sh wiki st -n wiki -e vim ~/vimwiki/index.md # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right # alternatively, you can use the cursor keys: bindsym $mod+Left focus left @@ -83,10 +74,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right # alternatively, you can use the cursor keys: bindsym $mod+Shift+Left move left @@ -95,17 +86,17 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # split in horizontal orientation -bindsym $mod+h split h +#bindsym $mod+h split h # split in vertical orientation -bindsym $mod+v split v +#bindsym $mod+v split v # enter fullscreen mode for the focused container bindsym $mod+f fullscreen toggle # change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed +# bindsym $mod+s layout stacking +# bindsym $mod+w layout tabbed i never use these bindsym $mod+e layout toggle split # toggle tiling / floating @@ -172,10 +163,10 @@ mode "resize" { # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt @@ -191,15 +182,7 @@ mode "resize" { bindsym $mod+r mode "resize" -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -# bar { - #status_command -# } - -exec_always --no-startup-id picom-launch.sh +exec --no-startup-id picom-launch.sh # background -exec_always --no-startup-id feh --bg-scale ~/.config/i3/wallpaper.jpg -# poly bar -exec_always --no-startup-id polybar-launch.sh thinkpad-bar +exec_always --no-startup-id ~/.fehbg diff --git a/gui/i3/desktop.conf b/gui/i3/desktop.conf new file mode 100644 index 0000000..e23ce88 --- /dev/null +++ b/gui/i3/desktop.conf @@ -0,0 +1,8 @@ +include base.conf + +# binding workspaces +workspace 1 output DP-2 +workspace 2 output DP-0 + +# poly bar +exec_always --no-startup-id polybar-launch.sh desktop-bar diff --git a/gui/i3/thinkpad.conf b/gui/i3/thinkpad.conf new file mode 100644 index 0000000..76df62e --- /dev/null +++ b/gui/i3/thinkpad.conf @@ -0,0 +1,3 @@ +include base.conf +# poly bar +exec_always --no-startup-id polybar-launch.sh thinkpad-bar diff --git a/gui/polybar/config.ini b/gui/polybar/config.ini index e68d275..b243389 100644 --- a/gui/polybar/config.ini +++ b/gui/polybar/config.ini @@ -34,10 +34,11 @@ foreground = ${colors.foreground} [bar/thinkpad-bar] ; thinkpad bar conf inherit = section/base-bar -height = 16pt +font-0 = Hack Nerd Font:size=10;2 +height = 14pt ; modules -modules-left = xworkspaces focus weather-thinkpad -modules-right = battery pulseaudio memory cpu wlan seafile date powermenu +modules-left = xworkspaces weather-thinkpad +modules-right = battery pulseaudio memory cpu wlan seafile calendar-sync bg-selector date-tp powermenu [bar/desktop-bar] ; desktop bar config @@ -48,7 +49,7 @@ height = 24pt modules-left = xworkspaces focus spotify spotify-len todo ;modules-left = xworkspaces spotify spotify-len modules-center = weather-desktop -modules-right = pulseaudio memory cpu temperature eth seafile date powermenu +modules-right = pulseaudio memory cpu temperature eth mouse-power seafile calendar-sync bg-selector date powermenu [bar/work-bar] ; desktop bar config @@ -104,9 +105,9 @@ type = custom/script interval = 30 ; left click is forecast -click-left = weather -f +click-left = i3-scratchpad.sh scratch st -n scratch -e weather -f ; middle click is nerdfont forecast -click-middle = weather -pf +click-middle = i3-scratchpad.sh scratch st -n scratch -e weather -pf ; right click is radar click-right = weather -r @@ -126,7 +127,7 @@ type = internal/memory interval = 2 format-prefix = "RAM " format-prefix-foreground = ${colors.primary} -label = %percentage_used%% +label = %used% format =