Compare commits

...

24 Commits

Author SHA1 Message Date
lelgenio 89a45d70e0 don't show actions indicator 2020-11-19 19:07:28 -03:00
lelgenio 2d3bdb626c add caffeinated 2020-11-19 19:07:07 -03:00
lelgenio 7d0a850d71 syntax changes 2020-11-19 19:06:45 -03:00
lelgenio 79322bbe66 add devtools bindings 2020-11-19 19:04:57 -03:00
lelgenio aaa595d199 don't chekc for aur updates 2020-11-19 17:09:21 -03:00
lelgenio c61a5e857b add caffeine 2020-11-16 18:15:05 -03:00
lelgenio 52127e6e5b update bind 2020-11-16 15:50:41 -03:00
lelgenio b734408012 fix wdmenu arguments 2020-11-16 10:17:10 -03:00
lelgenio c3acd8f092 fix 0 arguments error 2020-11-15 09:38:03 -03:00
lelgenio 4ec086b57d fix terminal quting problem 2020-11-15 03:42:03 -03:00
lelgenio 2b92ee5d00 unbind shif if using alt 2020-11-15 01:45:21 -03:00
lelgenio 79c8405332 overhaul usermode 2020-11-15 00:49:18 -03:00
lelgenio b5d7de7dd9 remove fzf dep 2020-11-14 20:06:40 -03:00
lelgenio 7dbc50c7e7 use find mode 2020-11-14 20:05:59 -03:00
lelgenio 9239ceee5e Revert "use separate scripts for bat and fzf"
This reverts commit 901b06cd69.
2020-11-14 18:51:04 -03:00
lelgenio 5453c44d4a add kakoune 2020-11-14 17:20:35 -03:00
lelgenio 901b06cd69 use separate scripts for bat and fzf 2020-11-14 16:58:18 -03:00
lelgenio e768243ad6 split kakoune config up 2020-11-14 16:53:21 -03:00
lelgenio bb48012963 snippets next placeholder 2020-11-14 14:55:17 -03:00
lelgenio 76a75297de update lsp 2020-11-13 15:32:45 -03:00
lelgenio dd7cf73aa9 add scrolloff 2020-11-13 14:46:03 -03:00
lelgenio 3e511297df minor changes to many files 2020-11-12 16:15:55 -03:00
lelgenio 91fbf010e4 double sleep timeout 2020-11-11 20:21:38 -03:00
lelgenio dd24af6c3c make br use bash, and be easier to read 2020-11-11 20:21:13 -03:00
23 changed files with 397 additions and 286 deletions

View File

@ -9,7 +9,7 @@ variables:
username: lelgenio
mail: disroot.org
cursor_size: 24
launcher: wofi
launcher: bmenu
terminal: kitty
bar: waybar
bar_pos: top
@ -273,8 +273,8 @@ dotfiles: # {{{
src: ./telegram.palette
dst: ~/.local/share/TelegramDesktop/theme.tdesktop-palette
kakoune:
src: kakoune.kak
dst: ~/.config/kak/kakrc
src: kak
dst: ~/.config/kak
# }}}
actions: #{{{
notify: notify-send "Updating dotfiles" "{{@@ _dotfile_abs_dst.lstrip(env['HOME']) @@}}"

View File

@ -3,14 +3,14 @@
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
# env:
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
# TERM: screen-256color
TERM: xterm-256color
#window:
# Window dimensions (changes require restart)

View File

@ -75,7 +75,7 @@ abbr dot "dotdrop install -f"
function edit-config #{{{
pushd "{{@@ parent_dir ( _dotdrop_dotpath ) @@}}"
{{@@ editor @@}} (git ls-files | fzf)
{{@@ editor @@}} (git ls-files | wdmenu)
popd
end
abbr ec edit-config

13
dotfiles/kak/kakrc Normal file
View File

@ -0,0 +1,13 @@
# {{@@ header() @@}}
# _ __ _
# | |/ /__ _| | _____ _ _ _ __ ___
# | ' // _` | |/ / _ \| | | | '_ \ / _ \
# | . \ (_| | < (_) | |_| | | | | __/
# |_|\_\__,_|_|\_\___/ \__,_|_| |_|\___|
source "%val{config}/rc/plug.kak"
source "%val{config}/rc/keys.kak"
source "%val{config}/rc/usermode.kak"
source "%val{config}/rc/hooks.kak"
source "%val{config}/rc/colors.kak"

View File

@ -0,0 +1,88 @@
# {{@@ header() @@}}
# this is not in colors/ because it loads plugins
{%@@ set accent = "rgb:%s" % accent_color.replace('#','') @@%}
{%@@ set bg_light = "rgb:%s" % color.bg_light.replace('#','') @@%}
{%@@ set bg_dark = "rgb:%s" % color.bg_dark.replace('#','') @@%}
{%@@ set nontxt = "rgb:%s" % color.nontxt.replace('#','') @@%}
cursorline
face global crosshairs_line default,{{@@ bg_dark @@}}
# For Code
face global value default
face global type yellow
face global variable default
face global module value
face global function cyan
face global string green
face global keyword {{@@ accent @@}}
face global operator yellow
face global attribute green+b
face global comment {{@@ bg_light @@}}
face global documentation comment
face global meta magenta
face global builtin default+b
# For markup
face global title blue
face global header cyan
face global mono green
face global block magenta
face global link cyan
face global bullet cyan
face global list yellow
# builtin faces
face global Default default,default
face global PrimaryCursor default,{{@@ accent @@}}+fg
face global PrimaryCursorEol PrimaryCursor
face global PrimarySelection white,black+fg
face global SecondaryCursor default,default+rfg
face global SecondaryCursorEol SecondaryCursor
face global SecondarySelection white,black+fg
face global MenuForeground white,{{@@ accent @@}}
face global MenuBackground white,{{@@ bg_dark @@}}
face global MenuInfo cyan
face global Information default,{{@@ bg_dark @@}}
face global Error white,default
face global StatusLine default,{{@@ nontxt @@}}
face global StatusLineMode green,{{@@ nontxt @@}}
face global StatusLineInfo default,{{@@ nontxt @@}}
face global StatusLineValue default,{{@@ nontxt @@}}
face global StatusCursor default,{{@@ accent @@}}
face global Prompt yellow,default
face global MatchingChar default,default+b
# Goodies
add-highlighter global/ number-lines -relative -hlcursor
face global LineNumbers {{@@ bg_light @@}},default
face global LineNumberCursor white,{{@@ bg_dark @@}}
add-highlighter global/ show-whitespaces
face global Whitespace {{@@ nontxt @@}},default+f
face global BufferPadding {{@@ nontxt @@}},default
# highlight trailing whitespace
add-highlighter global/ regex '\h*$' 0:red,red+g
# Lsp
{%@@ for obj, col in {
'Error': 'red',
'Warning': 'yellow',
'Hint': 'blue',
}.items() @@%}
face global HighlightDiagnostic{{@@ obj @@}} {{@@ col @@}},default+bu
face global Diagnostic{{@@ obj @@}} {{@@ col @@}},default+b
face global TextDiagnostic{{@@ obj @@}} {{@@ col @@}},default+b
face global InlayDiagnostic{{@@ obj @@}} {{@@ col @@}},default+bu
{%@@ endfor @@%}
face global Reference yellow,default+b

40
dotfiles/kak/rc/hooks.kak Normal file
View File

@ -0,0 +1,40 @@
# {{@@ header() @@}}
# not exactly hooks but ok
set global tabstop 4
set global scrolloff 8,8
# use spaces insted of tabs
hook global InsertChar \t %{ exec -draft -itersel h@ } -group kakrc-replace-tabs-with-spaces
hook global NormalIdle .* %{ try %{
lsp-highlight-references
git show-diff
palette-status
} }
hook global BufOpenFile .* %{
modeline-parse
lsp-enable
}
hook global WinCreate .* %{
manual-indent-enable
}
#completion with tab
hook global InsertCompletionShow .* %{ try %{
execute-keys -draft 'h<a-K>\h<ret>'
map window insert <tab> <c-n>
map window insert <s-tab> <c-p>
} }
hook global InsertCompletionHide .* %{
unmap window insert <tab> <c-n>
unmap window insert <s-tab> <c-p>
}
hook global RegisterModified '"' %{ nop %sh{
printf %s "$kak_main_reg_dquote" | wl-copy > /dev/null 2>&1 &
}}

42
dotfiles/kak/rc/keys.kak Normal file
View File

@ -0,0 +1,42 @@
# {{@@ header() @@}}
{%@@ for old, new, gdoc, vdoc in [
[ "h", key.left, "line begin", "scroll left" ],
[ "l", key.right, "line right", "scroll right" ],
[ "k", key.up, "buffer begin", "scroll up" ],
[ "j", key.down, "buffer end", "scroll down" ],
[ "i", key.insertMode, "first non blank", "" ],
[ "n", key.next, "", "" ],
[ "o", "h", "", "" ],
] @@%}
{%@@ set NEW, OLD = new.upper(), old.upper()@@%}
{%@@ if vdoc @@%}
map global view {{@@ old @@}} ''
map global view {{@@ new @@}} {{@@ old @@}} -docstring "{{@@ vdoc @@}}"
{%@@ endif @@%}
{%@@ if gdoc @@%}
map global goto {{@@ old @@}} ''
map global goto {{@@ new @@}} {{@@ old @@}} -docstring "{{@@ gdoc @@}}"
{%@@ endif @@%}
map global normal {{@@ new @@}} {{@@ old @@}}
map global normal {{@@ NEW @@}} {{@@ OLD @@}}
map global normal <a-{{@@ new @@}}> <a-{{@@ old @@}}>
map global normal <a-{{@@ NEW @@}}> <a-{{@@ OLD @@}}>
{%@@ endfor @@%}
{%@@ for old, new in {
"j": key.down,
"k": key.up,
}.items() @@%}
map global normal <a-{{@@ new @@}}> 10{{@@ old @@}}
map global normal <a-{{@@ new.upper() @@}}> 10{{@@ old.upper() @@}}
{%@@ endfor @@%}
{%@@ if key.layout == 'colemak' @@%}
map global normal k s
map global normal K S
map global normal <c-k> <a-s>
map global normal t e
{%@@ endif @@%}

28
dotfiles/kak/rc/plug.kak Normal file
View File

@ -0,0 +1,28 @@
# {{@@ header() @@}}
source "%val{config}/plugins/plug.kak/rc/plug.kak"
{%@@ for p in [ 'prelude', 'auto-pairs', 'manual-indent' ] @@%}
plug 'alexherbo2/{{@@ p @@}}.kak'
require-module '{{@@ p @@}}'
{%@@ endfor @@%}
auto-pairs-enable
plug 'h-youhei/kakoune-surround'
plug 'delapouite/kakoune-palette'
plug 'insipx/kak-crosshairs'
plug "kak-lsp/kak-lsp" do %{
cargo install --locked --force --path .
}
def -hidden complete-snippets %{
try %{
lsp-snippets-select-next-placeholders
# exec '<a-;>d'
} catch %{
exec -with-hooks '<c-n>'
}
}
map global insert <c-e> "<a-;>: complete-snippets<ret>"

View File

@ -0,0 +1,79 @@
# {{@@ header() @@}}
map global user 'g' ': enter-user-mode lsp<ret>' -docstring 'lsp mode'
map global user 'z' ':zoxide ' -docstring 'zoxide'
map global user 'c' ': comment-line<ret>' -docstring 'comment line'
map global user 'C' ': comment-block<ret>' -docstring 'comment block'
map global user 'p' '<a-!> wl-paste -n <ret>' -docstring 'clipboard paste'
map global user 'P' '! wl-paste -n <ret>' -docstring 'clipboard paste before'
declare-user-mode surround
map global user 's' ': enter-user-mode surround<ret>' -docstring 'surround mode'
map global surround 's' ': surround<ret>' -docstring 'surround'
map global surround 'c' ': change-surround<ret>' -docstring 'change'
map global surround 'd' ': delete-surround<ret>' -docstring 'delete'
map global surround 't' ': surround-with-tag<ret>' -docstring 'surround with tag'
map global surround 'g' ': select-surrounding-tag<ret>' -docstring 'select tag'
declare-user-mode git
map global user 'v' ': enter-user-mode git<ret>' -docstring 'git vcs mode'
map global git 's' ': git status<ret>' -docstring 'status'
map global git 'a' ': git add<ret>' -docstring 'add current'
map global git 'd' ': git diff %reg{%}<ret>' -docstring 'diff current'
map global git 'r' ': git restore %reg{%}<ret>' -docstring 'restore current'
map global git 'A' ': git add --all<ret>' -docstring 'add all'
map global git 'D' ': git diff<ret>' -docstring 'diff all'
map global git '<a-d>' ': git diff --staged<ret>' -docstring 'diff staged'
map global git 'c' ': git commit -v<ret>' -docstring 'commit'
declare-user-mode find
map global user 'f' ': enter-user-mode find<ret>' -docstring 'find mode'
map global find 'f' ': find_file<ret>' -docstring 'file'
map global find 'r' ': find_ripgrep<ret>' -docstring 'ripgrep all file'
map global find 'g' ': find_git_file<ret>' -docstring 'git files'
map global find 'c' ': find_dir<ret>' -docstring 'change dir'
map global find 'b' ': find_buffer<ret>' -docstring 'find buffer'
map global find 'd' ': find_delete<ret>' -docstring 'file to delete'
define-command -hidden find_file \
%{ edit -existing %sh{
test "$PWD" -ne "$HOME" && args="-H"
fd -tf "$args" | sed "/.git\//d" | wdmenu
} }
define-command -hidden find_delete \
%{ nop %sh{
test "$PWD" -ne "$HOME" && args="-H"
fd -tf "$args" | sed "/.git\//d" | wdmenu | xargs trash
} }
define-command -hidden find_git_file \
%{ edit -existing %sh{ git ls-files | wdmenu } }
define-command -hidden find_dir \
%{ cd %sh{ fd -Htd | wdmenu } }
define-command -hidden find_buffer \
%{ buffer %sh{
printf "%s\n" $kak_buflist | wdmenu
} }
define-command -hidden find_ripgrep \
%{ eval %sh{
patter=$( wdmenu -p "Regex")
rg --column -n "$patter" | wdmenu |
perl -ne 'print "edit \"$1\" \"$2\" \"$3\" " if /(.+):(\d+):(\d+):/'
} }
define-command -params .. \
-shell-script-candidates 'zoxide query -l' \
zoxide \
%{
cd %sh{ zoxide query "$@" }
echo %sh{ pwd | sed "s|$HOME|~|" }
}

View File

@ -1,222 +0,0 @@
#plugins
source "%val{config}/plugins/plug.kak/rc/plug.kak"
{%@@ for p in [ 'prelude', 'auto-pairs', 'manual-indent' ] @@%}
plug 'alexherbo2/{{@@ p @@}}.kak'
require-module '{{@@ p @@}}'
{%@@ endfor @@%}
auto-pairs-enable
# Manual indent
hook global WinCreate .* %{
manual-indent-enable
}
plug 'h-youhei/kakoune-surround'
plug 'insipx/kak-crosshairs'
plug 'delapouite/kakoune-palette'
plug "andreyorst/fzf.kak"
plug "kak-lsp/kak-lsp" do %{
cargo install --locked --force --path .
}
#syntax
set global tabstop 4
#keys
{%@@ for old, new, gdoc, vdoc in [
[ "h", key.left, "line begin", "scroll left" ],
[ "l", key.right, "line right", "scroll right" ],
[ "k", key.up, "buffer begin", "scroll up" ],
[ "j", key.down, "buffer end", "scroll down" ],
[ "i", key.insertMode, "first non blank", "" ],
[ "n", key.next, "", "" ],
[ "o", "h", "", "" ],
] @@%}
{%@@ set NEW, OLD = new.upper(), old.upper()@@%}
{%@@ if vdoc @@%}
map global view {{@@ old @@}} ''
map global view {{@@ new @@}} {{@@ old @@}} -docstring "{{@@ vdoc @@}}"
{%@@ endif @@%}
{%@@ if gdoc @@%}
map global goto {{@@ old @@}} ''
map global goto {{@@ new @@}} {{@@ old @@}} -docstring "{{@@ gdoc @@}}"
{%@@ endif @@%}
map global normal {{@@ new @@}} {{@@ old @@}}
map global normal {{@@ NEW @@}} {{@@ OLD @@}}
map global normal <a-{{@@ new @@}}> <a-{{@@ old @@}}>
map global normal <a-{{@@ NEW @@}}> <a-{{@@ OLD @@}}>
{%@@ endfor @@%}
{%@@ for old, new in {
"j": key.down,
"k": key.up,
}.items() @@%}
map global normal <a-{{@@ new @@}}> 10{{@@ old @@}}
map global normal <a-{{@@ new.upper() @@}}> 10{{@@ old.upper() @@}}
{%@@ endfor @@%}
{%@@ if key.layout == 'colemak' @@%}
map global normal k s
map global normal K S
map global normal <c-k> <a-s>
map global normal t e
{%@@ endif @@%}
#usermode
map global user 'f' ': fzf-mode<ret>' -docstring 'fzf mode'
map global user 'g' ': enter-user-mode lsp<ret>' -docstring 'lsp mode'
map global user 'c' ': comment-line<ret>' -docstring 'comment line'
map global user 'C' ': comment-block<ret>' -docstring 'comment block'
map global user 'p' '<a-!> wl-paste -n <ret>' -docstring 'clipboard paste'
map global user 'P' '! wl-paste -n <ret>' -docstring 'clipboard paste before'
declare-user-mode surround
map global surround 's' ': surround<ret>' -docstring 'surround'
map global surround 'c' ': change-surround<ret>' -docstring 'change'
map global surround 'd' ': delete-surround<ret>' -docstring 'delete'
map global surround 't' ': select-surrounding-tag<ret>' -docstring 'select tag'
map global user 's' ': enter-user-mode surround<ret>' -docstring 'surround mode'
declare-user-mode git
map global git 's' ': git status<ret>' -docstring 'status'
map global git 'a' ': git add<ret>' -docstring 'add current'
map global git 'A' ': git add .<ret>' -docstring 'add'
map global git 'd' ': git diff %reg{%}<ret>' -docstring 'diff current'
map global git 'D' ': git diff<ret>' -docstring 'diff'
map global git '<a-d>' ': git diff --staged<ret>' -docstring 'diff staged'
map global git 'c' ': git commit -v<ret>' -docstring 'commit'
map global user 'v' ': enter-user-mode git<ret>' -docstring 'git vcs mode'
# map global insert <s-tab> '<a-;><lt>'
#hooks
#completion with tab
hook global InsertCompletionShow .* %{ try %{
execute-keys -draft 'h<a-K>\h<ret>'
map window insert <tab> <c-n>
map window insert <s-tab> <c-p>
} }
hook global InsertCompletionHide .* %{
unmap window insert <tab> <c-n>
unmap window insert <s-tab> <c-p>
}
hook global RegisterModified '"' %{ nop %sh{
printf %s "$kak_main_reg_dquote" | wl-copy > /dev/null 2>&1 &
}}
hook global NormalIdle .* %{ try %{
git show-diff
palette-status
} }
hook global BufOpenFile .* %{
modeline-parse
}
# use spaces insted of tabs
hook global InsertChar \t %{ exec -draft -itersel h@ } -group kakrc-replace-tabs-with-spaces
add-highlighter global/ number-lines -relative -hlcursor
add-highlighter global/ show-whitespaces
#color
{%@@ set accent = "rgb:%s" % accent_color.replace('#','') @@%}
{%@@ set bg_light = "rgb:%s" % color.bg_light.replace('#','') @@%}
{%@@ set bg_dark = "rgb:%s" % color.bg_dark.replace('#','') @@%}
{%@@ set nontxt = "rgb:%s" % color.nontxt.replace('#','') @@%}
# For Code
face global value default
face global type yellow
face global variable default
face global module value
face global function cyan
face global string green
face global keyword {{@@ accent @@}}
face global operator yellow
face global attribute green+b
face global comment {{@@ bg_light @@}}
face global documentation comment
face global meta magenta
face global builtin default+b
# For markup
face global title blue
face global header cyan
face global mono green
face global block magenta
face global link cyan
face global bullet cyan
face global list yellow
# builtin faces
face global Default default,default
cursorline
face global crosshairs_line default,{{@@ bg_dark @@}}
face global PrimaryCursor default,{{@@ accent @@}}+fg
face global PrimaryCursorEol PrimaryCursor
face global PrimarySelection white,black+fg
face global SecondaryCursor default,default+rfg
face global SecondaryCursorEol SecondaryCursor
face global SecondarySelection white,black+fg
face global LineNumbers {{@@ bg_light @@}},default
face global LineNumberCursor white,{{@@ bg_dark @@}}
face global MenuForeground white,{{@@ accent @@}}
face global MenuBackground white,{{@@ bg_dark @@}}
face global MenuInfo cyan
face global Information default,{{@@ bg_dark @@}}
face global Error white,default
face global StatusLine default,{{@@ nontxt @@}}
face global StatusLineMode green,{{@@ nontxt @@}}
face global StatusLineInfo default,{{@@ nontxt @@}}
face global StatusLineValue default,{{@@ nontxt @@}}
face global StatusCursor default,{{@@ accent @@}}
face global Prompt yellow,default
face global MatchingChar default,default+b
face global Whitespace {{@@ nontxt @@}},default+f
face global BufferPadding blue,default
# highlight trailing whitespace
add-highlighter global/ regex '\h*$' 0:red,red+g
#lsp
{%@@ set cols = {
'Error': 'red',
'Warning': 'yellow',
'Hint': 'blue',
} @@%}
#{%@@ for obj, col in cols.items() @@%}#
face global HighlightDiagnostic{{@@ obj @@}} {{@@ col @@}},default+bu
face global Diagnostic{{@@ obj @@}} {{@@ col @@}},default+b
face global TextDiagnostic{{@@ obj @@}} {{@@ col @@}},default+b
face global InlayDiagnostic{{@@ obj @@}} {{@@ col @@}},default+bu
#{%@@ endfor @@%}#
lsp-enable
lsp-inlay-diagnostics-enable global
face global Reference yellow,default+b

View File

@ -194,8 +194,8 @@ c.colors.tabs.odd.fg = color.txt
c.colors.tabs.even.bg = color.bg
c.colors.tabs.odd.bg = color.bg
c.colors.tabs.selected.even.fg = color.bg
c.colors.tabs.selected.odd.fg = color.bg
c.colors.tabs.selected.even.fg = color.txt
c.colors.tabs.selected.odd.fg = color.txt
c.colors.tabs.selected.even.bg = color.accent
c.colors.tabs.selected.odd.bg = color.accent
@ -265,6 +265,14 @@ class key:
next = "{{@@ key.next @@}}"
def edbind(k, v):
if editor == "kak":
config.bind("<Alt-{}>".format(k), v)
config.bind(k.upper(), "nop")
else:
config.bind(k.upper(), v)
config.bind(",d", "spawn --verbose youtube-dl -fbest[ext=mp4] {url}")
config.bind(",m", "spawn --userscript view_in_mpv")
config.bind(",r", "spawn --userscript readability")
@ -280,10 +288,7 @@ for k, v in {
"T": "hint all tab",
"H": "set-cmd-text -s :open -t",
}.items():
if editor == "kak":
config.bind("<Alt-{}>".format(k), v)
else:
config.bind(k.upper(), v)
edbind(k, v)
# {%@@ endif @@%}
@ -306,10 +311,7 @@ for k, v in {
key.tabL: "tab-prev",
key.tabR: "tab-next",
}.items():
if editor == "kak":
config.bind("<Alt-{}>".format(k), v)
else:
config.bind(k.upper(), v)
edbind(k, v)
# Bindings for caret mode
config.bind(key.left, "move-to-prev-char", mode="caret")
@ -317,6 +319,19 @@ config.bind(key.up, "move-to-prev-line", mode="caret")
config.bind(key.down, "move-to-next-line", mode="caret")
config.bind(key.right, "move-to-next-char", mode="caret")
# devtools
config.unbind("wIh")
config.unbind("wIj")
config.unbind("wIk")
config.unbind("wIl")
config.bind("wIf", "devtools-focus")
config.bind("wIw", "devtools window")
config.bind("wI" + key.left, "devtools left")
config.bind("wI" + key.down, "devtools bottom")
config.bind("wI" + key.up, "devtools top")
config.bind("wI" + key.right, "devtools right")
# }}}
# vim: fdm=marker

View File

@ -1,11 +1,21 @@
#!/bin/sh
#!/bin/bash
# Copyright Cédric Picard 2014 -- License WTFPL
# Inspired by Ranger's -- See https://github.com/hut/ranger
#
# Code shuffled around by Leonardo Eugênio 2020
set -e -u
end(){
rm -r -- "$(dirname -- "${namebase}")"
[ $# -ne 0 ] && echo $@ >&2
exit $#
}
if [ $# -ne 0 ] ; then
{ for i in "$@" ; do printf "%s\n" "$i" ; done } | "$0"
for i in "$@" ; do
printf "%s\n" "$i"
done | "$0"
exit $?
fi
@ -15,28 +25,23 @@ namebase="$(mktemp -d)/blkrn"
echo '# Modify filenames without removing any line, quitting aborts' \
> "${namebase}.2"
tee -- "${namebase}.1" >> "${namebase}.2"
exec </dev/tty >/dev/tty \
|| { echo 'Interactive terminal needed' >&2 ; exit 1; }
exec </dev/tty >/dev/tty ||
end 'Interactive terminal needed'
"$EDITOR" "${namebase}.2"
"$EDITOR" -- "${namebase}.2"
sed -i -- '1d' "${namebase}.2"
if [ $(wc -l < "${namebase}.1") -ne $(wc -l < "${namebase}.2") ] ; then
rm -r -- "$(dirname -- "${namebase}")"
echo "Wrong number of lines" >&2 ; exit 1
fi
! diff -- "${namebase}.1" "${namebase}.2" &> /dev/null || end "no changes"
[ `wc -l < "${namebase}.1"` -eq `wc -l < "${namebase}.2"` ] || end "Wrong number of lines"
(echo '# Please review/modify this script or empty it to do nothing' \
; while read -r l1 <&3 && read -r l2 <&4; do
[ "$l1" = "$l2" ] || printf "%s\n%s\n" "$l1" "$l2"
done 3<"${namebase}.1" 4<"${namebase}.2" \
| sed 's/\([\\"$`]\)/\\\1/g;s/^.*$/"&"/' \
| xargs -d"\n" -L2 echo 'mv -i --') \
> "${namebase}.sh"
{
echo '# Please review/modify this script or empty it to do nothing'
while read -r l1 <&3 && read -r l2 <&4; do
[ "$l1" = "$l2" ] || printf "mv -Ti -- %q %q\n" "$l1" "$l2"
done 3<"${namebase}.1" 4<"${namebase}.2"
} > "${namebase}.sh"
if [ "$(wc -c < "${namebase}.sh")" -ne 0 ] ; then
"$EDITOR" -- "${namebase}.sh"
sh -e -- "${namebase}.sh"
fi
"$EDITOR" -- "${namebase}.sh"
sh -e -- "${namebase}.sh"
rm -r -- "$(dirname "${namebase}")"
end # exit normaly

View File

@ -36,18 +36,19 @@ delete(){
}
usage(){
cmdname=$(basename "$0")
echo "Commands: "
echo " $0 search -- searches the current playlist for songs and plays it"
echo " $0 delete -- prompts to delete the current song"
echo " $cmdname search -- Searches the current playlist for songs and plays it."
echo " $cmdname delete -- Prompts to delete the current song."
}
if [ "$1" = "delete" ]
then
delete
elif [ "$1" = "search" ]
then
search
else
usage
search
fi
case "$1" in
delete)
delete ;;
search)
search ;;
*)
usage
search
;;
esac

View File

@ -1,7 +1,7 @@
#!/bin/sh
opts="Fone\nSpeaker\nHDMI"
out=$(printf $opts | wdmenu -p "Saida:")
out=$(printf $opts | wdmenu -p "Output")
vol=$(pamixer --get-volume)
if [ "$out" = "HDMI" ]

View File

@ -1,15 +1,19 @@
#!/bin/sh
test $# -gt 0 &&
cmd="$1" &&
shift
# {%@@ if terminal == "alacritty" @@%} #
command -v alacritty > /dev/null &&
{
test "$#" -gt "0" &&
exec alacritty -e $@ ||
exec alacritty -e "$cmd $@" ||
exec alacritty
} & exit
# {%@@ else @@%} #
command -v kitty > /dev/null &&
exec kitty $@
exec kitty $cmd "$@"
# {%@@ endif @@%} #
notify-send "Error" "Terminal program missing"

View File

@ -4,10 +4,10 @@ test -n "$SWAYSOCK" && swaymsg fullscreen off > /dev/null
# {%@@ if launcher == "wofi" @@%} #
which wofi &> /dev/null &&
exec wofi -d $argv
exec wofi -d $@
# {%@@ else @@%} #
which bemenu &> /dev/null &&
exec bmenu $argv
exec bmenu $@
# {%@@ endif @@%} #
notify-send "Error" "Launcher program missing"

View File

@ -25,7 +25,7 @@ main() {
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
entry=`printf '%s\n' "${password_files[@]}" | "$dmenu" -p Password $@`
entry=`printf '%s\n' "${password_files[@]}" | "$dmenu" -p "Password" $@`
[ -n "$entry" ] || exit

View File

@ -379,7 +379,7 @@ bindsym $mod+escape mode Passthrough
exec swayidle -w \
before-sleep '$lock' \
after-resume '$screenReload' \
timeout 180 '$lock' \
timeout 360 '$lock' \
resume '$screenReload' \
timeout 1800 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on";$screenReload' \
@ -389,4 +389,4 @@ bindsym $mod+escape mode Passthrough
include /etc/sway/config.d/
#}}}
# vim:filetype=i3config:foldmethod=marker
# vim:filetype=sh:foldmethod=marker

View File

@ -22,3 +22,6 @@ set -g pane-active-border-style "fg=#cc5757 bg=default"
set -g status-bg default
set -g status off
set -g default-terminal "xterm-256color"
set -g terminal-overrides ",xterm-256color:Tc"

View File

@ -19,6 +19,7 @@
"custom/torrentD",
"custom/torrentS",
"custom/updates",
"custom/caffeine",
"pulseaudio",
"network",
"battery"
@ -121,8 +122,8 @@
"format": "{} ",
"interval": 60,
"exec-if":"sleep 60s",
"exec": "yay -Qqu | wc -l | sed 's/^0$//'",
"on-click": "terminal sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su; pkill -SIGRTMIN+8 waybar; read'",
"exec": "pacman -Qqu | wc -l | sed 's/^0$//'",
"on-click": "terminal sh -c 'ping -qc1 archlinux.org >/dev/null && pacman -Syu || pacman -Su; pkill -SIGRTMIN+8 waybar; read'",
"signal": 8
},
"custom/recording": {
@ -149,8 +150,13 @@
"exec":"transmission-remote -l | grep Seeding| wc -l | sed 's/^0$//'",
"exec-if":"pidof transmission-daemon",
"interval":180
}
},
"custom/caffeine":{
"format":"{} ",
"exec":"pidof caffeinated &>/dev/null &&echo  ||echo 鈴",
"on-click":"pidof caffeinated &&pkill caffeinated||caffeinated -d ",
"interval": 1
},
}
// vim:ft=json

View File

@ -78,7 +78,8 @@ window#waybar.empty {
#custom-updates,
#custom-weather,
#custom-torrentD,
#custom-torrentS
#custom-torrentS,
#custom-caffeine
{
margin: 0 7px;
color: {{@@ color.txt @@}};
@ -95,7 +96,8 @@ window#waybar.empty {
font-size: {{@@ font.size.big @@}}px;
}
#network,
#pulseaudio
#pulseaudio,
#custom-caffeine
{
margin-top:-1px;
font-size:16px;
@ -118,3 +120,8 @@ window#waybar.empty {
font-size: 0;
border: none;
}
#tray {
padding: 0;
margin: 0;
}

View File

@ -2,6 +2,7 @@ show=drun
prompt=Iniciar:
allow_images=true
allow_markup=true
no-actions=true
term=terminal
insensitive=true
width=800

View File

@ -19,7 +19,7 @@ depends=(
bemenu-wlroots j4-dmenu-desktop
# Utility
ruby-fusuma light mako kanshi udiskie redshift-wayland-git
ydotool wtype
ydotool wtype caffeinated
# Configuration manager
dotdrop
@ -84,6 +84,7 @@ depends=(
libreoffice-fresh libreoffice-fresh-pt-br hunspell-pt-br papirus-libreoffice-theme
# Programing
kakoune kak-lsp
neovim python-pynvim neovim-symlinks ipython
rust gcc gdb