dgy
/
hexagons
Archived
1
0
Fork 0

sxiv: parametros y key handler.bin: formato de notificaciones

This commit is contained in:
deadguy 2019-04-30 01:09:33 -03:00
parent 33b76034a2
commit e5228c5b60
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
16 changed files with 59 additions and 118 deletions

View File

@ -84,9 +84,6 @@ Xft.rgba: rgb
Xcursor.theme: Alkano
sxiv.font: tamzen:size=9
sxiv.barForeground: #d3d7cf
sxiv.barBackground: #080808
sxiv.background: #f5f5f5
sxiv.fsColor: #f5f5f5
sxiv.selColor: #f9c168
Sxiv.font: tamzen:size=9
Sxiv.foreground: #d3d7cf
Sxiv.background: #080808

View File

@ -138,7 +138,7 @@ file_node_extensions = {
'lock' : '',
'h' : '',
'o' : '',
'blend' : '',
'blend' : '',
'1' : '',
'jar' : '',
'desktop' : '',

View File

@ -1,33 +1,14 @@
#!/bin/sh
# Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler
# Called by sxiv(1) after the external prefix key (C-x by default) is pressed.
# The next key combo is passed as its first argument. Passed via stdin are the
# images to act upon, one path per line: all marked images, if in thumbnail
# mode and at least one image has been marked, otherwise the current image.
# sxiv(1) blocks until this script terminates. It then checks which images
# have been modified and reloads them.
# The key combo argument has the following form: "[C-][M-][S-]KEY",
# where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
# keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
rotate() {
degree="$1"
tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read -r file; do
case "$(file -b -i "$file")" in
image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
*) mogrify -rotate "$degree" "$file" ;;
esac
done
}
case "$1" in
"C-b") tr '\n' '\0' | xargs -0 setbg & ;;
"C-c") tr '\n' ' ' | xsel -i ;;
"C-g") tr '\n' '\0' | xargs -0 gimp & ;;
"C-d") tr '\n' '\0' | xargs -0 rm ;;
"C-comma") rotate 270 ;;
"C-period") rotate 90 ;;
"C-minus") rotate 180 ;;
esac
#!/usr/bin/env bash
while read -r file
do
case "$1" in
"b") setbg "$file" & ;;
"m") mv "$file" "$HOME/Pictures/rand" ;;
"r") convert -rotate 90 "$file" "$file" ;;
"R") convert -rotate -90 "$file" "$file" ;;
"f") convert -flop "$file" "$file" ;;
"y") echo -n "$file" | xsel -i & ;;
"d") rm "$file" ;;
"g") gimp "$file" & ;;
esac
done

View File

@ -5,9 +5,7 @@ alias m='neomutt'
alias r='ranger'
alias pmix='ncpamixer'
alias amix='alsamixer'
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
alias v='$EDITOR'
alias irc='irssi'
alias play='ncmpcpp'
alias torr='transmission-remote-cli'
@ -20,10 +18,10 @@ alias help='run-help'
alias p='pacui'
alias sr='sr -browser=$CLIBROWSER'
alias surfraw='surfraw -browser=$BROWSER'
alias foxy='FoxDot & disown'
alias bm='bashmount'
alias kat='cat'
alias nb='newsboat --quiet'
alias foxy='FoxDot & disown'
# MAXIMUM VERBOSITY YIELDS MAXIMUM RESULTS
alias chmod='chmod -v'
@ -55,19 +53,20 @@ alias free='free -ht'
alias du='du -d1 -h | sort -rh'
alias info='info --vi-keys'
alias inxi='inxi -Fz'
alias slop="slop --highlight --tolerance=0 --color=0.3,0.4,0.6,0.4 -f '%wx%h+%x+%y'"
alias ping='ping -c 5 '
alias dd='dd status=progress'
alias dirs='dirs -v -p'
alias dfc='dfc -dmT'
alias diff='diff --color=auto'
# Comandos
alias sudo='sudo '
alias chau="bspc quit 1"
alias path='echo -e ${PATH//:/\\n}'
alias compare='grep -nFxvf'
alias pwn='chmod +x'
alias ta='tmux attach -t'
alias tk='tmux kill-session -t'
alias tsq='killall transmission-daemon 2> /dev/null'
alias tsl='transmission-remote --list'
alias tsl='transmission-remote --list'
alias tsx='transmission-remote --remove-and-delete -t'
alias tsr='transmission-remote --remove -t'

View File

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Application
Name=Mail
Exec=/usr/bin/termite -e neomutt %u

View File

@ -3,7 +3,7 @@ Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=sxiv -p -a %f
Exec=sxiv -p -b -a %f
Name=sxiv-gif
Comment=Custom definition for sxiv
MimeType=image/gif

View File

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Application
Name=Text editor
Exec=/usr/bin/termite --name=flota -e nvim %u

View File

@ -0,0 +1,4 @@
[Desktop Entry]
Type=Application
Name=Torrent
Exec=/usr/bin/env tsa %U

19
.zshrc
View File

@ -128,14 +128,6 @@ foreach programa (
source /usr/share/$programa
}
foreach plugin (
zsh-autopair/autopair.zsh
zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
zsh-history-substring-search/zsh-history-substring-search.zsh
) {
source /usr/share/zsh/plugins/$plugin
}
foreach extra (
agkozak-zsh-prompt/agkozak-zsh-prompt.plugin.zsh
zsh-completions/zsh-completions.plugin.zsh
@ -146,15 +138,26 @@ foreach extra (
extras.zsh
aliases.plugin.zsh
dotfiles.zsh
zsh-system-clipboard/zsh-system-clipboard.zsh
) {
source $MODULES_DIR/$extra
}
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
AGKOZAK_BLANK_LINES=1
AGKOZAK_CUSTOM_SYMBOLS=( '⇣⇡' '⇣' '⇡' '+' 'x' '!' '>' '?' )
AGKOZAK_CUSTOM_PROMPT='%(?..%B%F{red}(%?%)%f%b )'
AGKOZAK_CUSTOM_PROMPT+=$'%B%F{blue}%2v%f%b '
AGKOZAK_CUSTOM_PROMPT+='%F{green}%(4V.:.%(!.%#.$))%f '
AGKOZAK_PROMPT_DIRTRIM=0
foreach plugin (
zsh-autopair/autopair.zsh
zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
zsh-history-substring-search/zsh-history-substring-search.zsh
) {
source /usr/share/zsh/plugins/$plugin
}
# }}}
# vim:foldmethod=marker:foldlevel=0

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 " You have ${nb_pac} ${nb_aur} updates"
notify-send "Updates" " ${nb_pac} ${nb_aur} available"
fi

4
bin/ae Executable file
View File

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

View File

@ -6,7 +6,7 @@ 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 "You've got mail" " $2 new message(s) in \`$1\` " ;}
# Run mbsync. You can feed this script different settings.
mbsync -a "$@"

View File

@ -1,3 +1,3 @@
#!/bin/bash
sxiv -p -a "$@"
sxiv -p -b -a "$@"

View File

@ -42,7 +42,7 @@ target="$(abspath "$1")"
count="$(listfiles | grep -a -m 1 -ZznF "$target" | cut -d: -f1)"
if [ -n "$count" ]; then
listfiles | xargs -0 sxiv -n "$count" --
listfiles | xargs -0 sxiv -p -b -n "$count" --
else
sxiv -- "$@" # fallback
sxiv -p -b -- "$@" # fallback
fi

View File

@ -4,9 +4,9 @@ set -euf -o pipefail
TRANS_PID=$(pidof transmission-daemon)
if [[ $TRANS_PID ]]; then
transmission-remote --add "$1"
transmission-remote --add "$@"
else
tsd
sleep 5
transmission-remote --add "$1"
transmission-remote --add "$@"
fi

View File

@ -1,55 +0,0 @@
#!/usr/bin/env bash
set -euf -o pipefail
# You can call this script like this:
# $ volumen up
# $ volumen down
# $ volumen mute
# Script modified from 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/volume.sh
function get_volume {
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1
}
function is_mute {
amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null
}
function send_notification {
iconSound="/home/deadguy/.local/share/icons/ArchLabs-Light/24x24/actions/audio-volume-high.svg"
iconMuted="/home/deadguy/.local/share/icons/ArchLabs-Light/24x24/actions/audio-volume-muted.svg"
if is_mute ; then
dunstify -i $iconMuted -r 2593 -u low "mute"
else
volume=$(get_volume)
# Make the bar with the special character ─ (it's not dash -)
# https://en.wikipedia.org/wiki/Box-drawing_character
bar=$(seq --separator="─" 0 "$((volume / 5))" | sed 's/[0-9]//g')
# Send the notification
dunstify -i $iconSound -r 2593 -u low " $bar"
fi
}
case $1 in
up)
# set the volume on (if it was muted)
amixer -q set Master on > /dev/null
# up the volume (+ 5%)
amixer -q sset Master 5%+ > /dev/null
send_notification
;;
down)
amixer -q set Master on > /dev/null
amixer -q sset Master 5%- > /dev/null
send_notification
;;
mute)
# toggle mute
amixer -q set Master 1+ toggle > /dev/null
send_notification
;;
esac