2020-06-25 06:00:58 +08:00
#!/bin/bash
2021-05-05 15:07:25 +08:00
2020-06-25 06:00:58 +08:00
2021-03-06 22:05:59 +08:00
# screenshots using scrot
2020-06-25 06:00:58 +08:00
scrot_dir=$HOME/screenshots/
2020-06-29 08:38:46 +08:00
date_format='%Y-%m-%d_%H-%M-%S'
2021-05-05 15:07:25 +08:00
2020-06-25 06:00:58 +08:00
s_scrot() {
2020-06-29 08:38:46 +08:00
name=$(date +${date_format}_sel.png)
2020-06-25 06:00:58 +08:00
path="${scrot_dir}${name}"
scrot -s $path
2020-12-24 15:00:51 +08:00
xclip -sel clip $path -t image/png
2020-06-25 06:00:58 +08:00
}
f_scrot() {
2020-06-29 08:38:46 +08:00
name=$(date +${date_format}_full.png)
2020-06-25 06:00:58 +08:00
path="${scrot_dir}${name}"
scrot $path
2020-12-24 15:00:51 +08:00
xclip -sel clip $path -t image/png
2020-06-25 06:00:58 +08:00
}
2020-06-29 08:38:46 +08:00
2021-05-05 15:07:25 +08:00
# screen recorder
byzanz_10() {
name=$(date +${date_format}.gif)
byzanz-record -c -d 10 --delay=0 "${scrot_dir}${name}"
}
2021-03-06 22:05:59 +08:00
# cd into config dir
2020-06-29 08:38:46 +08:00
cfdir()
{
cd $HOME/.config/$1
}
2020-10-08 21:36:08 +08:00
2021-03-06 22:05:59 +08:00
# sshfs into newnumyspace
2020-10-08 21:36:08 +08:00
nnms_fs()
{
dir_name="newnumyspace"
2020-12-03 18:09:09 +08:00
path="${HOME}/dev"
if [ ! -d $path/$dir_name ]
2020-10-08 21:36:08 +08:00
then
2020-12-03 18:09:09 +08:00
mkdir $path/$dir_name
echo "Created new directory $dir_name at $path"
fi
sshfs unn_w19014537@newnumyspace.co.uk:/home/unn_w19014537/ $path/$dir_name/
if [ $? -eq 0 ]
then
echo "Mounted at $path/$dir_name."
2020-10-08 21:36:08 +08:00
fi
}
2020-11-05 01:11:52 +08:00
2021-03-06 22:05:59 +08:00
# pacman list sizes
2020-11-05 01:11:52 +08:00
pacsizes()
{
pacman -Qi $1 | awk '/^Name/{name=$3} /^Installed Size/{size=$4$5; print size, name;}' | sort -h
}
2021-03-06 22:05:59 +08:00
# unreal compile
# Courtesy of mrzapp from https://forums.unrealengine.com/development-discussion/c-gameplay-programming/97022-linux-how-to-compile-c-scripts-from-terminal
function unrealbuild {
UNR_PATH=/opt/UnrealEngine;
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ));
CURR_DIR=`pwd`;
PROJ_NAME=$(basename ${1%.uproject});
echo $RANDNUM
${UNR_PATH}/Engine/Build/BatchFiles/Linux/RunMono.sh ${UNR_PATH}/Engine/Binaries/DotNET/UnrealBuildTool.exe $PROJ_NAME -ModuleWithSuffix $PROJ_NAME Linux Development -editorrecompile -canskiplink "${CURR_DIR}/${PROJ_NAME}.uproject" -progress
}