summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2025-09-08 21:29:37 +0200
committerJoe <rbo@gmx.us>2025-09-08 21:29:37 +0200
commitaccfed3e8994784fbe0381da0d6b0a18a26c59f1 (patch)
tree0819b013fbca68dc0fbdb922daef34b57b9da05f /.config
parentfuck my preview (diff)
downloaddotfiles-bsd-accfed3e8994784fbe0381da0d6b0a18a26c59f1.tar.gz
dotfiles-bsd-accfed3e8994784fbe0381da0d6b0a18a26c59f1.tar.bz2
dotfiles-bsd-accfed3e8994784fbe0381da0d6b0a18a26c59f1.tar.xz
dotfiles-bsd-accfed3e8994784fbe0381da0d6b0a18a26c59f1.tar.zst
dotfiles-bsd-accfed3e8994784fbe0381da0d6b0a18a26c59f1.zip
up
Diffstat (limited to '')
-rw-r--r--.config/env4
-rwxr-xr-x.config/nnn/plugins/joe_clipper76
-rw-r--r--.config/zsh/alias.zsh14
3 files changed, 92 insertions, 2 deletions
diff --git a/.config/env b/.config/env
index 8e811fa..a5508c4 100644
--- a/.config/env
+++ b/.config/env
@@ -99,7 +99,7 @@ export FZF_DEFAULT_COMMAND='fd -i -H -c never -j9 -E .git -E dotfiles-bsd -E .cc
export FZF_DEFAULT_OPTS='--height 60% --layout=reverse --border=left --tabstop=4'
export LESS='-R -c -S'
export MPD_HOST="$XDG_DATA_HOME"/mpd/socket
-export NNN_OPTS='aAdrRQ'
+export NNN_OPTS='aAderRQ'
export NNN_COLORS='4132'
export NNN_FCOLORS='030304020005060801ac0507'
export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"
@@ -110,7 +110,7 @@ export NNN_BATSTYLE='plain'
export NNN_PREVIEWIMGPROG='icat'
export NNN_PREVIEWVIDEO='tct'
export NNN_ICONLOOKUP=0
-export NNN_PLUG='t:joe_fzfcd;p:-joe_preview;P:-preview-tui;s:-!du -sh;f:-fzopen'
+export NNN_PLUG='t:joe_fzfcd;p:-preview-tui;s:-!du -sh;f:-fzopen;c:-joe_clipper'
export RUSTFLAGS='-L /usr/local/lib'
export WWW_HOME='https://start.duckduckgo.com/'
export YTFZF_HIST='0'
diff --git a/.config/nnn/plugins/joe_clipper b/.config/nnn/plugins/joe_clipper
new file mode 100755
index 0000000..8c0fa5d
--- /dev/null
+++ b/.config/nnn/plugins/joe_clipper
@@ -0,0 +1,76 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Cwd qw(cwd);
+
+sub close_io
+{
+ open STDIN, '<', '/dev/null' or die $!;
+ open STDOUT, '>', '/dev/null' or die $!;
+ open STDERR, '>', '/dev/null' or die $!;
+ return;
+}
+
+sub clip_img
+{
+ my ($file) = @_;
+ my $pid;
+
+ $pid = fork();
+ if ($pid == 0) {
+ system("magick $file png:- | xclip -selection clipboard -t image/png");
+ exec(
+ 'notify-send',
+ '-t', '2000',
+ 'clipped image',
+ ' clipped image'
+ );
+ }
+ return;
+}
+
+sub clip_raw
+{
+ my ($file) = @_;
+
+ my $pid;
+
+ $pid = fork();
+ if ($pid == 0) {
+ system( "xclip -selection clipboard $file");
+ exec(
+ 'notify-send',
+ '-t', '2000',
+ 'clipped file',
+ ' clipped file'
+ );
+ }
+ return;
+}
+
+sub clip
+{
+ my ($file, $mimetype) = @_;
+
+ return clip_img($file) if $mimetype =~ /^image\//;
+ clip_raw($file);
+ return;
+}
+
+sub joe_clipper
+{
+ my $file = cwd() . '/' . $ARGV[0];
+ my $mimetype;
+
+ if (-d $file) {
+ return;
+ }
+ $mimetype=`file -bL --mime-type -- "$file"`;
+ clip($file, $mimetype);
+ return;
+}
+
+joe_clipper();
+
+__END__
diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh
index 41b090c..bcd4cf8 100644
--- a/.config/zsh/alias.zsh
+++ b/.config/zsh/alias.zsh
@@ -69,6 +69,20 @@ alias \
dgit='git --git-dir=$HOME/docs/dotfiles-bsd --work-tree=$HOME' \
confgit='git --git-dir=$HOME/docs/conffiles-bsd --work-tree=/' \
git-pull-all='git branch -r | sed "1d;s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; git checkout "${remote#origin/}"; git pull; done'
+b() {
+ oldpath="$(pwd)"
+ cd $HOME/.config/nnn/bookmarks
+ dir=$(fzf)
+ if [ -z "$dir" ]; then
+ cd "$oldpath"
+ return
+ fi
+ if ! cd "$dir"; then
+ cd "$oldpath"
+ return
+ fi
+ nnn
+}
bssh() {
user='rbousset'
host='bastion'