diff options
Diffstat (limited to '')
-rw-r--r-- | .config/alacritty/alacritty.toml | 2 | ||||
-rw-r--r-- | .config/mpv/mpv.conf | 1 | ||||
-rwxr-xr-x | .local/bin/dmhc | 83 | ||||
-rw-r--r-- | .local/state/w3m/history | 1 |
4 files changed, 86 insertions, 1 deletions
diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 9cd76d4..2212b73 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -62,7 +62,7 @@ x = 0 y = 0 [[hints.enabled]] -command = { program = "linkview", args = [ "-e", "linkview" ] } +command = { program = "alacritty", args = [ "-e", "linkview" ] } post_processing = true persist = false regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:..|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-<>\"\\s{-}\\^⟨⟩`]+" diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 749a32a..616e73b 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -5,5 +5,6 @@ cache=yes demuxer-max-bytes=4GiB demuxer-max-back-bytes=4GiB ytdl=yes +ytdl-raw-options-append=extractor-args=youtube:player-client=default,-tv_simply script-opts=ytdl_hook-ytdl_path=yt-dlp,ytdl_hook-try_ytdl_first=yes,ytdl_hook-exclude="%.webm$|%.ts$|%.mp3$|%.m3u8$|%.m3u$|%.mkv$|%.mp4$|%.VOB$" term-osd-bar=yes diff --git a/.local/bin/dmhc b/.local/bin/dmhc new file mode 100755 index 0000000..2db5064 --- /dev/null +++ b/.local/bin/dmhc @@ -0,0 +1,83 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use POSIX qw(setsid); + +use constant PIDFILE => '/tmp/halfcab.pid'; + + +my @keys = ( + 'warm', + 'sex', + 'purp', + 'blues', + 'burn', + 'white', + 'off', + 'scr', +); + +my @values = ( + 'hc 214 90 10', + 'hc 255 0 0', + 'hc 255 0 255', + 'hc 150 150 255', + 'hc 214 50 0', + 'hc 255 200 150', + 'hc 0 0 0', + '', +); + +my %list; +@list{@keys} = @values; + +sub dmhc +{ + my $choice; + my $url; + my $pid; + my $prefix; + my $list; + my $color; + my $read_pid; + + $color = '#cc241d'; + if (@ARGV == 1) { + $color = $ARGV[0]; + } + $list = join("\n", @keys); + $choice = `printf "$list" | dmenu -i -sb '$color' -shb '$color'`; + chomp($choice); + return unless exists $list{$choice}; + if (-e PIDFILE) { + open(my $fh, '<', PIDFILE); + $read_pid = <$fh>; + chomp($read_pid); + close($fh); + kill('TERM', $read_pid); + while (kill(0, $read_pid) != 0) { + sleep(0.05); + } + unlink(PIDFILE); + } + $pid = fork(); + if ($pid > 0 && $choice eq 'scr') { + open(my $fh, '>', PIDFILE) or die $!; + print $fh $pid; + close($fh); + } elsif (not $pid) { + exec($list{$choice}) if $choice ne 'scr'; + setsid(); + my $grep = system( + 'xrandr | command grep -E "DP-4.+\+1920" >/dev/null 2>&1' + ); + exec('hc 1920') if not $grep; + exec('hc'); + } + return; +} + +dmhc(); + +__END__ diff --git a/.local/state/w3m/history b/.local/state/w3m/history index 842aa12..6c05784 100644 --- a/.local/state/w3m/history +++ b/.local/state/w3m/history @@ -8,3 +8,4 @@ file:///home/r_bousset/nuabee.fr https://nuabee.fr/ https://jozan.org/ https://lite.duckduckgo.com/lite/ +https://paste.linux.chat/?fe7de19db307af0f#BQyp2fmwMS7JdMp7rjMy3AnupQeJ77Gwnvmor1AvbSZB |