dgy
/
hexagons
Archived
1
0
Fork 0

modularizar scripts chiquitos y reconfigurar irssi

This commit is contained in:
deadguy 2018-11-04 20:36:14 -03:00
parent 01742ddb7a
commit 8e4692a00d
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
24 changed files with 257 additions and 441 deletions

View File

@ -74,6 +74,7 @@ bspc rule -a X64 state=floating
bspc rule -a Toplevel state=floating
bspc rule -a WxPSeInt.bin state=floating
bspc rule -a Firefox state=floating
bspc rule -a VChar64 state=floating
# Otros
bspc rule -a Zathura state=tiled

View File

@ -5,7 +5,6 @@ vsync = "none";
#vsync = "opengl-swc";
glx-no-rebind-pixmap = true;
refresh-rate = 0;
glx-copy-from-front = false;
glx-swap-method = "undefined";
detect-rounded-corners = true;
detect-client-opacity = true;
@ -16,7 +15,6 @@ unredir-if-possible = true;
use-ewmh-active-win = true;
detect-transient = true;
detect-client-leader = true;
dbe = false;
shadow-ignore-shaped = false;
shadow = true;

View File

@ -1 +1 @@
autocmd BufRead,BufNewFile *.foxdot setfiletype python.foxdot
autocmd BufRead,BufNewFile *.foxdot setfiletype foxdot

View File

@ -161,6 +161,10 @@ set wildignore+=*node_modules/**
set wildignore+=__pycache__,*.egg-info
set wildmode=longest:list,full
if &diff
set textwidth=80
endif
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
let mapleader="\<SPACE>"
@ -214,64 +218,6 @@ set statusline+=%#Keyword#
set statusline+=\ %{winnr()}
" }}}
" AutoCommands {{{
if !exists("autocommands_loaded") && has("autocmd")
let autocommands_loaded = 1
" Auto remove all trailing whitespace on :w
autocmd BufWritePre * :%s/\s\+$//e
" Disables automatic commenting on newline
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
aug skeletons
autocmd BufNewFile *.py 0r ~/.config/nvim/templates/py.skeleton
autocmd BufRead,BufNewFile *.foxdot 0r ~/.config/nvim/templates/foxdot.skeleton
autocmd BufNewFile *.sh 0r ~/.config/nvim/templates/sh.skeleton
aug END
aug terminal_stuff
"au BufWinEnter,WinEnter term://* startinsert
"au BufEnter * if &buftype == 'terminal' | setlocal statusline=%{b:term_title}
"au BufLeave term://* stopinsert
au TermOpen * setlocal nonumber norelativenumber
"au TermOpen * setlocal statusline=%{b:term_title}
aug END
augroup CloseLoclistWindowGroup
autocmd!
autocmd QuitPre * if empty(&buftype) | lclose | endif
augroup END
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=1 showmode ruler
function! s:fzf_statusline()
" Override statusline as you like
highlight fzf1 ctermfg=161 ctermbg=251
highlight fzf2 ctermfg=23 ctermbg=251
highlight fzf3 ctermfg=237 ctermbg=251
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
endfunction
autocmd! User FzfStatusLine call <SID>fzf_statusline()
" Automatic syntax highlighting for files
aug set_file_types
au BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.conf set filetype=dosini
au BufRead,BufNewFile *.bash* set filetype=sh
aug END
aug mutt_settings
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
autocmd BufEnter /tmp/neomutt* :exe "normal! 9j\<cr>o"
autocmd BufEnter /tmp/neomutt* setl spelllang=es
aug END
endif
" }}}
" Read-Only files {{{
if &readonly
set laststatus=0
@ -518,6 +464,67 @@ nnoremap <silent> <C-l> :WintabsNext<CR>
nnoremap <silent> <C-h> :WintabsPrevious<CR>
" }}}
" AutoCommands {{{
if !exists("autocommands_loaded") && has("autocmd")
let autocommands_loaded = 1
" Auto remove all trailing whitespace on :w
autocmd BufWritePre * :%s/\s\+$//e
" Disables automatic commenting on newline
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Runs a script that cleans out tex build files whenever I close out of a .tex file.
autocmd VimLeave *.tex !texclear %
aug skeletons
autocmd BufNewFile *.py 0r ~/.config/nvim/templates/py.skeleton
autocmd BufRead,BufNewFile *.foxdot 0r ~/.config/nvim/templates/foxdot.skeleton
autocmd BufNewFile *.sh 0r ~/.config/nvim/templates/sh.skeleton
aug END
aug terminal_stuff
"au BufWinEnter,WinEnter term://* startinsert
"au BufEnter * if &buftype == 'terminal' | setlocal statusline=%{b:term_title}
"au BufLeave term://* stopinsert
au TermOpen * setlocal nonumber norelativenumber
"au TermOpen * setlocal statusline=%{b:term_title}
aug END
augroup CloseLoclistWindowGroup
autocmd!
autocmd QuitPre * if empty(&buftype) | lclose | endif
augroup END
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=1 showmode ruler
function! s:fzf_statusline()
" Override statusline as you like
highlight fzf1 ctermfg=161 ctermbg=251
highlight fzf2 ctermfg=23 ctermbg=251
highlight fzf3 ctermfg=237 ctermbg=251
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
endfunction
autocmd! User FzfStatusLine call <SID>fzf_statusline()
" Automatic syntax highlighting for files
aug set_file_types
au BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.conf set filetype=dosini
au BufRead,BufNewFile *.bash* set filetype=sh
aug END
aug mutt_settings
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
autocmd BufEnter /tmp/neomutt* :exe "normal! 9j\<cr>o"
autocmd BufEnter /tmp/neomutt* setl spelllang=es
aug END
endif
" }}}
"Mappings {{{
" Spell checking
nnoremap <F6> :setlocal spell! spelllang=es<CR>
@ -535,6 +542,10 @@ nnoremap <leader>pc :PlugClean<CR>
nnoremap <leader>f :Neoformat<CR>
vnoremap <leader>f :Neoformat<CR>
" Use urlview to choose and open a url:
noremap <leader>u :w<Home>silent <End> !urlview<CR>
noremap ,, :w<Home>silent <End> !urlview<CR>
" Visual mode pressing * or # searches for the current selection
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
@ -558,7 +569,7 @@ nnoremap <silent> <leader>sv :source $MYVIMRC<CR>
" Fast saves
nnoremap <leader>w :w!<CR>
" Exit quickly
" Fast exits
nnoremap <leader>q :q!<CR>
" Splits

View File

@ -26,7 +26,7 @@ set collapse_preview true
set save_console_history false
set status_bar_on_top false
set draw_progress_bar_in_status_bar true
set draw_borders separators
set draw_borders none
set dirname_in_tabs true
set mouse_enabled true
set display_size_in_main_column true
@ -187,7 +187,7 @@ map gs cd ~/.local/share
map gf cd ~/.local/lib/python3.7/site-packages/FoxDot
map gm cd ~/Music/Albums
map gb cd ~/bin
map gM cd eval fm.cd('/run/media/' + os.getenv('USER'))
map gM cd /media
map gR cd /
map gr cd ~/.config/ranger
map g? cd /usr/share/doc/ranger
@ -454,7 +454,7 @@ tmap <ESC> taskview_close
copytmap <ESC> q Q w <C-c>
# Assorted stuff
map cx shell chmod -x %s
map cx shell chmod +x %s
map V console shell vim%space
map Nf console touch%space
map Nd console mkdir%space

View File

@ -88,4 +88,5 @@ alias compare='grep -nFxvf' # Usage: compare <file1> <file2>
alias pwn='chmod +x'
alias ta='tmux attach -t'
alias tk='tmux kill-session -t'
alias lst='ls -FAghoBtH --group-directories-first --dereference-command-line-symlink-to-dir --time-style=+"%d-%m-%Y %H:%M"'
alias lst='ls -FAghoBtH --group-directories-first --dereference-command-line-symlink-to-dir --time-style=+"%d-%m-%Y %H:%M"'
alias shot='maim -d 5 -q -u ~/Pictures/scrot/$(date +%s).png && notify-send "Screen captured"'

View File

@ -1,122 +0,0 @@
# -*- mode: shell-script -*-
# vim:ft=zsh
# Completion Dots {{{
# if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
# }}}
# Disks {{{
disks() {
echo "╓───── m o u n t . p o i n t s"; echo "╙────────────────────────────────────── ─ ─ "; lsblk -a; echo ""; echo "╓───── d i s k . u s a g e"; echo "╙────────────────────────────────────── ─ ─ "; df -h;
}
# }}}
# Pacman {{{
files() { pacman -Ql "$1" ;} # list files owned by package
explicit() { sudo pacman -D --asexplicit "$@" ;} # mark package as explicitly installed
upd() {
sudo pacman-mirrors -f5
yay -Syu
}
orphans() {
pacman -Qdt
echo "Press ENTER to remove these orphaned packages or CTRL+C to cancel."
read
sudo pacman -Rsn $(pacman -Qqdt) --noconfirm
}
paclist() {
pacman -Qqettn >! ~/paketes.txt
pacman -Qqettm >! ~/paurketos.txt
}
pacfix() {
sudo rm -f /var/lib/pacman/db.lck
sudo pacman-mirrors -f5
sudo pacman -Syyuu
sudo pacman -Suu
}
# }}}
# Make and enter directory {{{
mkcd () {
case "$1" in
*/..|*/../) cd -- "$1";; # that doesn't make any sense unless the directory already exists
/*/../*) (cd "${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd -- "$1";;
/*) mkdir -p "$1" && cd "$1";;
*/../*) (cd "./${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd "./$1";;
../*) (cd .. && mkdir -p "${1#.}") && cd "$1";;
*) mkdir -p "./$1" && cd "./$1";;
esac
}
# }}}
# Handle trash {{{
trash-empty() { gio trash --empty }
trash() { gio trash -f $@ }
trash-ls() { gio list -h trash:// }
# }}}
# Prevent ranger nesting {{{
ranger() {
if [ -z "$RANGER_LEVEL" ]; then
/usr/bin/ranger "$@"
else
exit
fi
}
# }}}
# Colored man pages using less as pager {{{
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;36m") \
LESS_TERMCAP_md=$(printf "\e[1;34m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
# }}}
# This is a workaround for tmux {{{
# When you clear the terminal with ctrl-l anything on-screen is not saved (this is compatible with xterm behavior).
# In contrast, GNU screen will first push anything on-screen into the scrollback buffer before clearing the screen.
function tmux-clear-screen() {
for line in {1..$(( $LINES ))} ; do echo; done
zle clear-screen
}
zle -N tmux-clear-screen
bindkey "^L" tmux-clear-screen
# }}}
# Bunch of one liners {{{
# Take a screenshot
shot() { maim -d 5 -q -u ~/Pictures/scrot/$(date +%s).png && notify-send 'Screen captured' ;}
# Set wallpaper
wpp() { hsetroot -fill ~/Pictures/wallpaper/$1 ;}
# Command not found
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
# }}}
# vim:foldmethod=marker:foldlevel=0

View File

@ -10,7 +10,6 @@
#
#
# neongold originally by xero https://github.com/xero/dotfiles
#
# tweaked by deadguy. i'm really sorry...
default_color = "-1";
@ -37,8 +36,8 @@ abstracts = {
channick = "$*";
chanhost = "{nickhost $*}";
channelhilight = "%g$*%n";
ban = "$*";
msgnick = "%y$0%w$1 %y│ %N";
ownmsgnick = "%y$0%w$1 %y│ %N";
ownnick = "%9%p$*%_%n";
@ -86,11 +85,10 @@ abstracts = {
sb_background = "%N%N";
sb_prompt_bg = "%n";
sbstart = " %y┌─┄┄─────┘ %w";
sbstart = " %y┌─┄┄─────┘%w";
sbend = " ";
awlbarstart = " %y ┌┄┄ %w";
topicsbstart = " %y ┌┄┄%b$*";
awlbarend = " ";
topicsbstart = "%w$C %y┄─┄$*";
topicsbend = "$*";
prompt = " %y└──┄┄╼%n ";
@ -148,10 +146,10 @@ formats = {
whois_extra = "%y│ %wextr%b %|$1";
end_of_whois = "%y└─┄┄ ";
whois_not_found = "%y──┄┄ %wthere is no such nick %b$0";
topic = " %ntopic %y┈┈┈┤ %B$0 %b$1";
topic_info = " %y │ %wset by %b$0 %B(%w$1%B)";
channel_synced = "%n %N sync %y╪ %nin {hilight $1} secs";
channel_created = "%n %y ╞ %ncreated $1";
topic = " %y ├─┄┄┄─┄"
topic_info = " %y │ %wtopic set by %b$0 %B(%w$1%B)";
channel_synced = "%n %N sync %y╪ %n{hilight $1} secs%: %y ├─┄┄┄─┄";
channel_created = " %n created %y╞ %n$1";
};
"Irssi::Script::adv_windowlist" = {
awl_display_header = "%U%9%w$C";

View File

@ -2,12 +2,17 @@ utf8 = "on";
servers = (
{
address = "chat.freenode.net";
address = "irc.undernet.org";
chatnet = "Undernet";
port = "6667";
},
{
address = "irc.freenode.net";
chatnet = "Freenode";
port = "6697";
use_tls = "yes";
tls_cert = "~/.irssi/Freenode.pem";
tls_verify = "yes";
use_ssl = "yes";
ssl_verify = "yes";
ssl_capath = "/etc/ssl/certs";
},
{
address = "irc.rizon.net";
@ -24,18 +29,30 @@ servers = (
use_ssl = "yes";
ssl_verify = "no";
},
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }
{
address = "ssl.efnet.org";
chatnet = "EFNet";
port = "9999";
use_tls = "yes";
}
);
chatnets = {
Freenode = { type = "IRC"; };
Rizon = { type = "IRC"; };
nixers = { type = "IRC"; nick = "name"; };
DALnet = {
Freenode = {
type = "IRC";
max_kicks = "4";
max_msgs = "20";
max_whois = "30";
nick = "deadguy";
sasl_mechanism = "plain";
sasl_username = "user";
sasl_password = "pass";
};
Rizon = { type = "IRC"; };
nixers = { type = "IRC"; nick = "deadguy"; };
EFNet = { type = "IRC"; nick = "deadguy"; };
Undernet = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
};
@ -45,7 +62,7 @@ channels = (
chatnet = "Freenode";
autojoin = "Yes";
},
{
{
name = "#archlinux-newbie";
chatnet = "Freenode";
autojoin = "Yes";
@ -56,7 +73,7 @@ channels = (
autojoin = "yes";
autosendcmd = "/^msg IdleBot LOGIN name pass";
},
{ name = "##tilingwm"; chatnet = "Freenode"; autojoin = "Yes"; },
{ name = "#pvm"; chatnet = "EFNet"; autojoin = "yes"; },
{ name = "#unix"; chatnet = "nixers"; autojoin = "Yes"; },
{ name = "#rice"; chatnet = "rizon"; autojoin = "yes"; },
{
@ -103,12 +120,12 @@ aliases = {
};
settings = {
core = {
core = {
real_name = "name";
user_name = "name";
nick = "name";
quit_message = "9";
log_day_changed = "%y ┌─┄┄─────┘%n\\012%y │ It is now %A %d %b %Y\\012%y └─┄┄─┄┄──┐ ";
log_day_changed = "%y ┌─┄┄─────┘%n\\012%y │ It is now %A %d %b %Y\\012%y └─┄┄─┄┄──┐ ";
};
"fe-text" = {
actlist_sort = "refnum";
@ -133,7 +150,7 @@ settings = {
emphasis_replace = "yes";
show_names_on_join = "no";
activity_hide_level = "joins parts quits nicks modes";
show_quit_once = "yes";
show_quit_once = "yes";
};
"perl/core/scripts" = {
nickcolor_enable_prefix = "yes";
@ -147,7 +164,7 @@ settings = {
awl_maxlines = "1";
awl_block = "15";
awl_sbar_maxlength = "yes";
awl_placement = "top";
awl_placement = "bottom";
awl_viewer_tmux_position = "right";
fancy_abbrev = "head";
awl_all_disable = "no";
@ -158,7 +175,8 @@ settings = {
mouse_escape = "0";
awl_mouse_offset = "0";
mouse_scroll = "3";
splitlong_line_start = " ";
splitlong_line_start = " ";
nicklist_color = "yes";
};
"fe-common/irc" = {
query_track_nick_changes = "yes";
@ -168,11 +186,10 @@ settings = {
"irc/core" = {
rejoin_channels_on_reconnect = "ON";
split_line_on_space = "yes";
ctcp_version_reply = "eat a dIRC";
ctcp_userinfo_reply = "$N";
part_message = "bai";
};
};
logs = { };
statusbar = {
items = {
@ -191,19 +208,24 @@ statusbar = {
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
disabled = "yes";
};
topic = { disabled = "yes"; };
topic = { };
awl_0 = {
placement = "top";
items = {
awlbarstart = { priority = "100"; };
barstart = { priority = "100"; };
awl_0 = { };
awlbarend = { priority = "100"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
};
};
keyboard = (
keyboard = (
{
key = "meta-N";
id = "command";
data = "script exec Irssi::Script::tmux_nicklist_portable::toggle_nicklist";
},
{ key = "meta-[M"; id = "command"; data = "mouse_xterm"; }
);
ignores = (

View File

@ -1,132 +0,0 @@
/**
* User: deadguy
* Copyright: deadguy
*/
configuration {
display-drun: "Activate";
display-run: "Execute";
display-window: "Window";
show-icons: true;
sidebar-mode: true;
}
/* global settings and color variables */
* {
background-color: #080808;
text-color: #d3d7cf;
selbg: #215d9c;
actbg: #262626;
urgbg: #e53935;
winbg: #26c6da;
selected-normal-foreground: @winbg;
normal-foreground: @text-color;
selected-normal-background: @actbg;
normal-background: @background-color;
selected-urgent-foreground: @background-color;
urgent-foreground: @text-color;
selected-urgent-background: @urgbg;
urgent-background: @background-color;
selected-active-foreground: @winbg;
active-foreground: @text-color;
selected-active-background: @actbg;
active-background: @selbg;
line-margin: 2;
line-padding: 2;
separator-style: "none";
hide-scrollbar: "true";
margin: 0;
padding: 0;
}
window {
location: west;
anchor: west;
height: 100%;
width: 22%;
orientation: horizontal;
children: [mainbox];
}
mainbox {
spacing: 0.8em;
children: [ entry,listview,sidebar ];
}
button { padding: 5px 2px; }
button selected {
background-color: @active-background;
text-color: @background-color;
}
inputbar {
padding: 5px;
spacing: 5px;
}
listview {
spacing: 0.5em;
dynamic: false;
cycle: true;
}
element { padding: 10px; }
entry {
expand: false;
text-color: @normal-foreground;
vertical-align: 1;
padding: 5px;
}
element normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
element normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
element normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
element selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
border: 0 5px solid 0 0;
border-color: @active-background;
}
element selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
element selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
element alternate.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
element alternate.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
element alternate.active {
background-color: @active-background;
text-color: @active-foreground;
}

View File

@ -32,10 +32,10 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then
unset f
fi
xset dpms 0 2700 3000 &
xset s 900 900 &
#xset dpms 0 2700 3000 &
#xset s 900 900 &
setxkbmap -option caps:escape
xss-lock -n dim-screen.sh -l -- exeflock4 -n &
#xss-lock -n dim-screen.sh -l -- exeflock4 -n &
dbus-update-activation-environment --systemd DISPLAY
eval "$(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
@ -44,4 +44,5 @@ export SSH_AUTH_SOCK
xsetroot -cursor_name left_ptr &
compton -b &
sxhkd &
xfce4-power-manager &
exec bspwm

View File

@ -1,3 +1,3 @@
#!/bin/sh
exec /usr/bin/Xorg -nolisten tcp -nolisten local "$@" vt$XDG_VTNR
exec /usr/bin/Xorg -nolisten tcp -nolisten local "$@" vt"$XDG_VTNR"

View File

@ -47,4 +47,4 @@ export LESS_TERMCAP_ZO=$(tput ssupm) # Enter superscript mode.
export LESS_TERMCAP_ZW=$(tput rsupm) # End superscript mode.
typeset -U path
path=(~/bin ~/.local/bin /usr/lib/ccache/bin /usr/lib/surfraw $path[@])
path=(~/bin ~/.local/bin /usr/lib/surfraw $path[@])

23
.zshrc
View File

@ -45,6 +45,28 @@ zplugin light zdharma/fast-syntax-highlighting
zplugin load zsh-users/zsh-history-substring-search
# }}}
# Completion Dots {{{
# if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
# }}}
# Command not found {{{
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
# }}}
# Completion styles {{{
zstyle :compinstall filename '/home/deadguy/.zshrc'
zstyle ':completion:*' menu select=1
@ -125,5 +147,4 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
# }}}
# vim:foldmethod=marker:foldlevel=0

4
bin/disks Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
echo "╓───── m o u n t . p o i n t s"; echo "╙────────────────────────────────────── ─ ─ "; lsblk -a; echo ""; echo "╓───── d i s k . u s a g e"; echo "╙────────────────────────────────────── ─ ─ "; df -h;

View File

@ -2,30 +2,24 @@
set -euf -o pipefail
pre_lock() {
dunst() {
pkill -0 --exact dunst || return 0
dunst() {
pkill -0 --exact dunst || return 0
case ${1:-} in
stop)
pkill -USR1 --euid "$(id -u)" --exact dunst
;;
resume)
pkill -USR2 --euid "$(id -u)" --exact dunst
;;
*)
echo "dunst argument required: stop or resume"
return 1
;;
esac
}
dunst stop
case ${1:-} in
stop)
pkill -USR1 --euid "$(id -u)" --exact dunst
;;
resume)
pkill -USR2 --euid "$(id -u)" --exact dunst
;;
*)
echo "dunst argument required: stop or resume"
return 1
;;
esac
}
post_lock() {
dunst resume
}
dunst stop
# lock colors
c0='#00000000' # clear
@ -48,8 +42,8 @@ maim -u \
| convert png:- -scale 10% -scale 1000% \
"$lock" -gravity center -composite -matte "$image"
i3lock_options=("\
--image='$image' \
i3lock \
--image="$image" \
--insidevercolor=$c5 \
--insidewrongcolor=$c3 \
--insidecolor=$c0 \
@ -72,35 +66,11 @@ i3lock_options=("\
--noinputtext='' \
--ignore-empty-password \
-B \
--nofork &")
--nofork &
#pid="$!"
#while 2>/dev/null kill -0 "$pid"; do
# sleep 1
#done
pid="$!"
while 2>/dev/null kill -0 "$pid"; do
sleep 1
done
pre_lock
if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then
kill_i3lock() {
pkill -xu $EUID "$@" i3lock
}
trap kill_i3lock TERM INT
# we have to make sure the locker does not inherit a copy of the lock fd
i3lock "${i3lock_options[@]}" {XSS_SLEEP_LOCK_FD}<&-
# now close our fd (only remaining copy) to indicate we're ready to sleep
exec {XSS_SLEEP_LOCK_FD}<&-
while kill_i3lock -0; do
sleep 0.5
done
else
trap 'kill %%' TERM INT
i3lock -n "${i3lock_options[@]}" &
wait
fi
post_lock
dunst resume

View File

@ -5,34 +5,38 @@
# Behavior with `-c` option: Extract contents into current directory
while getopts "hc" o; do case "${o}" in
h) echo -e "Options:\\n -c: Extract archive into current directory rather than a new one." && exit ;;
c) dirpref="" && archive=${*:2} ;;
*) echo "only valid options are -h and -c." ;;
c) extracthere="True" ;;
*) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;;
esac done
[ -z ${dirpref+x} ] && dirpref="../" && archive="$*"
if [ -f "$archive" ] ; then
[[ "$dirpref" == "../" ]] && NAME=${archive%.*} && mkdir "$NAME" && cd "$NAME" || exit
case "$archive" in
*.tar.bz2) tar xvjf "$dirpref""$archive" ;;
*.tar.gz) tar xvzf "$dirpref""$archive" ;;
*.tar.xz) tar xvJf "$dirpref""$archive" ;;
*.lzma) unlzma "$dirpref""$archive" ;;
*.bz2) bunzip2 "$dirpref""$archive" ;;
*.rar) unrar x -ad "$dirpref""$archive" ;;
*.gz) gunzip "$dirpref""$archive" ;;
*.tar) tar xvf "$dirpref""$archive" ;;
*.tbz2) tar xvjf "$dirpref""$archive" ;;
*.tgz) tar xvzf "$dirpref""$archive" ;;
*.zip) unzip "$dirpref""$archive" ;;
*.Z) uncompress "$dirpref""$archive" ;;
*.7z) 7z x "$dirpref""$archive" ;;
*.xz) unxz "$dirpref""$archive" ;;
*.exe) cabextract "$dirpref""$archive" ;;
*) echo "extract: '$archive' - unknown archive method" ;;
esac
if [ -z "$extracthere" ]; then
archive="$(readlink -f "$*")" &&
directory=${archive%.*} &&
mkdir -p "$directory" &&
cd "$directory" || exit
else
echo "File \"$archive\" not found."
archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")"
fi
[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit
if [ -f "$archive" ] ; then
case "$archive" in
*.tar.bz2|*.tar.xz|*.tbz2) tar xvjf "$archive" ;;
*.tar.gz|*.tgz) tar xvzf "$archive" ;;
*.lzma) unlzma "$archive" ;;
*.bz2) bunzip2 "$archive" ;;
*.rar) unrar x -ad "$archive" ;;
*.gz) gunzip "$archive" ;;
*.tar) tar xvf "$archive" ;;
*.zip) unzip "$archive" ;;
*.Z) uncompress "$archive" ;;
*.7z) 7z x "$archive" ;;
*.xz) unxz "$archive" ;;
*.exe) cabextract "$archive" ;;
*) printf "extract: '%s' - unknown archive method\\n" "$archive" ;;
esac
else
printf "File \"%s\" not found.\\n" "$archive"
fi

11
bin/mkcd Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euf -o pipefail
case "$1" in
*/..|*/../) cd -- "$1";; # that doesn't make any sense unless the directory already exists
/*/../*) (cd "${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd -- "$1";;
/*) mkdir -p "$1" && cd "$1";;
*/../*) (cd "./${1%/../*}/.." && mkdir -p "./${1##*/../}") && cd "./$1";;
../*) (cd .. && mkdir -p "${1#.}") && cd "$1";;
*) mkdir -p "./$1" && cd "./$1";;
esac

7
bin/orphans Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euf -o pipefail
pacman -Qdt
echo "Press ENTER to remove these orphaned packages or CTRL+C to cancel."
read -r
sudo pacman -Rsn "$(pacman -Qqdt)" --noconfirm

7
bin/pacfix Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euf -o pipefail
sudo rm -f /var/lib/pacman/db.lck
sudo pacman-mirrors -f5
sudo pacman -Syyuu
sudo pacman -Suu

5
bin/paclist Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euf -o pipefail
pacman -Qqettn >! ~/paketes.txt
pacman -Qqettm >! ~/paurketos.txt

View File

@ -9,4 +9,4 @@ file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
find $dir -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\(busy\)|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\(busy\)|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete

5
bin/upd Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euf -o pipefail
sudo pacman-mirrors -f5
yay -Syu

4
bin/wpp Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
hsetroot -fill ~/Pictures/wallpaper/"$1"