Add screen recording "setup"
Change i3 config to match current hardware setup. Add custom dmenu script to start and stop recording. Move internal dmenu scripts into local variables.
This commit is contained in:
parent
c3df8f0029
commit
9f42237e25
|
@ -216,7 +216,7 @@ mode "$mode_setup" {
|
|||
bindsym v exec xrandr --auto --output DP2-1 --primary --scale 1x1 --mode 2560x1440 --output eDP1 --mode 1920x1080 --left-of DP2-1 && setxkbmap -option ctrl:nocaps && setxkbmap -option compose:ralt && setxkbmap -option numpad:mac
|
||||
# bindsym h exec xrandr --output eDP1 --off --output DP1 --scale 1x1 --mode 2560x1440 && setxkbmap -option ctrl:nocaps && setxkbmap -option compose:ralt && setxkbmap -option numpad:mac
|
||||
bindsym i exec xrandr --output DP1 --off --output DP2 --off --output eDP1 --scale 1x1 --mode 1920x1080 && xbacklight -set 10
|
||||
bindsym r exec xrandr --output DP1 --primary --mode 1920x1080 --output eDP1 --mode 1920x1080 --left-of DP1 && xbacklight -set 100;
|
||||
bindsym r exec xrandr --output DP2-1 --primary --mode 1920x1080 --output eDP1 --mode 1920x1080 --left-of DP2-1 && xbacklight -set 100;
|
||||
|
||||
# Mirror
|
||||
# xrandr --output eDP1 --rate 60 --mode 1920x1080 --fb 1920x1080 --output DP1 --mode 1920x1080 --same-as eDP1
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
self: super: {
|
||||
self: super:
|
||||
let
|
||||
|
||||
# Still has many references to Ubuntu system tools.
|
||||
# Will migrate step by step and update references.
|
||||
|
@ -96,18 +97,41 @@ self: super: {
|
|||
text = builtins.readFile ./xdebug.sh;
|
||||
};
|
||||
|
||||
dmenu-custom-scripts-start-videorecording = super.pkgs.writeShellApplication {
|
||||
name = "dmenu-custom-scripts-start-videorecording";
|
||||
|
||||
runtimeInputs = [
|
||||
super.pkgs.dmenu
|
||||
];
|
||||
|
||||
text = builtins.readFile ./start-videorecording.sh;
|
||||
};
|
||||
|
||||
dmenu-custom-scripts-stop-videorecording = super.pkgs.writeShellApplication {
|
||||
name = "dmenu-custom-scripts-stop-videorecording";
|
||||
|
||||
text = ''
|
||||
kill "$(cat /tmp/runningRecording.txt)"
|
||||
rm /tmp/runningRecording.txt
|
||||
notify-send "Stoped recording"
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
dmenu-custom-scripts = super.pkgs.writeShellApplication {
|
||||
name = "dmenu_selection";
|
||||
|
||||
# TODO: Find way to remove the nix prefixes from "files"
|
||||
text = ''
|
||||
scripts=()
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-calc.name}")
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-notifications.name}")
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-system.name}")
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-docs-php.name}")
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-php-version.name}")
|
||||
scripts+=("${super.pkgs.dmenu-custom-scripts-xdebug.name}")
|
||||
scripts+=("${dmenu-custom-scripts-calc.name}")
|
||||
scripts+=("${dmenu-custom-scripts-notifications.name}")
|
||||
scripts+=("${dmenu-custom-scripts-system.name}")
|
||||
scripts+=("${dmenu-custom-scripts-php-version.name}")
|
||||
scripts+=("${dmenu-custom-scripts-docs-php.name}")
|
||||
scripts+=("${dmenu-custom-scripts-xdebug.name}")
|
||||
scripts+=("${dmenu-custom-scripts-start-videorecording.name}")
|
||||
scripts+=("${dmenu-custom-scripts-stop-videorecording.name}")
|
||||
|
||||
OIFS="$IFS" IFS=$'\n'
|
||||
scriptsString="''${scripts[*]}"
|
||||
|
@ -116,23 +140,29 @@ self: super: {
|
|||
action=$(echo -e "$scriptsString" | dmenu -i -l 20)
|
||||
|
||||
case "$action" in
|
||||
"${super.pkgs.dmenu-custom-scripts-calc.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-calc}/bin/${super.pkgs.dmenu-custom-scripts-calc.name}" || exit 0
|
||||
"${dmenu-custom-scripts-calc.name}")
|
||||
bash "${dmenu-custom-scripts-calc}/bin/${dmenu-custom-scripts-calc.name}" || exit 0
|
||||
;;
|
||||
"${super.pkgs.dmenu-custom-scripts-notifications.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-notifications}/bin/${super.pkgs.dmenu-custom-scripts-notifications.name}" || exit 0
|
||||
"${dmenu-custom-scripts-notifications.name}")
|
||||
bash "${dmenu-custom-scripts-notifications}/bin/${dmenu-custom-scripts-notifications.name}" || exit 0
|
||||
;;
|
||||
"${super.pkgs.dmenu-custom-scripts-system.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-system}/bin/${super.pkgs.dmenu-custom-scripts-system.name}" || exit 0
|
||||
"${dmenu-custom-scripts-system.name}")
|
||||
bash "${dmenu-custom-scripts-system}/bin/${dmenu-custom-scripts-system.name}" || exit 0
|
||||
;;
|
||||
"${super.pkgs.dmenu-custom-scripts-docs-php.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-docs-php}/bin/${super.pkgs.dmenu-custom-scripts-docs-php.name}" || exit 0
|
||||
"${dmenu-custom-scripts-docs-php.name}")
|
||||
bash "${dmenu-custom-scripts-docs-php}/bin/${dmenu-custom-scripts-docs-php.name}" || exit 0
|
||||
;;
|
||||
"${super.pkgs.dmenu-custom-scripts-php-version.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-php-version}/bin/${super.pkgs.dmenu-custom-scripts-php-version.name}" || exit 0
|
||||
"${dmenu-custom-scripts-php-version.name}")
|
||||
bash "${dmenu-custom-scripts-php-version}/bin/${dmenu-custom-scripts-php-version.name}" || exit 0
|
||||
;;
|
||||
"${super.pkgs.dmenu-custom-scripts-xdebug.name}")
|
||||
bash "${super.pkgs.dmenu-custom-scripts-xdebug}/bin/${super.pkgs.dmenu-custom-scripts-xdebug.name}" || exit 0
|
||||
"${dmenu-custom-scripts-xdebug.name}")
|
||||
bash "${dmenu-custom-scripts-xdebug}/bin/${dmenu-custom-scripts-xdebug.name}" || exit 0
|
||||
;;
|
||||
"${dmenu-custom-scripts-start-videorecording.name}")
|
||||
bash "${dmenu-custom-scripts-start-videorecording}/bin/${dmenu-custom-scripts-start-videorecording.name}" || exit 0
|
||||
;;
|
||||
"${dmenu-custom-scripts-stop-videorecording.name}")
|
||||
bash "${dmenu-custom-scripts-stop-videorecording}/bin/${dmenu-custom-scripts-stop-videorecording.name}" || exit 0
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
|
|
17
overlays/dmenu-custom-scripts/start-videorecording.sh
Normal file
17
overlays/dmenu-custom-scripts/start-videorecording.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
availableDevices=$(pacmd list-sources | grep 'name:' | grep 'input' | sed 's/^.*name: <//' | sed 's/>$//')
|
||||
audioDevice=$(echo -e "$availableDevices" | dmenu -i -l 5 -p "Select Audio Input")
|
||||
|
||||
if [ -z "$audioDevice" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
recordingFile="/home/daniels/Videos/Recordings/output-$(date +'%F_%T').mkv"
|
||||
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0+1920x1080 -f pulse -i "$audioDevice" "$recordingFile" &
|
||||
sleep 1
|
||||
if [ -f "$recordingFile" ];
|
||||
then
|
||||
recordingPid=$!
|
||||
echo "$recordingPid" > /tmp/runningRecording.txt
|
||||
else
|
||||
notify-send -u critical "Could not start recording" "Check screen setup?"
|
||||
fi
|
Loading…
Reference in a new issue