Browse Source

Add playlist RTMP streaming script

Frans Bergman 5 years ago
parent
commit
66d5ac91b1

+ 1 - 0
.aliases

@@ -11,3 +11,4 @@ alias xu="xi -Su"
 alias xr="sudo xbps-remove -R"
 
 alias e="sudo emerge -a"
+alias a="sudo zfs load-key tank/media; sudo zfs mount -a; ranger /tank/media/anime"

+ 0 - 2
.config/mpv/mpv.conf

@@ -27,8 +27,6 @@ ytdl-format=best
 # Cache {{{
 
 cache=yes
-cache-default=4000000
-cache-backbuffer=250000
 demuxer-max-bytes=1147483647
 
 # }}}

+ 9 - 0
.config/nvim/init.vim

@@ -53,6 +53,8 @@ nnoremap <leader>u :!ctags -R .<CR>
 
 nnoremap <esc> :set nohlsearch<CR>
 
+tnoremap <Esc> <C-\><C-n>
+
 " Local (scope) replace
 nnoremap gr gd[{V%::s/<C-R>///gc<left><left><left>
 
@@ -110,6 +112,7 @@ Plug 'raimondi/delimitmate'
 Plug 'fisadev/dragvisuals.vim'
 Plug 'dense-analysis/ale'
 Plug 'maralla/completor.vim'
+Plug 'artur-shaik/vim-javacomplete2'
 Plug 'junegunn/fzf'
 Plug 'Chiel92/vim-autoformat'
 Plug 'preservim/nerdtree'
@@ -132,6 +135,11 @@ augroup rust
     autocmd FileType rust let b:delimitMate_smart_quotes='\%(\w\|[^[:punct:][:space:]]\|\%(\\\\\)*\\\)\%#\|\%#\%(\w\|[^[:space:][:punct:]]\)\|\<\%#\|\&\%#'
 augroup END
 
+augroup java
+    autocmd!
+    autocmd FileType java setlocal omnifunc=javacomplete#Complete
+augroup END
+
 " Use TAB to complete when typing words, else inserts TABs as usual.  Uses
 " dictionary, source files, and completor to find matching words to complete.
 
@@ -160,3 +168,4 @@ inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
 " Use tab to trigger auto completion.
 inoremap <expr> <Tab> Tab_Or_Complete()
 " }}}
+

+ 5 - 5
.config/polybar/config

@@ -19,9 +19,9 @@ secondary = ${xrdb:color2:#222}
 alert = ${xrdb:color3:#222}
 
 [bar/dp2]
-monitor = ${env:MONITOR:DP-2}
+monitor = ${env:MONITOR:DisplayPort-1}
 width = 100%
-height = 27
+height = 20
 ;offset-x = 1%
 ;offset-y = 1%
 ;radius = 6.0
@@ -30,7 +30,7 @@ fixed-center = false
 background = ${colors.background}
 foreground = ${colors.foreground}
 
-line-size = 3
+line-size = 1
 line-color = #f00
 
 ;border-size = 4
@@ -42,7 +42,7 @@ padding-right = 2
 module-margin-left = 1
 module-margin-right = 2
 
-font-0 = "xos4 Terminus:style=Bold:pixelsize=18;1"
+font-0 = "Hack:style=Regular:pixelsize=10;1"
 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
 font-2 = "Wuncon Siji:pixelsize=14;1"
 font-3 = "HanaMinA,花園明朝A:pixelsize=14;1"
@@ -263,7 +263,7 @@ label = %date% %time%
 type = internal/volume
 
 format-volume = <label-volume> <bar-volume>
-label-volume = VOL: %percentage%%
+label-volume = %percentage%%
 label-volume-foreground = ${root.foreground}
 
 format-muted-prefix = " "

+ 112 - 0
.config/sxhkd/sxhkdrc

@@ -21,6 +21,12 @@ alt + shift + s
 alt + shift + f
     $BROWSER
 
+alt + shift + Return
+    $TERMINAL
+
+alt + p
+    dmenu_run
+
 # Media controls
 XF86AudioRaiseVolume
     pulseaudio-ctl up 4
@@ -35,3 +41,109 @@ XF86AudioNext
     playerctl next || mpc next
 XF86AudioPrev
     playerctl previous || mpc prev
+
+#
+# bspwm hotkeys
+#
+
+## quit/restart bspwm
+#alt + alt + {q,r}
+#    bspc {quit,wm -r}
+#
+## close and kill
+#alt + {_,shift + }w
+#    bspc node -{c,k}
+#
+## alternate between the tiled and monocle layout
+#alt + m
+#    bspc desktop -l next
+#
+## send the newest marked node to the newest preselected node
+#alt + y
+#    bspc node newest.marked.local -n newest.!automatic.local
+#
+## swap the current node and the biggest node
+#alt + g
+#    bspc node -s biggest
+#
+##
+## state/flags
+##
+#
+## set the window state
+#alt + {t,shift + t,s,f}
+#    bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
+#
+## set the node flags
+#alt + ctrl + {m,x,y,z}
+#    bspc node -g {marked,locked,sticky,private}
+#
+##
+## focus/swap
+##
+#
+## focus the node in the given direction
+#alt + {_,shift + }{h,j,k,l}
+#    bspc node -{f,s} {west,south,north,east}
+#
+## focus the node for the given path jump
+#alt + {p,b,comma,period}
+#    bspc node -f @{parent,brother,first,second}
+#
+## focus the next/previous node in the current desktop
+#alt + {_,shift + }c
+#    bspc node -f {next,prev}.local
+#
+## focus the next/previous desktop in the current monitor
+#alt + bracket{left,right}
+#    bspc desktop -f {prev,next}.local
+#
+## focus the last node/desktop
+#alt + {grave,Tab}
+#    bspc {node,desktop} -f last
+#
+## focus the older or newer node in the focus history
+#alt + {o,i}
+#    bspc wm -h off; \
+#    bspc node {older,newer} -f; \
+#    bspc wm -h on
+#
+## focus or send to the given desktop
+#alt + {_,shift + }{1-9,0}
+#    bspc {desktop -f,node -d} '^{1-9,10}'
+#
+##
+## preselect
+##
+#
+## preselect the direction
+#alt + ctrl + {h,j,k,l}
+#    bspc node -p {west,south,north,east}
+#
+## preselect the ratio
+#alt + ctrl + {1-9}
+#    bspc node -o 0.{1-9}
+#
+## cancel the preselection for the focused node
+#alt + ctrl + space
+#    bspc node -p cancel
+#
+## cancel the preselection for the focused desktop
+#alt + ctrl + shift + space
+#    bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
+#
+##
+## move/resize
+##
+#
+## expand a window by moving one of its side outward
+#alt + alt + {h,j,k,l}
+#    bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
+#
+## contract a window by moving one of its side inward
+#alt + alt + shift + {h,j,k,l}
+#    bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
+#
+## move a floating window
+#alt + {Left,Down,Up,Right}
+#    bspc node -v {-20 0,0 20,0 -20,20 0}

+ 4 - 2
.profile

@@ -3,14 +3,16 @@
 # the default umask is set in /etc/profile; for setting the umask
 # for ssh logins, install and configure the libpam-umask package.
 #umask 022
+source /etc/profile
 
 export GOPATH="$HOME/go"
 export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
-export PATH="/usr/lib/distcc/bin:$PATH:$HOME/.cargo/bin:$GOPATH/bin:$HOME/.scripts:$HOME/bin"
-export BROWSER="icecat"
+export PATH="$PATH:$HOME/.cargo/bin:$GOPATH/bin:$HOME/.scripts:$HOME/bin"
+export BROWSER="firefox"
 export READER="zathura"
 export MAKEFLAGS="-j$(nproc)"
 export EDITOR="vim"
+export TERMINAL="st"
 export LESSOPEN="|lesspipe.sh %s"
 
 # less colors

+ 1 - 1
.scripts/compiler

@@ -1,2 +1,2 @@
 #!/bin/sh
-refer -PS -e -p ~/git/university-documents/bibliography "$1" | groff -ms -e -k -t -U -T pdf > "${1%.*}.pdf"
+refer -PS -e -p ~/git/university-documents/bibliography "$1" | groff -ms -e -k -t -U -T ps > "${1%.*}.ps"

+ 4 - 4
.scripts/exit_menu.sh

@@ -12,16 +12,16 @@ EOF
 
 case $CHOICE in
     "Lock")
-        ~/.scripts/lock.sh
+        ~/.scripts/lock.sh && xset dpms force standby
         ;;
     "Sleep")
-        ~/.scripts/lock.sh && sudo zzz
+        ~/.scripts/lock.sh && sudo s2ram
         ;;
     "Hibernate")
-        ~/.scripts/lock.sh && sudo ZZZ
+        ~/.scripts/lock.sh && {sudo ZZZ || sudo pm-hibernate }
         ;;
     "Exit")
-        pkill Xorg
+        pkill X
         ;;
     "Shutdown")
         sudo poweroff

+ 2 - 2
.scripts/lock.sh

@@ -2,7 +2,7 @@
 
 playerctl pause
 
-scrot /tmp/lock.png
-convert /tmp/lock.png -paint 2 /tmp/lock.png
+maim /tmp/lock.png
+convert /tmp/lock.png -blur 0x8 /tmp/lock.png
 i3lock -i /tmp/lock.png
 rm /tmp/lock.png

+ 14 - 0
.scripts/playlist_stream.sh

@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+PLAYLIST="$1" # Playlist directory
+SERVER="$2"   # Target RTMP server
+
+while true; do
+    for i in $PLAYLIST/*.{mp4,mkv}; do
+        BASENAME="${i%.*}"
+        ffmpeg -i "$i" \
+            -c:v mpeg2video -b:v 9000k -f mpegts -
+            #-vf "ass=$BASENAME.enUS.ass"\
+    done
+done | mbuffer -q -m 100M | ffmpeg -re -i pipe:0 -f flv -b:v 9000k "$SERVER"
+

+ 5 - 3
.scripts/wacom_conf.sh

@@ -6,13 +6,15 @@ drawing
 EOF
 )
 
+ID=$(xsetwacom --list | gawk 'match($0, /id: ([0-9]+).*STYLUS/, a) {print a[1]}')
+
 case $CHOICE in
     osu)
-        xsetwacom set 13 Area 0 0 $(calc 2560 \* 3) $(calc 1440 \* 3)
+        xsetwacom set $ID Area 0 0 $(calc 2560 \* 3) $(calc 1440 \* 3)
         ;;
     drawing)
-        xsetwacom set 13 Area 0 0 21600 $(calc 21600 \* 1440 / 2560)
+        xsetwacom set $ID Area 0 0 21600 $(calc 21600 \* 1440 / 2560)
         ;;
 esac
 
-xsetwacom set 13 MapToOutput DisplayPort-1
+xsetwacom set $ID MapToOutput DisplayPort-1

+ 6 - 1
.xinitrc

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-xrandr --output DVI-I-1 --auto --left-of DP-2
+xrandr --output DVI-D-0 --auto --left-of DisplayPort-1
 xrandr --output HDMI-0 --mode 3840x2160 --rate 59.94 --right-of DP-2
 
 xset s off
@@ -30,4 +30,9 @@ compton &
 sxhkd &
 ~/.scripts/dwm_status.sh &
 
+ckb-next -b &
+pgrep seaf-daemon || seaf-cli start
+
+#exec ck-launch-session bspwm -c ~/.bspwmrc
 exec ck-launch-session dwm
+