This commit is contained in:
whoami 2024-08-11 13:37:40 +00:00
parent 5ac39bd9b7
commit b50d8e41c6
8 changed files with 119 additions and 19 deletions

2
.tmux.conf Normal file
View File

@ -0,0 +1,2 @@
set -g status off
set-option -g destroy-unattached on

4
.zshrc
View File

@ -1,3 +1,5 @@
tmux
clear
PS1="# "
bindkey -v
@ -30,7 +32,7 @@ alias m="mpv ~/music/*"
alias mr="mpv ~/music/* --shuffle"
alias ms="ms"
alias a="startx"
alias fm="ranger"
alias fm="lfimg"
alias proton="STEAM_COMPAT_CLIENT_INSTALL_PATH=~/.local/share/Steam/ STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata ~/.local/share/Steam/compatibilitytools.d/GE-Proton9-9/proton run $1"
alias sxiv="sxiv -a"
alias irc="weechat"

View File

@ -1,6 +1,6 @@
while true; do
time=$(date +" %A %d.%m.%Y  %I:%M:%S")
time=$(date +" %d/%m/%Y  %I:%M:%S %p")
audio=$(pamixer --get-volume-human)
echo "$audio $time "
sleep 0.3s
echo "$audio $time "
sleep 0.1s
done

2
config/lf/cleaner Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
[ -n "$FIFO_UEBERZUG" ] && printf '{"action":"remove","identifier":"preview"}\n' >"$FIFO_UEBERZUG"

5
config/lf/lfrc Normal file
View File

@ -0,0 +1,5 @@
set previewer ~/.config/lf/previewer
set cleaner ~/.config/lf/cleaner
set sortby time
set info time
set reverse true

55
config/lf/previewer Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
draw() {
path="$(readlink -f -- "$1" | sed 's/\\/\\\\/g;s/"/\\"/g')"
printf '{"action":"add","identifier":"preview","x":%d,"y":%d,"width":%d,"height":%d,"scaler":"contain","scaling_position_x":0.5,"scaling_position_y":0.5,"path":"%s"}\n' \
"$x" "$y" "$width" "$height" "$path" >"$FIFO_UEBERZUG"
exit 1
}
hash() {
cache="$HOME/.cache/lf/$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f -- "$1")" | sha256sum | cut -d' ' -f1).jpg"
}
cache() {
if ! [ -f "$cache" ]; then
dir="$(dirname -- "$cache")"
[ -d "$dir" ] || mkdir -p -- "$dir"
"$@"
fi
draw "$cache"
}
file="$1"
width="$2"
height="$3"
x="$4"
y="$5"
case "$(file -Lb --mime-type -- "$file")" in
image/*)
if [ -n "$FIFO_UEBERZUG" ]; then
# ueberzug doesn't handle image orientation correctly
orientation="$(magick identify -format '%[orientation]\n' -- "$file")"
if [ -n "$orientation" ] \
&& [ "$orientation" != Undefined ] \
&& [ "$orientation" != TopLeft ]; then
hash "$file"
cache magick -- "$file" -auto-orient "$cache"
else
draw "$file"
fi
fi
;;
video/*)
if [ -n "$FIFO_UEBERZUG" ]; then
hash "$file"
cache ffmpegthumbnailer -i "$file" -o "$cache" -s 0
fi
;;
text/*)
exec cat "$file"
;;
esac
file -Lb -- "$file" | fold -s -w "$width"
exit 0

View File

@ -1,31 +1,36 @@
super + b
firefox
super + p
scrot -s -f -i ~/images/screenshots/$(date +"%d-%m-%Y_%H-%M-%S").png
super + shift + p
scrot ~/images/screenshots/$(date +"%d-%m-%Y_%H-%M-%S").png
super + ctrl + p
f=$(date +"%d-%m-%Y_%H-%M-%S"); scrot -s -f -i ~/images/screenshots/$f.png; cat ~/images/screenshots/$f.png | xclip -sel c -t image/png
super + Return
alacritty
st
super + d
dmenu_run -l 25
super + b
firefox
super + o
alacritty -e ranger
st -e lfimg
super + a
st -e pulsemixer
super + p
flameshot gui -p ~/images/screenshots
super + shift + p
flameshot full -p ~/images/screenshots
super + ctrl + p
flameshot gui -c -p ~/images/screenshots
super + shift + ctrl + p
flameshot full -c -p ~/images/screenshots
super + i
bookmarks
super + shift + l
i3lock -u -e
super + {comma,period}
pactl set-sink-volume @DEFAULT_SINK@ {-5%, +5%}
super + m
pactl set-sink-mute @DEFAULT_SINK@ toggle
#super + {1, 2, 3, 4, 5, 6}
# wmctrl -s {0, 1, 2, 3, 4, 5}
#super + q
# xkill
#super + d
# xfce4-popup-whiskermenu
#ctrl + super + t
# alacritty
# xdo kill

29
scripts/lfimg Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
set -euf
if [ -n "${DISPLAY-}" ] && [ -z "${FIFO_UEBERZUG-}" ]; then
export FIFO_UEBERZUG="${TMPDIR:-/tmp}/lf-ueberzug-$$"
cleanup() {
exec 3>&-
rm -- "$FIFO_UEBERZUG"
}
mkfifo -- "$FIFO_UEBERZUG"
# Execute ueberzug in a loop in case it crashes. Ueberzug dies if its
# associated window is closed. This breaks image previews when using tmux and
# reattaching to an existing session.
while ! ueberzug layer -s <"$FIFO_UEBERZUG"; do :; done &
# Open the FIFO for writing. FIFO readers receive an EOF once all writers
# have closed their respective file descriptors. Holding a file descriptor
# will effectively keep ueberzug alive as long as lf lives.
exec 3>"$FIFO_UEBERZUG"
trap cleanup EXIT
# Start lf without passing in the file descriptor. This is done to avoid the
# lf server being passed the file descriptor, which would cause ueberzug to
# live longer than is strictly necessary.
lf "$@" 3>&-
else
exec lf "$@"
fi