Newly service-based sofi
suckto automatically converts spaces to hyphens in branch names Some ideavimrc tweaks
This commit is contained in:
parent
bcd54ddbf4
commit
246a358a4b
|
@ -0,0 +1,5 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Sofi listing update
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=%h/.sofi.sh --update-listings
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Update sofi listings every 20 minutes
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*:0/20
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
|
@ -27,6 +27,12 @@ autocmd BufWinEnter *.* silent loadview
|
||||||
set viewoptions-=options
|
set viewoptions-=options
|
||||||
set nohlsearch
|
set nohlsearch
|
||||||
|
|
||||||
|
command! DD action CloseAllEditorsButActive
|
||||||
|
command! Dd action CloseAllEditorsButActive
|
||||||
|
|
||||||
|
command! Qa action CloseAllUnmodifiedEditors
|
||||||
|
command! QA action CloseAllUnmodifiedEditors
|
||||||
|
|
||||||
" Save with sudo
|
" Save with sudo
|
||||||
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
||||||
set ideajoin
|
set ideajoin
|
||||||
|
|
|
@ -26,7 +26,7 @@ function slides() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function suckto {
|
function suckto {
|
||||||
local dest_branch="$1"
|
local dest_branch="$(echo "$@" | sed 's/ /-/g')"
|
||||||
changed_files="$(git status --porcelain=v1 2>/dev/null | wc -l)"
|
changed_files="$(git status --porcelain=v1 2>/dev/null | wc -l)"
|
||||||
git suck
|
git suck
|
||||||
git switch -c "$dest_branch"
|
git switch -c "$dest_branch"
|
||||||
|
|
|
@ -55,6 +55,12 @@ windows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
read_apps() {
|
read_apps() {
|
||||||
|
if [[ "$1" == "--now" ]]; then
|
||||||
|
find $APP_LOCATIONS -name '*.desktop' -exec grep '^Name=' {} \; |
|
||||||
|
egrep -iv "$IGNORED_APPS" |
|
||||||
|
sed 's/Name=/app /'
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
cat "$CACHE_FILE"
|
cat "$CACHE_FILE"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
nohup find $APP_LOCATIONS -name '*.desktop' -exec grep '^Name=' {} \; |
|
nohup find $APP_LOCATIONS -name '*.desktop' -exec grep '^Name=' {} \; |
|
||||||
|
@ -69,8 +75,8 @@ read_snap_apps() {
|
||||||
}
|
}
|
||||||
|
|
||||||
apps() {
|
apps() {
|
||||||
read_apps
|
read_apps $1
|
||||||
read_snap_apps
|
read_snap_apps $1
|
||||||
}
|
}
|
||||||
|
|
||||||
RECENTS="$HOME/.sofi-recent"
|
RECENTS="$HOME/.sofi-recent"
|
||||||
|
@ -114,26 +120,28 @@ system_info() {
|
||||||
echo "inf $(date)"
|
echo "inf $(date)"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$1" == "--print-only" ]]; then
|
print-only() {
|
||||||
cat \
|
cat \
|
||||||
<(system_info) \
|
<(system_info) \
|
||||||
<(windows) \
|
<(windows) \
|
||||||
<($HOME/.rofi-list-git-repos.py --no-icon) \
|
<($HOME/.rofi-list-git-repos.py --no-icon) \
|
||||||
<(apps) \
|
<(apps $1) \
|
||||||
<(list_files) \
|
<(list_files) \
|
||||||
$HOME/.emojis
|
$HOME/.emojis
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "--print-only" ]]; then
|
||||||
|
print-only
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$1" == "--update-listings" ]]; then
|
||||||
|
print-only --now > "$HOME/.sofi-listings"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "" ]]; then
|
if [[ "$1" == "" ]]; then
|
||||||
choice="$(cat \
|
choice="$(cat <(recent) "$HOME/.sofi-listings" | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
|
||||||
<(recent) \
|
|
||||||
<(system_info) \
|
|
||||||
<(windows) \
|
|
||||||
<($HOME/.rofi-list-git-repos.py --no-icon) \
|
|
||||||
<(apps) \
|
|
||||||
<(list_files) \
|
|
||||||
"$HOME/.emojis" \
|
|
||||||
| fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
|
|
||||||
else
|
else
|
||||||
choice="$(cat <($1) | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
|
choice="$(cat <($1) | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue