From 74f909fedcbe354055a7f5a492735e09ba6d15da Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 10 Sep 2020 12:19:06 -0400 Subject: Moved i3 commands into scripts, fixed screencast and added webcam toggles --- i3-filescmd.sh | 3 +++ i3-mailcmd.sh | 4 ++++ i3-mixercmd.sh | 3 +++ i3-newsboatcmd.sh | 3 +++ i3-screenie_regioncmd.sh | 2 ++ i3-screeniecmd.sh | 2 ++ toggle-docked.sh | 4 ++-- toggle-screencast.sh | 11 ++++++----- toggle-webcam.sh | 3 +++ 9 files changed, 28 insertions(+), 7 deletions(-) create mode 100755 i3-filescmd.sh create mode 100755 i3-mailcmd.sh create mode 100755 i3-mixercmd.sh create mode 100755 i3-newsboatcmd.sh create mode 100755 i3-screenie_regioncmd.sh create mode 100755 i3-screeniecmd.sh create mode 100755 toggle-webcam.sh diff --git a/i3-filescmd.sh b/i3-filescmd.sh new file mode 100755 index 0000000..fc4a53c --- /dev/null +++ b/i3-filescmd.sh @@ -0,0 +1,3 @@ +#!/bin/sh +alacritty -e zsh -c "cat ~/.config/wpg/sequences && vifm" + diff --git a/i3-mailcmd.sh b/i3-mailcmd.sh new file mode 100755 index 0000000..3d253fc --- /dev/null +++ b/i3-mailcmd.sh @@ -0,0 +1,4 @@ +#!/bin/sh +alacritty -t "Reading Email" -e zsh -c "cat ~/.config/wpg/sequences && mutt" +mbsync -c ~/.config/mbsync/mbsyncrc -a +pkill -77 i3blocks diff --git a/i3-mixercmd.sh b/i3-mixercmd.sh new file mode 100755 index 0000000..6eef2a1 --- /dev/null +++ b/i3-mixercmd.sh @@ -0,0 +1,3 @@ +#!/bin/sh +alacritty -e zsh -c "cat ~/.config/wpg/sequences && mixertui" +pkill -75 i3blocks diff --git a/i3-newsboatcmd.sh b/i3-newsboatcmd.sh new file mode 100755 index 0000000..c95063c --- /dev/null +++ b/i3-newsboatcmd.sh @@ -0,0 +1,3 @@ +#!/bin/sh +alacritty -t "Reading News" -e zsh -c "cat ~/.config/wpg/sequences && newsboat" +pkill -78 i3blocks diff --git a/i3-screenie_regioncmd.sh b/i3-screenie_regioncmd.sh new file mode 100755 index 0000000..1b2ce32 --- /dev/null +++ b/i3-screenie_regioncmd.sh @@ -0,0 +1,2 @@ +#!/bin/sh +scrot -sfz -e 'mkdir -p ~/pictures/screenshots && mv $f ~/pictures/screenshots/' diff --git a/i3-screeniecmd.sh b/i3-screeniecmd.sh new file mode 100755 index 0000000..4f62401 --- /dev/null +++ b/i3-screeniecmd.sh @@ -0,0 +1,2 @@ +#!/bin/sh +scrot -z -e 'mkdir -p ~/pictures/screenshots && mv $f ~/pictures/screenshots/' diff --git a/toggle-docked.sh b/toggle-docked.sh index e062a31..54551a1 100755 --- a/toggle-docked.sh +++ b/toggle-docked.sh @@ -5,7 +5,7 @@ if [ "$hasVGA" = "connected" ]; then xrandr \ --output VGA-0 \ --mode 1024x768 \ - --pos 0x0 \ + --pos 1920x0 \ --rotate normal \ --dpi 82 \ --output DP-0 \ @@ -17,7 +17,7 @@ if [ "$hasVGA" = "connected" ]; then --output DP-3 \ --primary \ --mode 1920x1080 \ - --pos 1024x0 \ + --pos 0x0 \ --rotate normal \ --dpi 96 \ --output DP-4 \ diff --git a/toggle-screencast.sh b/toggle-screencast.sh index 0a23d41..b8050da 100755 --- a/toggle-screencast.sh +++ b/toggle-screencast.sh @@ -2,7 +2,8 @@ ## Config output_dir=~/videos/screencasts -sound_device=/dev/dsp5 +#sound_device=/dev/dsp4.0 +#-thread_queue_size 512 -f oss -i "$sound_device" \ ## Start recording @@ -14,7 +15,6 @@ start_recording() { ffmpeg -video_size 1920x1080 \ -framerate 50 \ -thread_queue_size 512 -f x11grab -i :0.0+0,0 \ - -thread_queue_size 512 -f oss -i "$sound_device" \ -vcodec libx264rgb -crf 0 -preset:v ultrafast \ -acodec pcm_s16le \ -af aresample=async=1:first_pts=0 \ @@ -26,10 +26,11 @@ start_recording() { ## Stop recording stop_recording() { pkill -2 ffmpeg - output_file="$output_dir"/cast_"$(date '+%F-%H-%M-%S')".mkv - mv /tmp/cast.mkv "$output_file" - notify-send "Screencast saved" "$output_file" + output_file="$output_dir"/cast_"$(date '+%F-%H-%M-%S')".mp4 + notify-send "Screencast stopped, transcoding..." "$output_file" + ffmpeg -i /tmp/cast.mkv "$output_file" && rm /tmp/cast.mkv pkill -76 i3blocks + notify-send "Transcode done!" "$output_file" exit } diff --git a/toggle-webcam.sh b/toggle-webcam.sh new file mode 100755 index 0000000..ea543bb --- /dev/null +++ b/toggle-webcam.sh @@ -0,0 +1,3 @@ +#!/bin/sh +#mpv --no-terminal --geometry=25%-10-40 --title="Live Webcam" +pkill pwcview || pwcview -f 30 -s sif & -- cgit v1.2.3