Update 2023-11-01 10:14 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2023-11-01 10:14:00 +01:00
parent 09f9fd0045
commit f02cbd8d82
6 changed files with 293 additions and 177 deletions

View File

@ -2,37 +2,77 @@
. $HOME/.bin/_config
KEYS="\
openbsd
tweety
dalek
cvs
dalek
git
github
inbox
make-web
mastodon
matrix
openbsd all
openbsd bugs
openbsd ports
openbsd tech
openbsd bugs
openbsd all
vorstand
reddit
shell
github
telegram
telegram-desktop
tweety
vorstand
"
SEL=$(printf "$KEYS" | $DMENU_CMD -p "Next key" -b -l 20)
case "$SEL" in
openbsd) texec "ssh -t openbsd.codevoid.de"; ;;
dalek) texec "ssh -t home.codevoid.de 'tmux -u attach || tmux -u'"; ;;
tweety) texec "ssh -t tweety.home.codevoid.de 'tmux -u attach || tmux -u'"; ;;
cvs) texec "ssh -t cvs.openbsd.org"; ;;
shell) texec "ssh -t shell.uugrn.org"; ;;
vorstand) texec "sftp vorstand@vorstand.uugrn.org"; ;;
inbox) texec "ksh -ic mutt"; ;;
*ports) texec "ksh -ic mutt-openbsd-ports"; ;;
*tech) texec "ksh -ic mutt-openbsd-tech"; ;;
*bugs) texec "ksh -ic mutt-openbsd-bugs"; ;;
github) chrome https://github.com; ;;
matrix) texec "gomuks" ; ;;
telegram) texec "tg" ; ;;
dalek)
texec "ssh -t home.codevoid.de 'tmux -u attach || tmux -u'"
;;
tweety)
texec "ssh -t tweety.home.codevoid.de 'tmux -u attach || tmux -u'"
;;
cvs)
texec "ssh -t cvs.openbsd.org"
;;
vorstand)
texec "sftp vorstand@vorstand.uugrn.org"
;;
inbox)
texec "ksh -ic mutt"
;;
reddit)
texec "tuir"
;;
mastodon)
texec "tuta"
;;
*ports)
texec "ksh -ic mutt-openbsd-ports"
;;
*tech)
texec "ksh -ic mutt-openbsd-tech"
;;
*bugs)
texec "ksh -ic mutt-openbsd-bugs"
;;
github)
$BROWSER https://github.com/c0dev0id
;;
git)
$BROWSER https://git.uugrn.org/sdk
;;
make-web)
texec 'ssh home.codevoid.de "cd ~/make-web && make install"'
$BROWSER https://home.codevoid.de
;;
matrix)
texec "gomuks"
;;
telegram)
texec "tg"
;;
telegram-desktop)
telegram-desktop
;;
esac

View File

@ -1,42 +1,45 @@
#!/bin/ksh
if [ -z "$1" ];
f=$1
if [ -z "$f" ];
then
print "Parameter missing."
exit 2
f="$(find $PWD $HOME $HOME/Downloads -maxdepth 1 -type f \
| sort -u \
| fzf -e -x -i)"
fi
###################################################
# URLS
###################################################
if print "$1" | egrep -qi '^shell:|^ushell:|^cvs:';
if print "$f" | egrep -qi '^shell:|^ushell:|^cvs:';
then
_server=${1%%:*}
_dir=${1#*:}
_server=${f%%:*}
_dir=${f#*:}
ssh -tt $_server "vim $_dir"
exit 0
fi
if print "$1" | egrep -qi '^http[s]{0,1}://';
if print "$f" | egrep -qi '^http[s]{0,1}://';
then
case "$1" in
*.mkv) mpv "$1"; ;;
*.mp4) mpv "$1"; ;;
*.webm) mpv "$1"; ;;
*) sacc "$1"; ;;
case "$f" in
*.mkv) mpv "$f"; ;;
*.mp4) mpv "$f"; ;;
*.webm) mpv "$f"; ;;
*) sacc "$f"; ;;
esac
${BROWSER:=vimb} "$1"
${BROWSER:=vimb} "$f"
exit 0
fi
if print "$1" | egrep -qi '^gopher://';
if print "$f" | egrep -qi '^gopher://';
then
case "$1" in
*.mkv) mpv "$1"; ;;
*.mp4) mpv "$1"; ;;
*.webm) mpv "$1"; ;;
*) sacc "$1"; ;;
case "$f" in
*.mkv) mpv "$f"; ;;
*.mp4) mpv "$f"; ;;
*.webm) mpv "$f"; ;;
*) sacc "$f"; ;;
esac
exit 0
fi
@ -45,7 +48,7 @@ fi
# REAL FILES
###################################################
if [ ! -f "$1" ];
if [ ! -f "$f" ];
then
print "Parameter is not a file."
exit 1
@ -55,15 +58,15 @@ fi
# EXTENSIONS
###################################################
EXT="$(print "${1##*.}" | tr '[:upper:]' '[:lower:]')"
EXT="$(print "${f##*.}" | tr '[:upper:]' '[:lower:]')"
case "$EXT" in
docx) libreoffice "$1"; ;;
xlsx) libreoffice "$1"; ;;
txt) vim "$1"; ;;
m2ts) mpv "$1"; ;;
sid) sidplay "$1"; ;;
out) kdump -RTf "$1" | less; ;;
docx) libreoffice "$f"; ;;
xlsx) libreoffice "$f"; ;;
txt) vim "$f"; ;;
m2ts) mpv "$f"; ;;
sid) sidplay "$f"; ;;
out) kdump -RTf "$f" | less; ;;
*) unset EXT; ;;
esac
@ -76,22 +79,22 @@ fi
# MIME TYPES
###################################################
case "$(file -ib "$1")" in
case "$(file -ib "$f")" in
# full qualified
application/ogg) ogg123 "$1"; ;;
application/pdf) mupdf-gl -XJA0 "$1"; ;;
application/postscript) mupdf-gl -XJA0 "$1"; ;;
application/vnd.oasis.opendocument.*) libreoffice "$1"; ;;
audio/mpeg) mpg123 "$1"; ;;
audio/midi) timidity "$1"; ;;
application/ogg) ogg123 "$f"; ;;
application/pdf) mupdf-gl -XJA0 "$f"; ;;
application/postscript) mupdf-gl -XJA0 "$f"; ;;
application/vnd.oasis.opendocument.*) libreoffice "$f"; ;;
audio/mpeg) mpg123 "$f"; ;;
audio/midi) timidity "$f"; ;;
# with wildcards
audio/*) mpv "$1"; ;;
video/*) mpv "$1"; ;;
image/webp) mpv "$1"; ;;
image/*) sxiv -N floating -g 1280x720+300+180 -ab "$1"; ;;
audio/*) mpv "$f"; ;;
video/*) mpv "$f"; ;;
image/webp) mpv "$f"; ;;
image/*) sxiv -N floating -g 1280x720+300+180 -ab "$f"; ;;
# can't handle
application/octet-stream) print "Sorry, can't handle: $1"; ;;
application/octet-stream) print "Sorry, can't handle: $f"; ;;
# vim can handle a lot!
*) vim "$1"; ;;
*) vim "$f"; ;;
esac

View File

@ -1,51 +1,23 @@
#!/bin/sh -e
. ${HOME}/.bin/_config
#
# SIGNAL HANDLER
#
trap cleanup 1 2 3 6
cleanup() {
rm -f "${_file_tmp}";
notify-send "sshot: Aborted..."
}
cleanup() { rm -f "$file"; }
#
# CONFIGURATION
#
_filename="$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
_file_dir="${HOME}/Downloads/Screenshots"
mkdir -p "$_file_dir"
# FILENAME
file="${HOME}/Downloads/Screenshots/$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
mkdir -p "$(dirname "$file")"
#
# TAKE SCREENSHOT
#
flameshot gui -p "${_file_dir}/${_filename}"
test -f "${_file_dir}/${_filename}" || exit 1
pngcrush -reduce "${_file_dir}/${_filename}"
flameshot gui -p "$file"
test -f "$file" || exit 1
# COMPRESS
test -f /usr/local/bin/pngcrush \
&& pngcrush -reduce "$file"
#
# UPLOAD
#
scp "${_file_dir}/${_filename}" sdk@home.codevoid.de:make-web/src/paste/
_SWM_WS=-1 texec "upload \"$file\""
#
# BUILD WEBSITE
#
ssh home.codevoid.de "cd make-web && make install"
#
# COPY TO CLIPBOARD
#
printf '%s' "https://home.codevoid.de/paste/${_filename}" | xclip
#
# PRINT TO STDOUT
#
echo "https://home.codevoid.de/paste/${_filename}"
echo "${_file_dir}/${_filename}"
#
# NOTIFY
#
notify-send "https://home.codevoid.de/paste/${_filename}"
notify-send "$(xclip -o)"

View File

@ -1,3 +1,3 @@
#!/bin/sh
xpick -h | tr -d '\n' | xclip
notify-send "$(xclip -o)"
notify-send "Copied: $(xclip -o)"

View File

@ -1,14 +1,27 @@
# Window Decoration
# __
# _________ ___ _____/ /_______ ______ ___
# / ___/ __ \/ _ \/ ___/ __/ ___/ | /| / / __ `__ \
# (__ ) /_/ / __/ /__/ /_/ / | |/ |/ / / / / / /
# /____/ .___/\___/\___/\__/_/ |__/|__/_/ /_/ /_/
# /_/ C-O-D-E-V-O-I-D E-D-I-T-I-O-N
#
# +--------------------------------------------------
# | WINDOW DECORATION
# +--------------------------------------------------
border_width = 2
color_focus = rgb:77/77/77
color_focus_maximized = rgb:28/28/28
color_focus_free = rgb:77/77/77
color_unfocus = rgb:47/47/47
color_unfocus_free = rgb:47/47/47
region_padding = 20
tile_gap = 24
region_padding = 6
tile_gap = 6
# Bar Settings
# +--------------------------------------------------
# | BAR SETTINGS
# +--------------------------------------------------
bar_border_width = 4
bar_border = rgb:18/18/18
bar_border_unfocus = rgb:18/18/18
@ -25,6 +38,11 @@ bar_action = cbar
bar_action_expand = 1
bar_at_bottom = 0
bar_format = +S +L  +R   +I   +M  +W +|1R +A %Y-%m-%d %H:%M
# +--------------------------------------------------
# | WORKSPACE LAYOUT
# +--------------------------------------------------
workspace_indicator = listall,markcurrent,markactive,markempty,noindexes
workspace_mark_current = ''
workspace_mark_active = ''
@ -35,6 +53,11 @@ stack_mark_horizontal_flip = ''
stack_mark_vertical = ''
stack_mark_vertical_flip = ''
stack_mark_max = ''
verbose_layout = 1
# +--------------------------------------------------
# | FOCUS BEHAVIOR
# +--------------------------------------------------
workspace_clamp = 1
warp_focus = 0
@ -42,20 +65,18 @@ warp_pointer = 0
cycle_visible = 0
focus_close_wrap = 1
focus_mode = default
verbose_layout = 1
click_to_raise = 1
# Custom Quirks
quirk[IPMIView20-IPMIView20:IPMIView20-IPMIView20] = FLOAT + ANYWHERE
# +--------------------------------------------------
# | QUIRKS
# +--------------------------------------------------
quirk[scratchpad] = FLOAT + ANYWHERE + FOCUSPREV
#quirk[Vimb] = NORESIZE
#quirk[qutebrowser] = NORESIZE
quirk[Nsxiv:tabbed] = NOFOCUSONMAP + FOCUSPREV
# Window Manager Keys
keyboard_mapping = ~/.config/spectrwm/spectrwm_map.conf
# +--------------------------------------------------
# | REGISTERED PROGRAMS
# +--------------------------------------------------
# Custom Programs
program[sterm] = sterm
bind[sterm] = MOD+Return
@ -109,3 +130,83 @@ program[xpick] = xpick_copy
bind[xpick] = MOD+Print
program[lock] = /usr/bin/false
# +--------------------------------------------------
# | KEYBOARD MAPPING
# +--------------------------------------------------
# BAR
bind[bar_toggle] = MOD+b
bind[bar_toggle_ws] = MOD+Shift+b
# LAYOUT
bind[cycle_layout] = MOD+l
bind[flip_layout] = MOD+Shift+l
bind[float_toggle] = MOD+space
bind[free_toggle] = MOD+Shift+space
# FOCUS
bind[focus_main] = MOD+m
bind[focus_next] = MOD+Down
#bind[focus_next] = MOD+Tab
bind[focus_prev] = MOD+Up
bind[focus_prev] = MOD+Shift+Tab
bind[focus_urgent] = MOD+u
#bind[focus_free] = MOD+Shift+BackSpace
# ICONFIY / HIDE
bind[iconify] = MOD+Shift+i
bind[uniconify] = MOD+i
# MASTER
bind[master_add] = MOD+comma
bind[master_del] = MOD+period
bind[master_grow] = MOD+Right
bind[master_shrink] = MOD+Left
bind[stack_dec] = MOD+Shift+comma
bind[stack_inc] = MOD+Shift+period
#bind[stack_reset] = MOD+Shift+space
bind[maximize_toggle] = MOD+f
# WS NAVIGATION
bind[ws_1] = MOD+1
bind[ws_2] = MOD+2
bind[ws_3] = MOD+3
bind[ws_4] = MOD+4
bind[ws_5] = MOD+5
bind[ws_6] = MOD+6
bind[ws_7] = MOD+7
bind[ws_8] = MOD+8
bind[ws_9] = MOD+9
bind[ws_10] = MOD+0
bind[ws_next_all] = MOD+Page_Down
bind[ws_prev_all] = MOD+Page_Up
bind[ws_prior] = MOD+Tab
# MOVE WINDOW TO OTHER WS
bind[rg_next] = MOD+dead_circumflex
bind[rg_prev] = MOD+Shift+dead_circumflex
bind[mvws_1] = MOD+Shift+1
bind[mvws_2] = MOD+Shift+2
bind[mvws_3] = MOD+Shift+3
bind[mvws_4] = MOD+Shift+4
bind[mvws_5] = MOD+Shift+5
bind[mvws_6] = MOD+Shift+6
bind[mvws_7] = MOD+Shift+7
bind[mvws_8] = MOD+Shift+8
bind[mvws_9] = MOD+Shift+9
bind[mvws_10] = MOD+Shift+0
# RENAME WS
bind[name_workspace] = MOD+r
# MOVE WINDOW WITHIN WS
bind[swap_main] = MOD+M
bind[swap_next] = MOD+Shift+Down
bind[swap_prev] = MOD+Shift+Up
# DELETE WINDOW
bind[wind_del] = MOD+q
bind[wind_kill] = MOD+Shift+q
bind[restart] = MOD+Shift+r

2
.kshrc
View File

@ -69,7 +69,7 @@ export TUIR_BROWSER
NNN_OPTS="cErxAJBR"
NNN_OPENER="nnn.sh"
NNN_FIFO=/tmp/nnn.fifo
NNN_PLUG='o:-!mpv "$nnn";x:!imagesort;p:!pdfarranger "$nnn" > /dev/null 2>&1 &'
NNN_PLUG='o:-!mpv "$nnn";u:!upload "$nnn";x:!imagesort;p:!pdfarranger "$nnn" > /dev/null 2>&1 &'
NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$"
NNN_COLORS='#0a1b2c3d;1234'
NNN_FCOLORS='c1e2272e006033f7c6d6abc4'