dgy
/
hexagons
Archived
1
0
Fork 0

amigarme con algunos defaults que venian mejor que mis mejoras. actualizar compton y dunst. agregar iconos. emparchar un par de cosas

This commit is contained in:
deadguy 2019-05-05 12:19:30 -03:00
parent 5f2749588d
commit 90d987bc62
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
22 changed files with 118 additions and 286 deletions

View File

@ -1,98 +0,0 @@
#!/usr/bin/env bash
set -euf -o pipefail
# neeasade
# depends on: jq
# goal: natural feeling window spawning
# behavior:
# if there are any presel's on current desktop, spawn there.
# else, spawn a prefered split in current node based on node size.
# preferred split directions:
horiPref=east
vertPref=south
# if dimensions are within this percent, will split $horiPref,
# else direction is determined by width or height being greater.
percent=.45
# get any presels on the current desktop, select one if so.
presel="$(bspc query -N -d -n .\!automatic | head -n 1)"
targetNode=${presel:-focused}
# we get these values early because you can't use bspc commands
# in an external rule after you start echoing.
width=$(bspc query -T -n "$targetNode" | jq '.rectangle.width')
height=$(bspc query -T -n "$targetNode" | jq '.rectangle.height')
# set node
echo node="$targetNode"
# not specifying split dir if targetting presel
[ -n "$presel" ] && exit 0
bcInput="$(iif "[ $width -gt $height ]" \
"($width-$height)/$width" \
"($height-$width)/$height" )"
result=$(echo "$bcInput < $percent" | bc -l)
if [ "$result" -eq "1" ]; then
split_dir=$vertPref
else
split_dir=$(iif "[ $width -gt $height ]" $horiPref $vertPref)
fi
echo split_dir="$split_dir"
get_xrdb() {
xrdb -query | grep "$1" | awk '{print $2}' | tail -n1
}
xrdb -merge "${HOME}/.Xresources"
borderW=$(bspc config border_width)
focused=$(get_xrdb color3)
focused2=$(get_xrdb color0)
unfocused=$(get_xrdb color8)
unfocused2=$(get_xrdb color8)
subscribe_focus() { # this sets the borders of the next and previous window when moving focus
# listen to events
bspc subscribe node_focus | while read -ra msg; do
if [[ ${msg[0]} == 'node_focus' ]]
then
# newly focussed window
chwb2 -O "$focused2" -o "$borderW" -I "$focused" -i "$borderW" "${msg[3]}"
# previously focussed window
chwb2 -O "$unfocused2" -o "$borderW" -I "$unfocused" -i "$borderW" "$prev"
prev=${msg[3]}
fi
done
}
subscribe_geometry() { # this resets borders when windows change size
# listen to events
bspc subscribe node_geometry | while read -ra msg; do
if [[ ${msg[0]} == 'node_geometry' ]]
then
if [[ $(bspc query -N -n) == "${msg[3]}" ]]
then
chwb2 -O "$focused2" -o "$borderW" -I "$focused" -i "$borderW" "${msg[3]}"
else
chwb2 -O "$unfocused2" -o "$borderW" -I "$unfocused" -i "$borderW" "${msg[3]}"
fi
fi
done
}
subscribe_desktop_focus() { # this sets the border when moving to next/prev desktop
bspc subscribe desktop_focus | while read -ra msg
do
if [[ ${msg[0]} == 'desktop_focus' ]]
then
chwb2 -O "$focused2" -o "$borderW" -I "$focused" -i "$borderW" "$(bspc query -N -n)"
fi
done
}

View File

@ -1,9 +1,7 @@
backend = "xrender";
paint-on-overlay = true;
vsync = "none";
vsync = false;
glx-no-rebind-pixmap = true;
refresh-rate = 0;
glx-swap-method = "undefined";
detect-rounded-corners = true;
detect-client-opacity = true;
inactive-opacity-override = false;
@ -20,16 +18,11 @@ shadow-radius = 0;
shadow-offset-x = 2.5;
shadow-offset-y = 2.5;
shadow-opacity = 1;
no-dock-shadow = true;
no-dnd-shadow = true;
clear-shadow = true;
menu-opacity = 1.0;
frame-opacity = 0.8;
active-opacity = 1.0;
inactive-opacity = 0.85;
inactive-dim = 0.2;
alpha-step = 0.06;
fading = false;
fade-delta = 15;
@ -104,4 +97,6 @@ wintypes:
dropdown_menu = { shadow = false; opacity = 1; focus = true; };
popup_menu = { shadow = false; opacity = 1; focus = true; };
utility = { shadow = false; opacity = 1; focus = true; };
dock = { shadown = false };
dnd = { shadown = false };
};

View File

@ -64,7 +64,7 @@
max_icon_size = 0
# Paths to default icons.
# icon_path = /usr/share/icons/Papirus-Dark/16x16@2x/apps/:/usr/share/icons/Papirus-Dark/16x16@2x/devices/:/usr/share/icons/Papirus-Dark/16x16@2x/status/
icon_path = /home/deadguy/.local/share/icons/ArchLabs-Light/32x32/apps /home/deadguy/.local/share/icons/ArchLabs-Light/32x32/devices /home/deadguy/.local/share/icons/ArchLabs-Light/32x32/status
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true

View File

@ -39,7 +39,7 @@ set sig_dashes ## dashes before sig
set text_flowed = yes ## Eliminate odd line breaks
set skip_quoted_offset = 3
set editor='nvim + -c "set nocp" -c "set textwidth=80" -c "set wrap" -c "silent /^$" -c "noh" -c "vmap <leader>s c[... snip ...]<ESC>"'
set editor="nvim -c 'set textwidth=80' +Goyo"
set status_on_top = yes
set status_chars = " *%A"

View File

@ -1,6 +1,5 @@
-------COMICS------------
https://www.questionablecontent.net/QCRSS.xml "~Questionable Content" comics
http://www.empoweredcomic.com/comic/rss "~Empowered" comics
-------BLOGS------------
https://chiptuneswin.com/blog/feed/ "~Chiptunes=WIN" blogs
@ -17,6 +16,7 @@ https://www.youtube.com/feeds/videos.xml?playlist_id=PLXleEiD94A2d6WdmDU0h7dXJg8
https://www.youtube.com/feeds/videos.xml?channel_id=UCu8YylsPiu9XfaQC74Hr_Gw "~Seth's Bike Hacks" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCXKYjkimgemQuuNP-JRTz2Q "~Mundo Ciclismo TV" youtube
https://www.youtube.com/feeds/videos.xml?user=tvmultimediacine "~Ruta Cleta" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCeZLO2VgbZHeDcongKzzfOw "~8 bit Music Theory" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCq297H7Ca98HlB5mVFHGSsQ "~Reaper Mania" youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCMUHt6JzCMsdtvkaJpU3KXw "~Reaper TV" youtube
https://www.youtube.com/feeds/videos.xml?user=GRGE2MB "~GRGE" youtube

View File

@ -17,16 +17,14 @@ endif
if executable('rg')
set grepprg=rg\ --vimgrep\ --hidden\ --no-heading
set grepformat=%f:%l:%c:%m,%f:%l:%m
elseif executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
endif
" }}}
" Plugins {{{
call plug#begin('~/.config/nvim/plugged')
Plug 'junegunn/vim-plug'
" UI
Plug 'junegunn/seoul256.vim'
Plug 'zefei/vim-wintabs'
Plug 'zefei/vim-wintabs-powerline'
" Languages
Plug 'lervag/vimtex', { 'for': 'tex' }
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
@ -38,10 +36,11 @@ Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neco-syntax'
Plug 'Shougo/neco-vim'
" Navigation
Plug 'dylanaraps/fff.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug '/usr/bin/fzf'
Plug 'junegunn/fzf.vim'
" Modes
Plug 'junegunn/goyo.vim'
" Python
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
Plug 'jpalardy/vim-slime'
@ -73,12 +72,13 @@ set helpheight=12 " Minimum help window height
set previewheight=12 " Completion preview height
set noswapfile " New buffers will be loaded without creating a swapfile
set hidden " Enables to switch between unsaved buffers and keep undo history
set redrawtime=500
set lazyredraw " Don't redraw while executing macros (better performance)
set showmatch " Show matching brackets when text indicator is over them
set matchtime=2 " How many tenths of a second to blink when matching brackets
set nojoinspaces " No extra space when joining a line which ends with . ? !
set updatetime=1000 " Update time used to create swap file or other things
set synmaxcol=220 " Don't try to syntax highlight minified files
set synmaxcol=200 " Don't try to syntax highlight minified files
set splitbelow " Splitting a window will put the new window below the current
set splitright " Splitting a window will put the new window right of the current
set notimeout " Time out on key codes but not mappings.
@ -109,7 +109,6 @@ set shiftwidth=4 " Number of spaces for each (auto)in
set foldclose=all
set nostartofline
set nosmartindent
set laststatus=1 " Status line on 2 or more files
set nosmarttab
set modeline
set modelines=2
@ -161,51 +160,6 @@ let mapleader="\<SPACE>"
let maplocalleader=","
let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*'
" }}}
" Statusline {{{
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
endfunction
function! HasPaste()
let paste_status = &paste
if paste_status == 1
return " [paste] "
else
return ""
endif
endfunction
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? 'OK' : printf(
\ '%dW %dE',
\ all_non_errors,
\ all_errors
\)
endfunction
set statusline+=%#Keyword#
set statusline+=%{StatuslineGit()}
set statusline+=%#CursorLineNr#
set statusline+=\ %{LinterStatus()}
set statusline+=\ %{HasPaste()}
set statusline+=\ %F%h%r%w%q
set statusline+=%=
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=\ [%{&fileformat}\]
set statusline+=\ %l:%c\ (%p%%)
set statusline+=%#Keyword#
set statusline+=\ %{winnr()}
" }}}
" Read-Only files {{{
if &readonly
set laststatus=0
@ -254,10 +208,6 @@ let g:deoplete#enable_smart_case = 1
let g:context_filetype#same_filetypes = {}
let g:context_filetype#same_filetypes._ = '_'
"}}}
" FFF {{{
nnoremap <silent> <F2> :F<CR>
let g:fff#split = "30vnew"
"}}}
" Tmux navigator {{{
let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_save_on_switch = 1
@ -267,11 +217,11 @@ nnoremap <silent> M-Up :TmuxNavigateUp<cr>
nnoremap <silent> M-Right :TmuxNavigateRight<cr>
nnoremap <silent> M-Tab :TmuxNavigatePrevious<cr>
" }}}
" Fzf {{{
" FZF {{{
" use bottom positioned 30% height bottom split
let g:fzf_layout = { 'down': '~30%' }
let g:fzf_layout = { 'down': '~35%' }
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-t': 'enew',
\ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit' }
@ -291,6 +241,7 @@ let g:fzf_colors =
let g:fzf_buffers_jump = 1
let g:fzf_tags_command = 'ctags -R'
let g:fzf_history_dir = '~/.local/share/fzf-history'
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
@ -304,10 +255,11 @@ command! -bang -nargs=? -complete=dir Files
" only use FZF shortcuts in non diff-mode
if !&diff
nnoremap <C-p> :Files<Cr>
nnoremap <C-g> :Rg<Cr>
nnoremap <C-h> :History<CR>
nnoremap <C-b> :Buffers<CR>
nnoremap <F1> :Helptags<CR>
nnoremap <F2> :Files<CR>
nnoremap <F3> :History<CR>
nnoremap <F4> :Buffers<CR>
nnoremap <C-g> :Rg<CR>
endif
" }}}
" Semshi {{{
@ -331,30 +283,13 @@ let g:LanguageClient_serverCommands = {
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
" }}}
" Seoul 256 {{{
" Colors {{{
let g:seoul256_srgb = 1
let g:seoul256_background = 233
colo seoul256
" }}}
" Wintabs {{{
let g:wintabs_ui_active_higroup = 'TabLineSel'
let g:wintabs_switchbuf='useopen,usetab'
let g:wintabs_display='statusline'
let intertabSpace= ''
let activeVimTabChar = '┃ '
let g:wintabs_ui_sep_leftmost=activeVimTabChar
let g:wintabs_ui_sep_inbetween=' '
let g:wintabs_ui_sep_rightmost=' '
let g:wintabs_ui_active_vimtab_left=activeVimTabChar
let g:wintabs_ui_active_vimtab_right=' '
let g:wintabs_ui_active_left=activeVimTabChar
let g:wintabs_ui_active_right=' '
let g:wintabs_ui_buffer_name_format='%t'
let g:wintabs_ui_vimtab_name_format='%n'
let g:wintabs_ui_arrow_left='«'
let g:wintabs_ui_arrow_right='»'
nnoremap <silent> <C-w> :WintabsClose<CR>
nnoremap <silent> <C-l> :WintabsNext<CR>
nnoremap <silent> <C-h> :WintabsPrevious<CR>
@ -374,6 +309,12 @@ if !exists("autocommands_loaded") && has("autocmd")
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
aug aug_cursor_line
au!
au InsertEnter * setlocal nocursorline
au InsertLeave * setlocal cursorline
aug END
aug skeletons
autocmd BufNewFile *.py 0r ~/.config/nvim/templates/py.skeleton
autocmd BufRead,BufNewFile *.foxdot 0r ~/.config/nvim/templates/foxdot.skeleton
@ -390,18 +331,22 @@ if !exists("autocommands_loaded") && has("autocmd")
augroup END
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=1 showmode ruler
\| autocmd BufLeave <buffer> set showmode ruler
aug fzf_setup
au!
au TermOpen term://*FZF tnoremap <silent> <buffer> <esc> <c-c>
aug END
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
" 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
au BufRead,BufNewFile man set textwidth=80
aug END
endif
" }}}
@ -412,7 +357,6 @@ nnoremap <F7> :setlocal spell! spelllang=en<CR>
nnoremap <F8> :set nospell<CR>
" LaTeX
"nnoremap <F9> :!w<Enter>:!pdflatex <C-r>%<Enter>
nnoremap <F9> :w! \| !compiler <c-r>%<CR>
" Plug
@ -426,8 +370,8 @@ 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>
noremap <leader>u :w<Home>silent <End> !urlscan<CR>
noremap ,, :w<Home>silent <End> !urlscan<CR>
" Visual mode pressing * or # searches for the current selection
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
@ -477,10 +421,6 @@ nnoremap <leader>i mzgg=G`z<CR>
nnoremap - dd<CR>p
inoremap <c-d> <esc>ddi
" LOUD
inoremap <m-u> <esc>viwUi
nnoremap <m-u> viwU
" Quote words under cursor
nnoremap <leader>" viW<esc>a"<esc>gvo<esc>i"<esc>gvo<esc>3l
nnoremap <leader>' viW<esc>a'<esc>gvo<esc>i'<esc>gvo<esc>3l
@ -504,12 +444,6 @@ nnoremap <buffer><silent><expr>k v:count ? 'k' : 'gk'
vnoremap <buffer><silent><expr>j v:count ? 'j' : 'gj'
vnoremap <buffer><silent><expr>k v:count ? 'k' : 'gk'
" Use tab for indenting
vnoremap <Tab> >gv|
vnoremap <S-Tab> <gv
nnoremap <Tab> v>gv|
nnoremap <S-Tab> v<gv
" Line movements
noremap <silent> <Home> g<Home>
noremap <silent> <End> g<End>
@ -654,4 +588,4 @@ nnoremap <Leader>fw
\ endif <CR><Paste>
" }}}
" vim:foldmethod=marker:foldlevel=0
" vim:foldmethod=marker:foldlevel=0

View File

@ -30,6 +30,15 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then
bindkey "^I" expand-or-complete-with-dots
fi
# }}}
# FZF {{{
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
#}}}
# Prevent ranger nesting {{{
ranger() {
if [ -z "$RANGER_LEVEL" ]; then

View File

@ -72,10 +72,10 @@ bind-key S command-prompt 'rename-session %%'
bind-key r source-file $HOME/.tmux.conf \; display "Config Reloaded!"
# Cambiar de pane usando flecha con prefijo
bind-key Left select-pane -L
bind-key Right select-pane -R
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
# Trocar panes usando alt-flecha con prefijo
bind-key M-Left swap-pane -s {left-of}
@ -126,7 +126,7 @@ bind-key C-right swap-window -t +1
bind-key C-d display-panes
# Urlview
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlscan" '$SHELL -c "urlscan < /tmp/tmux-buffer"'
# Vim
bind-key [ copy-mode

2
.zshrc
View File

@ -68,8 +68,6 @@ zstyle ':completion:*:corrections' format $'\n %F{green}--- %d
zstyle ':completion:*:descriptions' format $'\n %F{yellow}--- %d ---%f'
zstyle ':completion:*:messages' format $'\n %F{purple}--- %d ---%f'
zstyle ':completion:*:warnings' format $'\n %F{red}-- No Matches Found --%f'
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion:*:*:cd:*:directory-stack' force-list always
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'

View File

@ -13,5 +13,5 @@ nb_aur=$(yay -Qua | tee /tmp/aurupdates | wc -l)
if ((nb_pac>0 || nb_aur>0)); then
((nb_aur>0)) && nb_aur="+ ${nb_aur}" && cat /tmp/aurupdates >> /tmp/pacmanupdates
((nb_aur==0)) && unset nb_aur
notify-send "Updates" "${nb_pac} ${nb_aur} available"
notify-send -i ~/Pictures/.icn/arch.png "Updates" "${nb_pac} ${nb_aur} available"
fi

2
bin/ae
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
du -a -d 1 ~/bin | awk '{print $2}' | fzf --height='45%' | xargs -r "$EDITOR"
du -a -d 1 ~/bin | awk '{print $2}' | fzf -m --height='45%' | xargs -r "$EDITOR"

View File

@ -1,27 +1,9 @@
#!/usr/bin/env bash
set -euf -o pipefail
# You can call this script like this:
# $ brillo up
# $ brillo down
# Script inspired by these wonderful people:
# https://github.com/dastorm/volume-notification-dunst/blob/master/volume.sh
# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
# https://gitlab.com/Poplan/dotfiles/blob/master/scripts/brightness.sh
function get_brightness {
xbacklight -get | cut -d '.' -f 1
}
function send_notification {
icon="/home/deadguy/.local/share/icons/ArchLabs-Light/24x24/actions/contrast.svg"
brightness=$(get_brightness)
# Make the bar with the special character ─ (it's not dash -)
# https://en.wikipedia.org/wiki/Box-drawing_character
bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g')
# Send the notification
dunstify -i "$icon" -r 5555 -u low " $bar"
dunstify -i "$icon" -r 5555 -u low " $(printf %.0f%% "$(xbacklight -get)")"
}
case $1 in

View File

@ -2,11 +2,10 @@
# Sync mail and give notification if there is new mail.
ping -q -c 1 1.1.1.1 > /dev/null || exit
pgrep -x mbsync >/dev/null && echo "mbsync already running." && exit
export DISPLAY=:0.0
notify() { notify-send "You've got mail" "$2 new message(s) in \`$1\` " ;}
notify() { notify-send -i ~/Pictures/.icn/correo.png "You've got mail" "$2 new message(s) in \`$1\` " ;}
# Run mbsync. You can feed this script different settings.
mbsync -a "$@"

View File

@ -34,7 +34,7 @@ c8='#eeeeecff'
c9='#12121200'
cA='#c4a000ff'
lock="$HOME/Pictures/trilock.png"
lock="$HOME/Pictures/lockscreen/trilock.png"
image=$(mktemp --suffix=.png)
trap 'rm -f "$image"' SIGINT SIGTERM EXIT

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
notify-send -u low -t 5000 " $(date +'%A %d de %B %H:%M')"
notify-send -u low -t 5000 -i ~/Pictures/.icn/calendar.png "$(date +'%A %d de %B %H:%M')"

View File

@ -11,46 +11,47 @@
case "$1" in
logout)
if [ $DESKTOP_SESSION = "fluxbox" ]; then
killall fluxbox
elif [ $DESKTOP_SESSION = "openbox" ]; then
openbox --exit
elif [ $DESKTOP_SESSION = "i3" ]; then
i3-msg exit
elif [ $DESKTOP_SESSION = "bspwm" ]; then
bspc quit 1
else
pkill -KILL -u $USER
fi
;;
suspend)
if [ $(cat /proc/1/comm) = "systemd" ]; then
systemctl suspend
else
dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Suspend boolean:true
fi
;;
hibernate)
if [ $(cat /proc/1/comm) = "systemd" ]; then
systemctl hibernate
else
dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Hibernate boolean:true
fi
;;
reboot)
if [ $(cat /proc/1/comm) = "systemd" ]; then
systemctl reboot
else
dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
fi
;;
shutdown)
if [ $(cat /proc/1/comm) = "systemd" ]; then
systemctl poweroff
else
dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
fi
;;
logout)
if [ "$DESKTOP_SESSION" = "fluxbox" ]; then
killall fluxbox
elif [ "$DESKTOP_SESSION" = "openbox" ]; then
openbox --exit
elif [ "$DESKTOP_SESSION" = "i3" ]; then
i3-msg exit
elif [ "$DESKTOP_SESSION" = "bspwm" ]; then
bspc quit 1
else
pkill -KILL -u "$USER"
fi
;;
suspend)
if [ "$(cat /proc/1/comm)" = "systemd" ]; then
systemctl suspend
else
dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Suspend boolean:true
fi
;;
hibernate)
if [ "$(cat /proc/1/comm)" = "systemd" ]; then
systemctl hibernate
else
dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Hibernate boolean:true
fi
;;
reboot)
if [ "$(cat /proc/1/comm)" = "systemd" ]; then
systemctl reboot
else
dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
fi
;;
shutdown)
if [ "$(cat /proc/1/comm)" = "systemd" ]; then
systemctl poweroff
else
dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
fi
;;
esac
exit 0

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
maim -u ~/Pictures/scrot/"$(date +%s)".png && notify-send -u low -t 3000 ' Screen captured'
maim -u ~/Pictures/scrot/"$(date +%s)".png && notify-send -u low -t 3000 -i ~/Pictures/.icn/camera.png 'Screen captured'

View File

@ -1,7 +1,20 @@
#!/bin/bash
if [ -d /sys/class/power_supply/BAT0 ]; then
bat_lvl=$(head -n 1 /sys/class/power_supply/BAT0/capacity)
bat=" $bat_lvl%"
current_charge=$(echo "$bat_lvl" | grep -o '[0-9]\+%' | awk '{sub (/%/, "", $1); print $1}')
if [[ $current_charge -lt 11 ]]; then
icon="/home/deadguy/Pictures/.icn/battery-empty.png"
elif [[ $current_charge -lt 31 ]]; then
icon="/home/deadguy/Pictures/.icn/battery-caution.png"
elif [[ $current_charge -lt 51 ]]; then
icon="/home/deadguy/Pictures/.icn/battery-low.png"
elif [[ $current_charge -lt 71 ]]; then
icon="/home/deadguy/Pictures/.icn/battery-good.png"
elif [[ $current_charge -lt 98 ]]; then
icon="/home/deadguy/Pictures/.icn/battery-full.png"
fi
bat="$bat_lvl%"
fi
notify-send -t 5000 "${bat}"
notify-send -t 5000 -i "$icon" "${bat}"

View File

@ -13,7 +13,6 @@ img_reg=".*/(cover|front|folder|art).(jpg|jpeg|png|gif)$"
# What do we want the notification to look like?
artist_color="##a1b56c"
#album_color="##ad7fa8"
song_color="##34e2e2"
#title="%album%"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-dl --add-metadata -ic --no-call-home --no-cache-dir --geo-bypass -o "$HOME/Videos/%(title)s.%(ext)s" "$@"
youtube-dl --add-metadata --youtube-skip-dash-manifest -ic --no-call-home --no-cache-dir --geo-bypass -o "$HOME/Videos/%(title)s.%(ext)s" "$@"

4
bin/ytw Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-viewer -C -W -f -7 --results=5

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
set -euf -o pipefail
youtube-viewer -C -D -W -f -7 --results=10