summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/dot-bash_aliases5
-rw-r--r--dunst/dunst/dunstrc10
-rwxr-xr-xdunst/dunst/set-urgent.sh1
-rw-r--r--feh/feh/buttons5
-rw-r--r--i3/i3/config18
-rwxr-xr-xinstall.sh9
-rw-r--r--nvim/nvim/autoload/plug.vim241
-rw-r--r--nvim/nvim/init.lua2
-rw-r--r--nvim/nvim/lua/git.lua45
-rw-r--r--nvim/nvim/lua/mappings.lua3
-rw-r--r--picom/picom.conf5
-rw-r--r--reminder/reminder/exercise.scm6
-rw-r--r--shepherd/shepherd/init.d/exercise.scm17
-rw-r--r--shepherd/shepherd/init.d/redshift.scm12
-rw-r--r--shepherd/shepherd/init.scm2
-rw-r--r--uninstall.sh9
16 files changed, 279 insertions, 111 deletions
diff --git a/bash/dot-bash_aliases b/bash/dot-bash_aliases
index a76afaa..91956da 100644
--- a/bash/dot-bash_aliases
+++ b/bash/dot-bash_aliases
@@ -33,11 +33,6 @@ function whiteboard {
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
}
-# Pandoc for ElenQ
-alias pandoc-xelatex="pandoc $@ --pdf-engine=xelatex --to latex -N"
-alias elenqdoc-article="pandoc-xelatex $@ --standalone --template elenq-article --metadata=documentclass:article --resource-path=~/.pandoc:."
-alias elenqdoc-book="pandoc-xelatex $@ --standalone --template elenq-book --metadata=documentclass:book --top-level-division=chapter --resource-path=~/.pandoc:."
-
# Open using xdg
alias open="xdg-open $@ &>/dev/null"
diff --git a/dunst/dunst/dunstrc b/dunst/dunst/dunstrc
index 12a0973..12c2b40 100644
--- a/dunst/dunst/dunstrc
+++ b/dunst/dunst/dunstrc
@@ -3,3 +3,13 @@
dmenu = /usr/bin/env dmenu -p dunst
browser = xdg-open
+
+# Hide entries but set urgency hint in app
+[Dino]
+ appname = Dino
+ format = ""
+ script = $HOME/.config/dunst/set-urgent.sh
+[Daily]
+ appname = Daily
+ format = ""
+ script = $HOME/.config/dunst/set-urgent.sh
diff --git a/dunst/dunst/set-urgent.sh b/dunst/dunst/set-urgent.sh
new file mode 100755
index 0000000..02cbbb2
--- /dev/null
+++ b/dunst/dunst/set-urgent.sh
@@ -0,0 +1 @@
+wmctrl -r $1 -b add,demands_attention
diff --git a/feh/feh/buttons b/feh/feh/buttons
new file mode 100644
index 0000000..cdb3824
--- /dev/null
+++ b/feh/feh/buttons
@@ -0,0 +1,5 @@
+# scroll wheel for zoom
+prev_img
+next_img
+zoom_in 4
+zoom_out 5
diff --git a/i3/i3/config b/i3/i3/config
index edabe63..8df7fe8 100644
--- a/i3/i3/config
+++ b/i3/i3/config
@@ -26,6 +26,9 @@ font pango:monospace 10
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
+# Use a compositor for transparent backgrounds and hopefullo no tearing?
+exec --no-startup-id picom -b
+
# 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
@@ -41,6 +44,12 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT
bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness
+# Keyboard led control
+# TODO: toggle
+bindsym XF86KbdLightOnOff exec light -s sysfs/leds/rgb:kbd_backlight -T 0
+bindsym XF86KbdBrightnessDown exec light -s sysfs/leds/rgb:kbd_backlight -U 5
+bindsym XF86KbdBrightnessUp exec light -s sysfs/leds/rgb:kbd_backlight -A 5
+
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
@@ -51,11 +60,11 @@ bindsym $mod+Return exec alacritty
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
-bindsym $mod+d exec dmenu_run
+#bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
-# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
+bindsym $mod+d exec --no-startup-id j4-dmenu-desktop
# change focus
bindsym $mod+h focus left
@@ -214,8 +223,8 @@ bindsym $mod+p move workspace to output right
# 47 is ;(en) ñ(en)
bindcode $mod+47 exec dunstctl close
bindcode $mod+Shift+47 exec dunstctl close-all
+bindcode $mod+Control+Shift+47 exec dunstctl history-clear
bindsym $mod+period exec dunstctl history-pop
-bindsym $mod+Shift+period exec dunstctl history-clear
bindsym $mod+comma exec dunstctl context
@@ -224,3 +233,6 @@ exec --no-startup-id shepherd
# Start dunst
exec --no-startup-id dunst
+
+# Wallpaper
+exec --no-startup-id feh --bg-scale $HOME/Pictures/wallpaper.jpg
diff --git a/install.sh b/install.sh
index b81416a..60889ec 100755
--- a/install.sh
+++ b/install.sh
@@ -38,3 +38,12 @@ stow -Rt $XDG_CONFIG_HOME newsboat
# Sioyek
stow -Rt $XDG_CONFIG_HOME sioyek
+
+# Reminder
+stow -Rt $XDG_CONFIG_HOME reminder
+
+# feh
+stow -Rt $XDG_CONFIG_HOME feh
+
+# picom
+stow -Rt $XDG_CONFIG_HOME picom
diff --git a/nvim/nvim/autoload/plug.vim b/nvim/nvim/autoload/plug.vim
index 652caa8..5c910ca 100644
--- a/nvim/nvim/autoload/plug.vim
+++ b/nvim/nvim/autoload/plug.vim
@@ -1,67 +1,36 @@
" vim-plug: Vim plugin manager
" ============================
"
-" Download plug.vim and put it in ~/.vim/autoload
+" 1. Download plug.vim and put it in 'autoload' directory
"
+" # Vim
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
-" Edit your .vimrc
+" # Neovim
+" sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
+" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
"
-" call plug#begin('~/.vim/plugged')
+" 2. Add a vim-plug section to your ~/.vimrc (or ~/.config/nvim/init.vim for Neovim)
"
-" " Make sure you use single quotes
+" call plug#begin()
"
-" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
-" Plug 'junegunn/vim-easy-align'
+" " List your plugins here
+" Plug 'tpope/vim-sensible'
"
-" " Any valid git URL is allowed
-" Plug 'https://github.com/junegunn/vim-github-dashboard.git'
-"
-" " Multiple Plug commands can be written in a single line using | separators
-" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
-"
-" " On-demand loading
-" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
-" Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
-"
-" " Using a non-default branch
-" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
-"
-" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
-" Plug 'fatih/vim-go', { 'tag': '*' }
-"
-" " Plugin options
-" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
-"
-" " Plugin outside ~/.vim/plugged with post-update hook
-" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
-"
-" " Unmanaged plugin (manually installed and updated)
-" Plug '~/my-prototype-plugin'
-"
-" " Initialize plugin system
" call plug#end()
"
-" Then reload .vimrc and :PlugInstall to install plugins.
-"
-" Plug options:
+" 3. Reload the file or restart Vim, then you can,
"
-"| Option | Description |
-"| ----------------------- | ------------------------------------------------ |
-"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use |
-"| `rtp` | Subdirectory that contains Vim plugin |
-"| `dir` | Custom directory for the plugin |
-"| `as` | Use different name for the plugin |
-"| `do` | Post-update hook (string or funcref) |
-"| `on` | On-demand loading: Commands or `<Plug>`-mappings |
-"| `for` | On-demand loading: File types |
-"| `frozen` | Do not update unless explicitly specified |
+" :PlugInstall to install plugins
+" :PlugUpdate to update plugins
+" :PlugDiff to review the changes from the last update
+" :PlugClean to remove plugins no longer in the list
"
-" More information: https://github.com/junegunn/vim-plug
+" For more information, see https://github.com/junegunn/vim-plug
"
"
-" Copyright (c) 2017 Junegunn Choi
+" Copyright (c) 2024 Junegunn Choi
"
" MIT License
"
@@ -238,7 +207,6 @@ endfunction
function! plug#begin(...)
if a:0 > 0
- let s:plug_home_org = a:1
let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p'))
elseif exists('g:plug_home')
let home = s:path(g:plug_home)
@@ -391,6 +359,9 @@ function! plug#end()
if !empty(types)
augroup filetypedetect
call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim')
+ if has('nvim-0.5.0')
+ call s:source(s:rtp(plug), 'ftdetect/**/*.lua', 'after/ftdetect/**/*.lua')
+ endif
augroup END
endif
for type in types
@@ -438,6 +409,9 @@ endfunction
function! s:load_plugin(spec)
call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim')
+ if has('nvim-0.5.0')
+ call s:source(s:rtp(a:spec), 'plugin/**/*.lua', 'after/plugin/**/*.lua')
+ endif
endfunction
function! s:reload_plugins()
@@ -655,6 +629,9 @@ function! s:lod(names, types, ...)
let rtp = s:rtp(g:plugs[name])
for dir in a:types
call s:source(rtp, dir.'/**/*.vim')
+ if has('nvim-0.5.0') " see neovim#14686
+ call s:source(rtp, dir.'/**/*.lua')
+ endif
endfor
if a:0
if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2))
@@ -806,10 +783,11 @@ endfunction
function! s:syntax()
syntax clear
syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber
- syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX
+ syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX,plugAbort
syn match plugNumber /[0-9]\+[0-9.]*/ contained
syn match plugBracket /[[\]]/ contained
syn match plugX /x/ contained
+ syn match plugAbort /\~/ contained
syn match plugDash /^-\{1}\ /
syn match plugPlus /^+/
syn match plugStar /^*/
@@ -834,6 +812,7 @@ function! s:syntax()
hi def link plug2 Repeat
hi def link plugH2 Type
hi def link plugX Exception
+ hi def link plugAbort Ignore
hi def link plugBracket Structure
hi def link plugNumber Number
@@ -869,7 +848,7 @@ function! s:lastline(msg)
endfunction
function! s:new_window()
- execute get(g:, 'plug_window', 'vertical topleft new')
+ execute get(g:, 'plug_window', '-tabnew')
endfunction
function! s:plug_window_exists()
@@ -931,7 +910,7 @@ function! s:prepare(...)
endif
endfor
- call s:job_abort()
+ call s:job_abort(0)
if s:switch_in()
if b:plug_preview == 1
pc
@@ -967,6 +946,8 @@ function! s:close_pane()
if b:plug_preview == 1
pc
let b:plug_preview = -1
+ elseif exists('s:jobs') && !empty(s:jobs)
+ call s:job_abort(1)
else
bd
endif
@@ -1031,6 +1012,11 @@ function! s:is_updated(dir)
endfunction
function! s:do(pull, force, todo)
+ if has('nvim')
+ " Reset &rtp to invalidate Neovim cache of loaded Lua modules
+ " See https://github.com/junegunn/vim-plug/pull/1157#issuecomment-1809226110
+ let &rtp = &rtp
+ endif
for [name, spec] in items(a:todo)
if !isdirectory(spec.dir)
continue
@@ -1092,12 +1078,14 @@ endfunction
function! s:checkout(spec)
let sha = a:spec.commit
let output = s:git_revision(a:spec.dir)
+ let error = 0
if !empty(output) && !s:hash_match(sha, s:lines(output)[0])
let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : ''
let output = s:system(
\ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir)
+ let error = v:shell_error
endif
- return output
+ return [output, error]
endfunction
function! s:finish(pull)
@@ -1158,7 +1146,7 @@ function! s:update_impl(pull, force, args) abort
let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
\ remove(args, -1) : get(g:, 'plug_threads', 16)
- let managed = filter(copy(g:plugs), 's:is_managed(v:key)')
+ let managed = filter(deepcopy(g:plugs), 's:is_managed(v:key)')
let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') :
\ filter(managed, 'index(args, v:key) >= 0')
@@ -1292,9 +1280,11 @@ function! s:update_finish()
if !pos
continue
endif
+ let out = ''
+ let error = 0
if has_key(spec, 'commit')
call s:log4(name, 'Checking out '.spec.commit)
- let out = s:checkout(spec)
+ let [out, error] = s:checkout(spec)
elseif has_key(spec, 'tag')
let tag = spec.tag
if tag =~ '\*'
@@ -1307,19 +1297,16 @@ function! s:update_finish()
endif
call s:log4(name, 'Checking out '.tag)
let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir)
- else
- let branch = s:git_origin_branch(spec)
- call s:log4(name, 'Merging origin/'.s:esc(branch))
- let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1'
- \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir)
+ let error = v:shell_error
endif
- if !v:shell_error && filereadable(spec.dir.'/.gitmodules') &&
+ if !error && filereadable(spec.dir.'/.gitmodules') &&
\ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir))
call s:log4(name, 'Updating submodules. This may take a while.')
let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir)
+ let error = v:shell_error
endif
let msg = s:format_message(v:shell_error ? 'x': '-', name, out)
- if v:shell_error
+ if error
call add(s:update.errors, name)
call s:regress_bar()
silent execute pos 'd _'
@@ -1343,7 +1330,12 @@ function! s:update_finish()
endif
endfunction
-function! s:job_abort()
+function! s:mark_aborted(name, message)
+ let attrs = { 'running': 0, 'error': 1, 'abort': 1, 'lines': [a:message] }
+ let s:jobs[a:name] = extend(get(s:jobs, a:name, {}), attrs)
+endfunction
+
+function! s:job_abort(cancel)
if (!s:nvim && !s:vim8) || !exists('s:jobs')
return
endif
@@ -1357,8 +1349,18 @@ function! s:job_abort()
if j.new
call s:rm_rf(g:plugs[name].dir)
endif
+ if a:cancel
+ call s:mark_aborted(name, 'Aborted')
+ endif
endfor
- let s:jobs = {}
+
+ if a:cancel
+ for todo in values(s:update.todo)
+ let todo.abort = 1
+ endfor
+ else
+ let s:jobs = {}
+ endif
endfunction
function! s:last_non_empty_line(lines)
@@ -1372,6 +1374,16 @@ function! s:last_non_empty_line(lines)
return ''
endfunction
+function! s:bullet_for(job, ...)
+ if a:job.running
+ return a:job.new ? '+' : '*'
+ endif
+ if get(a:job, 'abort', 0)
+ return '~'
+ endif
+ return a:job.error ? 'x' : get(a:000, 0, '-')
+endfunction
+
function! s:job_out_cb(self, data) abort
let self = a:self
let data = remove(self.lines, -1) . a:data
@@ -1380,9 +1392,10 @@ function! s:job_out_cb(self, data) abort
" To reduce the number of buffer updates
let self.tick = get(self, 'tick', -1) + 1
if !self.running || self.tick % len(s:jobs) == 0
- let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-')
let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines)
- call s:log(bullet, self.name, result)
+ if len(result)
+ call s:log(s:bullet_for(self), self.name, result)
+ endif
endif
endfunction
@@ -1395,7 +1408,7 @@ endfunction
function! s:job_cb(fn, job, ch, data)
if !s:plug_window_exists() " plug window closed
- return s:job_abort()
+ return s:job_abort(0)
endif
call call(a:fn, [a:job, a:data])
endfunction
@@ -1406,16 +1419,17 @@ function! s:nvim_cb(job_id, data, event) dict abort
\ s:job_cb('s:job_exit_cb', self, 0, a:data)
endfunction
-function! s:spawn(name, cmd, opts)
- let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''],
- \ 'new': get(a:opts, 'new', 0) }
+function! s:spawn(name, spec, queue, opts)
+ let job = { 'name': a:name, 'spec': a:spec, 'running': 1, 'error': 0, 'lines': [''],
+ \ 'new': get(a:opts, 'new', 0), 'queue': copy(a:queue) }
+ let Item = remove(job.queue, 0)
+ let argv = type(Item) == s:TYPE.funcref ? call(Item, [a:spec]) : Item
let s:jobs[a:name] = job
if s:nvim
if has_key(a:opts, 'dir')
let job.cwd = a:opts.dir
endif
- let argv = a:cmd
call extend(job, {
\ 'on_stdout': function('s:nvim_cb'),
\ 'on_stderr': function('s:nvim_cb'),
@@ -1431,7 +1445,7 @@ function! s:spawn(name, cmd, opts)
\ 'Invalid arguments (or job table is full)']
endif
elseif s:vim8
- let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})'))
+ let cmd = join(map(copy(argv), 'plug#shellescape(v:val, {"script": 0})'))
if has_key(a:opts, 'dir')
let cmd = s:with_cd(cmd, a:opts.dir, 0)
endif
@@ -1451,27 +1465,33 @@ function! s:spawn(name, cmd, opts)
let job.lines = ['Failed to start job']
endif
else
- let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd]))
+ let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [argv, a:opts.dir] : [argv]))
let job.error = v:shell_error != 0
let job.running = 0
endif
endfunction
function! s:reap(name)
- let job = s:jobs[a:name]
+ let job = remove(s:jobs, a:name)
if job.error
call add(s:update.errors, a:name)
elseif get(job, 'new', 0)
let s:update.new[a:name] = 1
endif
- let s:update.bar .= job.error ? 'x' : '='
- let bullet = job.error ? 'x' : '-'
+ let more = len(get(job, 'queue', []))
let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines)
- call s:log(bullet, a:name, empty(result) ? 'OK' : result)
- call s:bar()
+ if len(result)
+ call s:log(s:bullet_for(job), a:name, result)
+ endif
- call remove(s:jobs, a:name)
+ if !job.error && more
+ let job.spec.queue = job.queue
+ let s:update.todo[a:name] = job.spec
+ else
+ let s:update.bar .= s:bullet_for(job, '=')
+ call s:bar()
+ endif
endfunction
function! s:bar()
@@ -1524,6 +1544,16 @@ function! s:update_vim()
call s:tick()
endfunction
+function! s:checkout_command(spec)
+ let a:spec.branch = s:git_origin_branch(a:spec)
+ return ['git', 'checkout', '-q', a:spec.branch, '--']
+endfunction
+
+function! s:merge_command(spec)
+ let a:spec.branch = s:git_origin_branch(a:spec)
+ return ['git', 'merge', '--ff-only', 'origin/'.a:spec.branch]
+endfunction
+
function! s:tick()
let pull = s:update.pull
let prog = s:progress_opt(s:nvim || s:vim8)
@@ -1538,13 +1568,24 @@ while 1 " Without TCO, Vim stack is bound to explode
let name = keys(s:update.todo)[0]
let spec = remove(s:update.todo, name)
- let new = empty(globpath(spec.dir, '.git', 1))
+ if get(spec, 'abort', 0)
+ call s:mark_aborted(name, 'Skipped')
+ call s:reap(name)
+ continue
+ endif
- call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...')
- redraw
+ let queue = get(spec, 'queue', [])
+ let new = empty(globpath(spec.dir, '.git', 1))
+
+ if empty(queue)
+ call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...')
+ redraw
+ endif
let has_tag = has_key(spec, 'tag')
- if !new
+ if len(queue)
+ call s:spawn(name, spec, queue, { 'dir': spec.dir })
+ elseif !new
let [error, _] = s:git_validate(spec, 0)
if empty(error)
if pull
@@ -1555,7 +1596,11 @@ while 1 " Without TCO, Vim stack is bound to explode
if !empty(prog)
call add(cmd, prog)
endif
- call s:spawn(name, cmd, { 'dir': spec.dir })
+ let queue = [cmd, split('git remote set-head origin -a')]
+ if !has_tag && !has_key(spec, 'commit')
+ call extend(queue, [function('s:checkout_command'), function('s:merge_command')])
+ endif
+ call s:spawn(name, spec, queue, { 'dir': spec.dir })
else
let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 }
endif
@@ -1570,7 +1615,7 @@ while 1 " Without TCO, Vim stack is bound to explode
if !empty(prog)
call add(cmd, prog)
endif
- call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 })
+ call s:spawn(name, spec, [extend(cmd, [spec.uri, s:trim(spec.dir)]), function('s:checkout_command'), function('s:merge_command')], { 'new': 1 })
endif
if !s:jobs[name].running
@@ -2269,7 +2314,10 @@ endfunction
function! s:with_cd(cmd, dir, ...)
let script = a:0 > 0 ? a:1 : 1
- return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd)
+ let pwsh = s:is_powershell(&shell)
+ let cd = s:is_win && !pwsh ? 'cd /d' : 'cd'
+ let sep = pwsh ? ';' : '&&'
+ return printf('%s %s %s %s', cd, plug#shellescape(a:dir, {'script': script, 'shell': &shell}), sep, a:cmd)
endfunction
function! s:system(cmd, ...)
@@ -2346,18 +2394,21 @@ function! s:git_validate(spec, check_branch)
\ current_branch, origin_branch)
endif
if empty(err)
- let [ahead, behind] = split(s:lastline(s:system([
- \ 'git', 'rev-list', '--count', '--left-right',
- \ printf('HEAD...origin/%s', origin_branch)
- \ ], a:spec.dir)), '\t')
- if !v:shell_error && ahead
- if behind
+ let ahead_behind = split(s:lastline(s:system([
+ \ 'git', 'rev-list', '--count', '--left-right',
+ \ printf('HEAD...origin/%s', origin_branch)
+ \ ], a:spec.dir)), '\t')
+ if v:shell_error || len(ahead_behind) != 2
+ let err = "Failed to compare with the origin. The default branch might have changed.\nPlugClean required."
+ else
+ let [ahead, behind] = ahead_behind
+ if ahead && behind
" Only mention PlugClean if diverged, otherwise it's likely to be
" pushable (and probably not that messed up).
let err = printf(
\ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n"
\ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', origin_branch, ahead, behind)
- else
+ elseif ahead
let err = printf("Ahead of origin/%s by %d commit(s).\n"
\ .'Cannot update until local changes are pushed.',
\ origin_branch, ahead)
@@ -2389,7 +2440,7 @@ function! s:clean(force)
let errs = {}
let [cnt, total] = [0, len(g:plugs)]
for [name, spec] in items(g:plugs)
- if !s:is_managed(name)
+ if !s:is_managed(name) || get(spec, 'frozen', 0)
call add(dirs, spec.dir)
else
let [err, clean] = s:git_validate(spec, 1)
@@ -2637,8 +2688,8 @@ function! s:preview_commit()
return
endif
- if exists('g:plug_pwindow') && !s:is_preview_window_open()
- execute g:plug_pwindow
+ if !s:is_preview_window_open()
+ execute get(g:, 'plug_pwindow', 'vertical rightbelow new')
execute 'e' title
else
execute 'pedit' title
diff --git a/nvim/nvim/init.lua b/nvim/nvim/init.lua
index 9428c32..672ea11 100644
--- a/nvim/nvim/init.lua
+++ b/nvim/nvim/init.lua
@@ -7,6 +7,7 @@ vim.fn["plug#begin"]()
Plug("nvim-treesitter/nvim-treesitter")
Plug("julienvincent/nvim-paredit") -- Some paredit commands
Plug("windwp/nvim-autopairs") -- Autobalance parens
+ Plug("lewis6991/gitsigns.nvim")
Plug('luizribeiro/vim-cooklang')
Plug('Mofiqul/dracula.nvim')
Plug("othree/html5.vim")
@@ -157,3 +158,4 @@ require 'mappings'
require 'highlight'
require 'colors'
require 'parens'
+require 'git'
diff --git a/nvim/nvim/lua/git.lua b/nvim/nvim/lua/git.lua
new file mode 100644
index 0000000..95d4931
--- /dev/null
+++ b/nvim/nvim/lua/git.lua
@@ -0,0 +1,45 @@
+local gitsigns = require 'gitsigns'
+gitsigns.setup({
+ on_attach = function(bufnr)
+ local function map(mode, l, r, opts)
+ opts = opts or {}
+ opts.buffer = bufnr
+ vim.keymap.set(mode, l, r, opts)
+ end
+
+ -- Navigation
+ map('n', ']c', function()
+ if vim.wo.diff then
+ vim.cmd.normal({']c', bang = true})
+ else
+ gitsigns.nav_hunk('next')
+ end
+ end)
+
+ map('n', '[c', function()
+ if vim.wo.diff then
+ vim.cmd.normal({'[c', bang = true})
+ else
+ gitsigns.nav_hunk('prev')
+ end
+ end)
+
+ -- Actions
+ map('n', '<leader>hs', gitsigns.stage_hunk)
+ map('n', '<leader>hr', gitsigns.reset_hunk)
+ map('v', '<leader>hs', function() gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
+ map('v', '<leader>hr', function() gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
+ -- map('n', '<leader>hS', gitsigns.stage_buffer)
+ map('n', '<leader>hu', gitsigns.undo_stage_hunk)
+ -- map('n', '<leader>hR', gitsigns.reset_buffer)
+ map('n', '<leader>hp', gitsigns.preview_hunk)
+ map('n', '<leader>hb', function() gitsigns.blame_line{full=true} end)
+ map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
+ map('n', '<leader>hd', gitsigns.diffthis)
+ map('n', '<leader>hD', function() gitsigns.diffthis('~') end)
+ map('n', '<leader>td', gitsigns.toggle_deleted)
+
+ -- Text object
+ map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
+ end
+})
diff --git a/nvim/nvim/lua/mappings.lua b/nvim/nvim/lua/mappings.lua
index 83077f6..d15aa98 100644
--- a/nvim/nvim/lua/mappings.lua
+++ b/nvim/nvim/lua/mappings.lua
@@ -6,7 +6,8 @@ function trimWhiteSpaceVisual()
vim.cmd("'<,'>s/\\s\\+$//")
end
-vim.g.localleader=","
+vim.g.mapleader=","
+vim.g.maplocalleader=","
vim.keymap.set('n', '<F2>', trimWhiteSpace)
vim.keymap.set('v', '<F2>', trimWhiteSpaceVisual)
diff --git a/picom/picom.conf b/picom/picom.conf
new file mode 100644
index 0000000..8a7f4ad
--- /dev/null
+++ b/picom/picom.conf
@@ -0,0 +1,5 @@
+# menu = { shadow = false; };
+dropdown_menu = { shadow = false; };
+popup_menu = { shadow = false; };
+utility = { shadow = false; };
+backend = "glx";
diff --git a/reminder/reminder/exercise.scm b/reminder/reminder/exercise.scm
new file mode 100644
index 0000000..e034a8c
--- /dev/null
+++ b/reminder/reminder/exercise.scm
@@ -0,0 +1,6 @@
+((period 45) ;; In minutes, how much time to period between notifications
+ (title "Crush it!") ;; Notification title (optional)
+ (messages ("Squats x 20" ;; Some text with each message to show
+ "Push-ups x 15" ;; Accepts simple markup like <i> <b>
+ "Pull-ups x 6"
+ "Kettlebell swings x 30")))
diff --git a/shepherd/shepherd/init.d/exercise.scm b/shepherd/shepherd/init.d/exercise.scm
new file mode 100644
index 0000000..2d07053
--- /dev/null
+++ b/shepherd/shepherd/init.d/exercise.scm
@@ -0,0 +1,17 @@
+(define config (or (getenv "XDG_CONFIG_HOME")
+ (string-append (getenv "HOME") "/.config")))
+
+(define exercise
+ (service
+ '(exercise)
+ #:documentation "When you are in the computer, you should pause and do some
+exercise. Dude, come on"
+ #:start (make-forkexec-constructor
+ `("guile" "-e" "(reminder)" "--" "-c"
+ ,(string-append config "/reminder/exercise.scm"))
+ #:log-file (string-append config "/reminder/exercise.log"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t))
+(register-services exercise)
+
+(start-service exercise)
diff --git a/shepherd/shepherd/init.d/redshift.scm b/shepherd/shepherd/init.d/redshift.scm
index d17474f..9694128 100644
--- a/shepherd/shepherd/init.d/redshift.scm
+++ b/shepherd/shepherd/init.d/redshift.scm
@@ -1,9 +1,9 @@
(define redshift
- (make <service>
- #:provides '(redshift)
- #:docstring "Redshift adjusts the color temperature of your screen
- according to your surroundings. This may help your eyes hurt less if you are
- working in front of the screen at night."
+ (service
+ '(redshift)
+ #:documentation "Redshift adjusts the color temperature of your screen
+according to your surroundings. This may help your eyes hurt less if you are
+working in front of the screen at night."
#:start (make-forkexec-constructor '("redshift")
#:log-file (string-append
(or (getenv "XDG_CONFIG_HOME")
@@ -13,4 +13,4 @@
#:respawn? #t))
(register-services redshift)
-(start redshift)
+(start-service redshift)
diff --git a/shepherd/shepherd/init.scm b/shepherd/shepherd/init.scm
index 126684b..ff1fa7f 100644
--- a/shepherd/shepherd/init.scm
+++ b/shepherd/shepherd/init.scm
@@ -10,4 +10,4 @@
(string-suffix? ".scm" file))))
;; Send shepherd into the background
-(action 'shepherd 'daemonize)
+(perform-service-action root-service 'daemonize)
diff --git a/uninstall.sh b/uninstall.sh
index 02f0a5b..2cef81f 100644
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -35,3 +35,12 @@ stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} newsboat
# sioyek
stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} sioyek
+
+# Exercise reminder
+stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} reminder
+
+# feh
+stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} feh
+
+# picom
+stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} feh