~npisanti/oltremateria

79e3e36a7f066bc1e57091ee1b1d4da9fed8ed3f — Nicola Pisanti a month ago 0affa64
ported remaining scripts to fish
M bin/install_fonts.sh => bin/install_fonts.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/bash
#!/bin/sh

sudo cp *.ttf /usr/share/fonts/truetype
sudo cp *.otf /usr/share/fonts/opentype

D bin/install_smxi.sh => bin/install_smxi.sh +0 -3
@@ 1,3 0,0 @@
#!/bin/bash
cd /usr/local/bin && wget -Nc smxi.org/smxi.zip && unzip smxi.zip
exit

M bin/invert_gnome_web.sh => bin/invert_gnome_web.sh +6 -5
@@ 1,11 1,12 @@
#!/bin/bash
INVERTED=`dconf read /org/gnome/epiphany/web/enable-user-css`
#!/usr/bin/fish
set INVERTED (dconf read /org/gnome/epiphany/web/enable-user-css)

if [ "$INVERTED" == "false" ]; then
if test "$INVERTED" = "false" 
	dconf write /org/gnome/epiphany/web/enable-user-css true	
	echo "set to true"
else
	dconf write /org/gnome/epiphany/web/enable-user-css false
	echo "set to false" 
fi
exit
\ No newline at end of file
end

exit

M bin/keys_light_off.sh => bin/keys_light_off.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/bash
#!/bin/sh
sudo tee /sys/class/leds/asus::kbd_backlight/brightness <<< 0
exit

M bin/keys_light_on.sh => bin/keys_light_on.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/bash
#!/bin/sh
sudo tee /sys/class/leds/asus::kbd_backlight/brightness <<< 1
exit

D bin/keys_retrig_off.sh => bin/keys_retrig_off.sh +0 -3
@@ 1,3 0,0 @@
#!/bin/bash
xset r off
exit

D bin/keys_retrig_on.sh => bin/keys_retrig_on.sh +0 -3
@@ 1,3 0,0 @@
#!/bin/bash
xset r rate 250 25
exit

M bin/network_speed_test.sh => bin/network_speed_test.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/bash
#!/bin/sh
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip
exit

M bin/np-fakespot.sh => bin/np-fakespot.sh +2 -2
@@ 1,6 1,6 @@
#!/bin/bash
#!/usr/bin/fish
# usage: np-hub.sh PASSWORD
read -s -p "insert spot password: " pass
set pass (read -s -P "insert spot password: " ) 
echo ""
sudo create_ap -n --no-virt wlp2s0 np-hotspot $pass
exit

M bin/np-hub.sh => bin/np-hub.sh +4 -2
@@ 1,4 1,6 @@
#!/bin/bash
# usage: np-hub.sh PASSWORD
sudo create_ap -n --no-virt wlp3s0 np-hub $1
# usage: np-hub.sh
set pass (read -s -P "insert hub password: " ) 
echo ""
sudo create_ap -n --no-virt wlp3s0 np-hub $pass
exit

D bin/optoma_pico_pk320_right.sh => bin/optoma_pico_pk320_right.sh +0 -7
@@ 1,7 0,0 @@
#!/bin/sh
#set here the output from xrandr saved config
#xrandr --output HDMI2 --mode 1366x768 --pos 0x0 --rotate normal --output HDMI1 --mode 720x576 --pos 1366x0 --rotate normal --output DP1 --off
#WP=$(echo |sed -n "2p" ~/.config/nitrogen/bg-saved.cfg   )
#sed -i '7 c\'$WP'' ~/.config/nitrogen/bg-saved.cfg 
nitrogen --restore
exit 0

M bin/orca => bin/orca +10 -10
@@ 1,19 1,19 @@
#!/bin/bash
#!/usr/bin/fish

SEED=$(od -vAn -N2 -tu2 < /dev/urandom)
set SEED (od -vAn -N2 -tu2 < /dev/urandom)

if [ -z "$1" ]; then
if test -z "$argv[1]"
    nice -n -20 /home/$USER/tools/orca/build/orca --strict-timing --undo-limit 20 --seed $SEED 
    #chrt --rr 79  /home/$USER/apps/orca-c/build/release/orca --strict-timing --undo-limit 20 --seed $SEED --margins 1 --osc-port 4444 
else
    ext="${1#*.}"  
    BPM=$(cut -d'.' -f1 <<<$ext)
    set dotsplit (string split "." "$argv[1]")
    set BPM "$dotsplit[2]"

    if [[ $BPM = "orca" ]]; then
        BPM="120"
    fi
    if test "$BPM" = "orca" 
        set BPM "120"
   	end
    #chrt --rr 79  /home/$USER/apps/orca-c/build/release/orca --strict-timing --bpm "$BPM" --undo-limit 20 --seed $SEED --margins 1 --osc-port 4444 $1
    nice -n -20  /home/$USER/tools/orca/build/orca --strict-timing --bpm "$BPM" --undo-limit 20 --seed $SEED $1
fi
    nice -n -20  /home/$USER/tools/orca/build/orca --strict-timing --bpm "$BPM" --undo-limit 20 --seed $SEED $argv[1]
end

exit

M bin/record_audio.sh => bin/record_audio.sh +5 -3
@@ 1,7 1,9 @@
#!/bin/bash
#!/usr/bin/fish

DATE=`date +%Y%m%d`
TIME=`date +%Hh%M`
set DATE (date +%Y%m%d)
set TIME (date +%Hh%M)

# Start recording audio 
jack_capture -b 24 $HOME/Screencasts/screencast_audio_$DATE-$TIME.wav 

exit 
\ No newline at end of file

M bin/record_screen.sh => bin/record_screen.sh +5 -4
@@ 1,15 1,16 @@
#!/bin/bash
#!/usr/bin/fish

DATE=`date +%Y%m%d`
TIME=`date +%Hh%M`
set DATE (date +%Y%m%d)
set TIME (date +%Hh%M)

# Start screencast
#xterm -e jack_capture -b 24 $HOME/Videos/screencast_audio_$DATE-$TIME.wav &
#ffmpeg -an -f x11grab -r 30 -s 1366x768 -i :0.0+0,0 -vcodec libx264 -preset ultrafast -threads 0 $HOME/Videos/screencast_video_$DATE-$TIME.mkv


ffmpeg -f alsa -ac 2 -i ffmpeg -f x11grab -r 30 -s 1366x768 -i :0.0+0,0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 0 $HOME/Videos/screencast_video_$DATE-$TIME.mkv

#killall jack_capture

#ffmpeg -f jack -ac 2 -i ffmpeg -f x11grab -r 30 -s 1366x768 -i :0.0+0,0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast  -threads 0 $HOME/Videos/screencast-$DATE-$TIME.mkv

exit
\ No newline at end of file

D bin/remote_fs.sh => bin/remote_fs.sh +0 -10
@@ 1,10 0,0 @@
#!/bin/bash
# $1 is the remote server username id
# $2 is the remote server IP
sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 "$1@$2:/home/$1" /home/$USER/mnt/ssh -C &
sleep 1
thunar ~/mnt/ssh
#umount ~/mnt/ssh
#killall sshfs
#fusermount -u /home/nick/mnt/ssh
exit

M bin/remote_unmount.sh => bin/remote_unmount.sh +4 -2
@@ 1,3 1,5 @@
#!/bin/bash
#!/bin/sh

fusermount -u /home/$USER/mnt/ssh
exit

exit
\ No newline at end of file

M bin/repocheck.sh => bin/repocheck.sh +16 -26
@@ 1,33 1,23 @@
#!/bin/bash
declare -a paths
#!/usr/bin/fish

paths=(
    "grimorio"
    "htdocs/npisantidotcomssg"
    "tools/raylyeh"
    "tools/folderkit"
    "tools/rl_tools"
    "lab/orca-snippets"
    "lab/scrapbook"
)
set paths "grimorio" "htdocs/npisantidotcomssg" "tools/raylyeh" "tools/folderkit" "tools/rl_tools" "lab/orca-snippets" "lab/scrapbook"

nothingtocommit="true"
set nothingtocommit "true"

for i in "${paths[@]}"
do
    cd "$HOME/$i"
    status=`git status --ignore-submodules | sed -n 4p`
    if [ "$status" == "  (use \"git push\" to publish your local commits)" ]; then
        echo "> $i"
        nothingtocommit="false"
    elif [ "$status" != "nothing to commit, working tree clean" ]; then
        echo "$i"
        nothingtocommit="false"
    fi
done
for i in $paths
	cd "$HOME/$i"
	set repo_status (git status --ignore-submodules | sed -n 4p)
	if test "$repo_status" = "  (use \"git push\" to publish your local commits)" 
		echo "> $i"
		set nothingtocommit "false"
	else if test "$repo_status" != "nothing to commit, working tree clean"
		echo "$i"
		set nothingtocommit "false"
	end
end

if [ "$nothingtocommit" = "true" ]; then
if test "$nothingtocommit" = "true"
    echo "nothing to commit"
fi
end

exit

M bin/rpi_connect.sh => bin/rpi_connect.sh +2 -1
@@ 1,6 1,7 @@
#!/bin/bash
#!/bin/sh
#DATE= date
#echo $DATE
ssh pi@169.254.0.2
#sudo date -s "$DATE"
#echo "date set to $DATE"
exit
\ No newline at end of file

M bin/rpi_filemanager.sh => bin/rpi_filemanager.sh +7 -4
@@ 1,11 1,14 @@
#!/bin/bash
# $1 is the remote server username id
# $2 is the remote server IP
pihost="pi"
#!/usr/bin/fish

set pihost "pi"

sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 "$pihost@169.254.0.2:/home/$pihost" /home/$USER/mnt/ssh -C &

sleep 1
thunar ~/mnt/ssh

#umount ~/mnt/ssh
#killall sshfs
#fusermount -u /home/nick/mnt/ssh

exit

M bin/rpi_fuseunmount.sh => bin/rpi_fuseunmount.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/bash
#!/bin/sh
fusermount -u /home/nick/mnt/ssh
exit

M bin/rpi_prepare_eth0.sh => bin/rpi_prepare_eth0.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/bash
#!/bin/sh
#sudo ifconfig eth0 169.254.0.1
#sudo ip addr add 169.254.0.1/24 dev enp0s25
#sudo ip addr add 169.254.0.1/24 dev enx9cebe81a4a91

M bin/start_engines.sh => bin/start_engines.sh +5 -5
@@ 1,10 1,10 @@
#!/bin/bash
#!/usr/bin/fish

DEVICE="MK2"
set DEVICE "MK2"

if [ ! -z "$1" ]; then
    DEVICE="$1"
fi
if test -n "$argv[1]"
    set DEVICE "$argv[1]"
end

#sudo cpufreq-set -c 0 -g performance
#sudo cpufreq-set -c 1 -g performance

M bin/start_screencast.sh => bin/start_screencast.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/bash
#!/usr/bin/fish

#ffmpeg -y -f x11grab -s 1920x1080 -i :0.0+0,0 -vcodec libx264 -threads 2 $HOME/Videos/screencast_temp.mkv &


M bin/stop_screencast.sh => bin/stop_screencast.sh +12 -15
@@ 1,27 1,24 @@
#!/bin/bash
#!/usr/bin/fish

VIDEO=$( pgrep ffmpeg )
AUDIO=$( pgrep jack_capture )
set VIDEO ( pgrep ffmpeg )
set AUDIO ( pgrep jack_capture )

if [ "$VIDEO" != "" ] && [ "$AUDIO" != "" ]; then
set DATE (date +%Y%m%d)
set TIME (date +%Hh%M)

if test "$VIDEO" != "" && test "$AUDIO" != ""
    killall ffmpeg 
    killall jack_capture
    sleep 2
    DATE=`date +%Y%m%d`
    TIME=`date +%Hh%M`
    ffmpeg -i ~/Videos/screencast_temp.mkv -i ~/Videos/screencast_temp.wav -c:v copy -c:a libvorbis -shortest ~/Videos/screencast_$DATE-$TIME.mkv
elif [ "$VIDEO" != "" ] ; then
else if test "$VIDEO" != ""
    killall ffmpeg 
    sleep 2
    DATE=`date +%Y%m%d`
    TIME=`date +%Hh%M`    
    sleep 2  
    mv ~/Videos/screencast_temp.mkv ~/Videos/screencast_$DATE-$TIME.mkv
elif [ "$AUDIO" != "" ] ; then
else if test "$AUDIO" != ""
    killall jack_capture 
    sleep 2
    DATE=`date +%Y%m%d`
    TIME=`date +%Hh%M`    
    sleep 2  
    mv ~/Videos/screencast_temp.wav ~/Videos/jack_recording_$DATE-$TIME.wav
fi
end

exit

M bin/todo.sh => bin/todo.sh +2 -2
@@ 1,5 1,5 @@
#!/bin/bash
#!/bin/sh

dgeany /home/$USER/lists/todo.txt
geany /home/$USER/lists/todo.txt

exit

M bin/touchscreen_reassign.sh => bin/touchscreen_reassign.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/bash
#!/bin/sh
xinput --map-to-output 10 eDP1 
exit

M bin/volume_down.sh => bin/volume_down.sh +3 -3
@@ 1,6 1,6 @@
#!/bin/bash
#!/usr/bin/fish
amixer set Master 1-
volume=`amixer get Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }'`
volume="Volume = $volume"
set volume (amixer get Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }')
set volume "volume = $volume"
notify-send "$volume"
exit

M bin/volume_mute.sh => bin/volume_mute.sh +8 -8
@@ 1,12 1,12 @@
#!/bin/bash
#!/usr/bin/fish
amixer set Master toggle

mutestatus=`amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $6 }'`
if [ "$mutestatus" == "on" ]; then
    mutestatus="off"
set mutestatus (amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $6 }')

if test "$mutestatus" = "on"
    notify-send "audio active"
else
    mutestatus="muted"
fi
mutestatus="Mute = $mutestatus"
notify-send "$mutestatus"
    notify-send "audio muted"
end

exit

M bin/volume_up.sh => bin/volume_up.sh +3 -3
@@ 1,6 1,6 @@
#!/bin/bash
#!/usr/bin/fish
amixer set Master 1+
volume=`amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }'`
volume="Volume = $volume"
set volume (amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }')
set volume "volume = $volume"
notify-send "$volume"
exit

M bin/wifi_off.sh => bin/wifi_off.sh +2 -0
@@ 1,1 1,3 @@
#!/bin/sh
nmcli r wifi off
exit

M bin/wifi_on.sh => bin/wifi_on.sh +2 -0
@@ 1,1 1,3 @@
#!/bin/sh
nmcli r wifi on
exit

M bin/wifi_reboot.sh => bin/wifi_reboot.sh +1 -1
@@ 1,4 1,4 @@
#!/bin/bash
#!/bin/sh
nmcli r wifi off
sleep 1
nmcli r wifi on

M bin/yt => bin/yt +4 -4
@@ 1,9 1,9 @@
#!/bin/bash
#!/usr/bin/fish

if [ -z "$1" ]; then
if test -z "$1"
    echo "insert video url as argument please"
else
    youtube-dl --extract-audio --audio-format mp3 $1
fi
    youtube-dl --extract-audio --audio-format mp3 $argv[1]
end

exit