summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.config/dunst/dunstrc2
-rw-r--r--.config/env1
-rw-r--r--.config/imv/config64
-rw-r--r--.config/lf/lfrc10
-rwxr-xr-x.config/wayland/init.sh46
-rwxr-xr-x.local/bin/linkview19
6 files changed, 133 insertions, 9 deletions
diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc
index 493a8a1..5171744 100644
--- a/.config/dunst/dunstrc
+++ b/.config/dunst/dunstrc
@@ -1,5 +1,5 @@
[global]
- monitor = 0
+ monitor = 1
follow = none
width = (200, 800)
origin = top-right
diff --git a/.config/env b/.config/env
index 78d765b..afc6d1d 100644
--- a/.config/env
+++ b/.config/env
@@ -99,6 +99,7 @@ export MPD_HOST="$XDG_DATA_HOME"/mpd/socket
export RUSTFLAGS='-L /usr/local/lib'
export WWW_HOME='https://start.duckduckgo.com/'
export YTFZF_HIST='0'
+export WLR_DRM_NO_ATOMIC=1
# PATH
export PATH="$HOME"/.local/bin:"$HOME"/.local/bin/status:/usr/local/llvm13/bin:"$HOME"/.pyenv/bin:"$PATH"
diff --git a/.config/imv/config b/.config/imv/config
new file mode 100644
index 0000000..21452a0
--- /dev/null
+++ b/.config/imv/config
@@ -0,0 +1,64 @@
+# Default config for imv
+
+[options]
+
+# Suppress built-in key bindings, and specify them explicitly in this
+# config file.
+background = 1d2021
+suppress_default_binds = true
+
+[aliases]
+# Define aliases here. Any arguments passed to an alias are appended to the
+# command.
+# alias = command to run
+
+[binds]
+# Define some key bindings
+q = quit
+# y = exec echo working!
+
+# Image navigation
+p = prev
+<bracketleft> = prev
+<Ctrl+b> = prev
+n = next
+<bracketright> = next
+<Ctrl+f> = next
+gg = goto 1
+<Shift+G> = goto -1
+
+# Panning
+j = pan 0 -50
+k = pan 0 50
+h = pan 50 0
+l = pan -50 0
+
+# Zooming
+<Up> = zoom 1
+<Shift+plus> = zoom 1
+i = zoom 1
+<Down> = zoom -1
+<minus> = zoom -1
+o = zoom -1
+
+# Rotate Clockwise by 90 degrees
+<Ctrl+r> = rotate by 90
+
+# Other commands
+x = close
+f = fullscreen
+d = overlay
+m = exec echo $imv_current_file
+c = center
+s = scaling next
+<Shift+S> = upscaling next
+a = zoom actual
+r = reset
+
+# Gif playback
+<period> = next_frame
+<space> = toggle_playing
+
+# Slideshow control
+t = slideshow +1
+<Shift+T> = slideshow -1
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index 563c155..19653c1 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -14,6 +14,11 @@ set previewer '~/.config/lf/scope'
# cmds/functions
cmd open ${{
+ if [ -n "$WAYLAND_DISPLAY" ]; then
+ IMAGER=imv
+ else
+ IMAGER="nsxiv -aibo"
+ fi
case $(file --mime-type "$(readlink -f $f)" -b) in
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
application/vnd.openxmlformats-officedocument.wordprocessingml.document) docx2txt $f | $PAGER ;;
@@ -23,8 +28,9 @@ cmd open ${{
text/*|application/json|inode/x-empty) bat --style=plain --tabs 4 --paging=always -f $fx ;;
image/x-xcf) gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;;
- image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
- nsxiv -aibof 2>/dev/null | while read -r file; do
+ image/*)
+ rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
+ $IMAGER 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
diff --git a/.config/wayland/init.sh b/.config/wayland/init.sh
index c8a1b91..47fee53 100755
--- a/.config/wayland/init.sh
+++ b/.config/wayland/init.sh
@@ -1,4 +1,48 @@
#!/bin/sh
-swaybg --image pics/wp.png &
+case $(hostname -s) in
+ mother)
+ icon=" "
+ mpd="mpd"
+ xscr="xscreensaver --no-splash"
+ sleep="sleep 1"
+ ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1"
+ host="mother"
+ doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan
+ wlr-randr --output DP-3 --off
+ ;;
+ po-rbo)
+ icon=" "
+ mpd="mpd"
+ xscr="xscreensaver"
+ sleep="sleep 0.1"
+ ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1"
+ host="po-rbo"
+ doas mkdir /var/run/r_bousset && doas chown -v r_bousset: /var/run/r_bousset
+ ;;
+ mars)
+ icon=" "
+ mpd="musicpd"
+ xscr="xscreensaver --no-splash"
+ sleep="gsleep 1"
+ ping="ping -c1 -t1 9.9.9.9 >/dev/null 2>&1"
+ host="mars"
+ doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan
+ ;;
+esac
+
+startif() {
+ pidof "$(basename "$1")" >/dev/null || "$@" >/dev/null 2>&1 &
+}
+
+startif dunst
+startif swaybg --image pics/wp.png &
+pgrep $mpd >/dev/null || $mpd >/dev/null 2>&1
+startif pipewire
+sleep 1
+startif pipewire-pulse
+sleep 1
+startif wireplumber
+startif copyq
+notify-send -u normal 'Welcome' "$icon Welcome back, partner!"
firefox &
diff --git a/.local/bin/linkview b/.local/bin/linkview
index 1523e33..d07a8a6 100755
--- a/.local/bin/linkview
+++ b/.local/bin/linkview
@@ -14,13 +14,20 @@ use POSIX qw(setsid);
use feature qw(switch);
no warnings qw(experimental::smartmatch);
+my $menu = "dmenu";
+my $IMGVIEW_PATH = 'nsxiv -b -a';
+
+if (defined $ENV{WAYLAND_DISPLAY}) {
+ $menu = "wmenu -f 'BigBlueTermPlus Nerd Font 13'";
+ $IMGVIEW_PATH = 'imv';
+}
+
use constant {
TERMINAL_PATH => $TERMINAL,
MPV_PATH => 'mpv',
YTDL_PATH => 'yt-dlp',
FETCH_PATH => 'fetch',
CURL_PATH => 'curl',
- IMGVIEW_PATH => 'nsxiv',
ZATHURA_PATH => 'zathura',
W3M_PATH => 'w3m',
BROWSER_PATH => $BROWSER,
@@ -88,7 +95,7 @@ sub open_link
$ret = -1;
if ($a eq "ytdl") {
$list = QUAL_LIST;
- $quality = `printf "$list" | dmenu -i -l 8`;
+ $quality = `printf "$list" | $menu -l 8`;
if (not $quality) {
exit 0;
}
@@ -328,8 +335,10 @@ sub open_link
$file_name = $tmp;
$file_name =~ s/.+\///g;
chomp $file_name;
- system(IMGVIEW_PATH, '-b', '-a', $file_name);
+ system("magick", $file_name, $file_name . ".jpg");
+ system($IMGVIEW_PATH . " " . $file_name . ".jpg");
unlink($file_name);
+ unlink($file_name . ".jpg");
exit 0;
}
}
@@ -356,7 +365,7 @@ sub open_link
}
}
if ($a eq "nsxiv") {
- exec(IMGVIEW_PATH, '-b', '-a', $file_name);
+ exec($IMGVIEW_PATH . " " . $file_name);
}
else {
exec(ZATHURA_PATH, $file_name);
@@ -393,7 +402,7 @@ sub dmenu_prompt
my $answer;
my $list = PROG_LIST;
- $answer = `printf "$list\nURL: $url\n" | dmenu -i`;
+ $answer = `printf "$list\nURL: $url\n" | $menu -i`;
chomp $answer;
return $answer;
}