First Upload, Welcome to gitea

This commit is contained in:
Mohamad Damaj 2023-02-04 18:31:46 +02:00
commit b77a83a1c6
84 changed files with 13843 additions and 0 deletions

21
dfmpeg/LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 speedie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

14
dfmpeg/Makefile Normal file
View file

@ -0,0 +1,14 @@
SHELL = /bin/sh
INSTALL_DIR = /usr/bin/
NAME = dfmpeg
help:
@echo "make install Install dfmpeg."
@echo "make uninstall Remove dfmpeg."
install:
cp ${NAME} ${INSTALL_DIR}${NAME}
uninstall:
rm ${INSTALL_DIR}${NAME}

42
dfmpeg/README.md Normal file
View file

@ -0,0 +1,42 @@
# dfmpeg
Dmenu script to record your screen using ffmpeg.
## Preview
![image](https://user-images.githubusercontent.com/71722170/161388108-fecb715d-8c6b-4fe3-8815-08367e66a3e7.png)
## Usage
Install the script (see installation) and run it using dmenu. Make sure to edit the config file to match your system.
## Installation
Download the [script](https://raw.githubusercontent.com/speediegamer/dfmpeg/main/dfmpeg) and save it to /usr/bin, /usr/local/bin, or any other path specified in your shell's $PATH variable. Then chmod +x it to make sure it's executable.
If /bin/sh isn't an alias then edit the script and change #!/bin/sh to a shell on your Linux system.
## Notes
- This script IS fully POSIX compliant.
- This script has ffmpeg and dmenu as a dependency
- If you are on Gentoo, enable X, xcb and libdrm USE flags for the ffmpeg package
- Rofi support might become a patch later on.
## Configuration
NOTE: You do not need to configure it to use it however you should definitely do it if you want to change options.
Create ~/.config/dfmpeg and save [this](https://raw.githubusercontent.com/speediegamer/dfmpeg/main/dfmpegrc) file to ~/.config/dfmpeg/dfmpegrc Now change these variables to what's present on your system:
- DFMPEG_RESOLUTION (set to your screen resolution)
- DFMPEG_AUDIO_DEVICE (set to either alsa or pulse)
- DFMPEG_FRAME_RATE (set to the frame rate you wanna record in)
- DFMPEG_OUTPUT_PATH (set to the path where videos will be saved)
- DFMPEG_OUTPUT_FORMAT (set to the format you wanna record in)
- DFMPEG_DMENU (set to the path to your dmenu binary)
- DFMPEG_TERM (set to the path to your terminal emulator binary)
- DFMPEG_EDITOR (set to an editor on your system such as vim)
## Credits
- Me
- The awesome people who have contributed
## Have issues?
Report any issues to the GitHub page Issues.
## License
This dmenu script is licensed under MIT.
See the "about" or LICENSE file for more information.

46
dfmpeg/dfmpeg Executable file
View file

@ -0,0 +1,46 @@
#!/bin/sh
# dfmpeg
# dmenu gui for recording your screen with ffmpeg
# Licensed under MIT, written by speedie
# https://github.com/speediegamer/dfmpeg
defaultConfig() {
DFMPEG_DOTDIR="$HOME/.config/dfmpeg" # The directory where dotfiles are
DFMPEG_RESOLUTION="1920x1080" # The resolution to record in
DFMPEG_AUDIO_DEVICE="alsa" # How to capture audio (alsa/pulseaudio)
DFMPEG_FRAME_RATE="60" # Frame rate to capture in.
DFMPEG_RECORD_DEVICE="x11grab" # Probably do not change.
DFMPEG_OUTPUT_PATH="$HOME/Videos" # Path where videos will be saved.
DFMPEG_OUTPUT_FORMAT="mp4" # What format to use
DFMPEG_OUTPUT_FILENAME="$DFMPEG_OUTPUT_PATH/Dfmpeg-Output-$(date +"%d-%d-%y-%T").$DFMPEG_OUTPUT_FORMAT" # File name of the output. Probably don't need to change.
DFMPEG_WH=":0.0" # Width and height, no need to change, defaults should work.
DFMPEG_DMENU="dmenu" # Path to dmenu
DFMPEG_TERM="$TERMINAL" # Terminal to use when editing the configuration file.
DFMPEG_EDITOR="vim" # Editor to edit the config file with
}
defaultConfig
. "$DFMPEG_DOTDIR"/dfmpegrc
startrec="ffmpeg -f $DFMPEG_RECORD_DEVICE -s $DFMPEG_RESOLUTION -i $DFMPEG_WH -f $DFMPEG_AUDIO_DEVICE -r $DFMPEG_FRAME_RATE -i default $DFMPEG_OUTPUT_FILENAME"
startrec_no_audio="ffmpeg -f $DFMPEG_RECORD_DEVICE -s $DFMPEG_RESOLUTION -r $DFMPEG_FRAME_RATE -i $DFMPEG_WH $DFMPEG_OUTPUT_FILENAME"
stoprec="pkill ffmpeg"
dfmpeg_ver="2022-04-03-r1"
about_screen="dfmpeg $dfmpeg_ver."
about_screen_2="Licensed under MIT, written by speedie + contributors."
about_screen_3="https://github.com/speediegamer/dfmpeg"
case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout' | dmenu -p 'Record your screen:')" in
"Exit") DFMPEG_STATUS=idle && exit 0 ;;
"Start") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && $startrec && exit 0 ;;
"Stop") $stoprec && rm /tmp/dfmpeg-recording && DFMPEG_STATUS=idle ;;
"Configure") $DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpegrc ;;
"Start-No-Audio") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && $startrec_no_audio && exit 0 ;;
"About")
echo $about_screen > $DFMPEG_DOTDIR/dfmpeg_about
echo $about_screen_2 >> $DFMPEG_DOTDIR/dfmpeg_about
echo $about_screen_3 >> $DFMPEG_DOTDIR/dfmpeg_about
$DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpeg_about
;;
esac
exit 0 # This fixes a small bug.

12
dfmpeg/dfmpegrc Normal file
View file

@ -0,0 +1,12 @@
DFMPEG_DOTDIR=~/.config/dfmpeg # The directory where dotfiles are
DFMPEG_RESOLUTION=1920x1080 # The resolution to record in
DFMPEG_AUDIO_DEVICE=alsa # How to capture audio (alsa/pulseaudio)
DFMPEG_FRAME_RATE=60 # Frame rate to capture in.
DFMPEG_RECORD_DEVICE=x11grab # Probably do not change.
DFMPEG_OUTPUT_PATH=~/Videos # Path where videos will be saved.
DFMPEG_OUTPUT_FORMAT=mp4 # What format to use
DFMPEG_OUTPUT_FILENAME=$DFMPEG_OUTPUT_PATH/Dfmpeg-Output-$(date +"%d-%d-%y-%T").$DFMPEG_OUTPUT_FORMAT # File name of the output. Probably don't need to change.
DFMPEG_WH=:0.0 # Width and height, no need to change, defaults should work.
DFMPEG_DMENU=dmenu # Path to dmenu
DFMPEG_TERM=$TERMINAL # Terminal to use when editing the configuration file.
DFMPEG_EDITOR=vim # Editor to edit the config file with

View file

@ -0,0 +1,36 @@
diff -up dfmpeg-vanilla/dfmpeg dfmpeg-patch/dfmpeg
--- dfmpeg-vanilla/dfmpeg 2022-04-10 11:56:41.414021739 +0200
+++ dfmpeg-patch/dfmpeg 2022-04-11 02:40:28.898682361 +0200
@@ -17,6 +17,7 @@ defaultConfig() {
DFMPEG_DMENU="dmenu" # Path to dmenu
DFMPEG_TERM="$TERMINAL" # Terminal to use when editing the configuration file.
DFMPEG_EDITOR="vim" # Editor to edit the config file with
+ DFMPEG_MEDIA_PLAYER=mpv # Media player to play videos in
}
defaultConfig
@@ -29,12 +30,13 @@ about_screen="dfmpeg $dfmpeg_ver."
about_screen_2="Licensed under MIT, written by speedie + contributors."
about_screen_3="https://github.com/speediegamer/dfmpeg"
-case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout' | dmenu -p 'Record your screen:')" in
+case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout\nPlayLast' | dmenu -p 'Record your screen:')" in
"Exit") DFMPEG_STATUS=idle && exit 0 ;;
- "Start") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && $startrec && exit 0 ;;
+ "Start") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && echo $DFMPEG_OUTPUT_FILENAME > /tmp/dfmpeg-filename && $startrec && exit 0 ;;
"Stop") $stoprec && rm /tmp/dfmpeg-recording && DFMPEG_STATUS=idle ;;
"Configure") $DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpegrc ;;
- "Start-No-Audio") DFMPEG_STATUS=recording && $startrec_no_audio && exit 0 ;;
+ "Start-No-Audio") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && echo $DFMPEG_OUTPUT_FILENAME > /tmp/dfmpeg-filename && $startrec_no_audio && exit 0 ;;
+ "PlayLast") DFMPEG_STATUS=idle && $DFMPEG_MEDIA_PLAYER $(cat /tmp/dfmpeg-filename) && exit 0 ;;
"About")
echo $about_screen > $DFMPEG_DOTDIR/dfmpeg_about
echo $about_screen_2 >> $DFMPEG_DOTDIR/dfmpeg_about
diff -up dfmpeg-vanilla/dfmpegrc dfmpeg-patch/dfmpegrc
--- dfmpeg-vanilla/dfmpegrc 2022-04-10 11:56:50.093022166 +0200
+++ dfmpeg-patch/dfmpegrc 2022-04-11 02:41:13.184684370 +0200
@@ -10,3 +10,4 @@ DFMPEG_WH=:0.0 # Width and height, no ne
DFMPEG_DMENU=dmenu # Path to dmenu
DFMPEG_TERM=$TERMINAL # Terminal to use when editing the configuration file.
DFMPEG_EDITOR=vim # Editor to edit the config file with
+DFMPEG_MEDIA_PLAYER=mpv # Media player to play videos in

View file

@ -0,0 +1,34 @@
diff -up dfmpeg-vanilla/dfmpeg dfmpeg-patch/dfmpeg
--- dfmpeg-vanilla/dfmpeg 2022-04-10 11:56:41.414021739 +0200
+++ dfmpeg-patch/dfmpeg 2022-04-10 11:57:10.317023160 +0200
@@ -17,6 +17,7 @@ defaultConfig() {
DFMPEG_DMENU="dmenu" # Path to dmenu
DFMPEG_TERM="$TERMINAL" # Terminal to use when editing the configuration file.
DFMPEG_EDITOR="vim" # Editor to edit the config file with
+ DFMPEG_STOP_ON_RUN=false # Stop recording once dfmpeg is loaded if it's already recording
}
defaultConfig
@@ -29,6 +30,10 @@ about_screen="dfmpeg $dfmpeg_ver."
about_screen_2="Licensed under MIT, written by speedie + contributors."
about_screen_3="https://github.com/speediegamer/dfmpeg"
+case "$DFMPEG_STOP_ON_RUN" in
+ "true") ls /tmp/dfmpeg-recording && $stoprec && DFMPEG_STATUS=idle && rm /tmp/dfmpeg-recording && exit 0 ;;
+esac
+
case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout' | dmenu -p 'Record your screen:')" in
"Exit") DFMPEG_STATUS=idle && exit 0 ;;
"Start") DFMPEG_STATUS=recording && touch /tmp/dfmpeg-recording && $startrec && exit 0 ;;
@@ -43,4 +48,4 @@ case "$(printf 'Start\nStop\nStart-No-Au
;;
esac
diff -up dfmpeg-vanilla/dfmpegrc dfmpeg-patch/dfmpegrc
--- dfmpeg-vanilla/dfmpegrc 2022-04-10 11:56:50.093022166 +0200
+++ dfmpeg-patch/dfmpegrc 2022-04-10 11:58:12.963026238 +0200
@@ -10,3 +10,4 @@ DFMPEG_WH=:0.0 # Width and height, no ne
DFMPEG_DMENU=dmenu # Path to dmenu
DFMPEG_TERM=$TERMINAL # Terminal to use when editing the configuration file.
DFMPEG_EDITOR=vim # Editor to edit the config file with
+DFMPEG_STOP_ON_RUN=false # Stop recording when dfmpeg is loaded if its recording

View file

@ -0,0 +1,51 @@
diff -up dfmpeg-vanilla/dfmpeg dfmpeg-patch/dfmpeg
--- dfmpeg-vanilla/dfmpeg 2022-04-03 14:45:55.259169925 +0200
+++ dfmpeg-patch/dfmpeg 2022-04-03 14:45:07.438172998 +0200
@@ -17,6 +17,7 @@ defaultConfig() {
DFMPEG_DMENU="dmenu" # Path to dmenu
DFMPEG_TERM="$TERMINAL" # Terminal to use when editing the configuration file.
DFMPEG_EDITOR="vim" # Editor to edit the config file with
+ DFMPEG_USE_DMENU=false # Use dmenu
}
defaultConfig
@@ -29,6 +30,31 @@ about_screen="dfmpeg $dfmpeg_ver."
about_screen_2="Licensed under MIT, written by speedie + contributors."
about_screen_3="https://github.com/speediegamer/dfmpeg"
+case "$DFMPEG_USE_DMENU" in
+ "true") DFMPEG_USE_DMENU=false ;;
+ "false")
+ clear && echo "dfmpeg $dfmpeg_ver"
+ echo "What do you wanna do? Run :help if you need help."
+ echo ":q to quit."
+ echo -n ">" && read DFMPEG_ACTION
+ ;;
+esac
+
+case "$DFMPEG_ACTION" in
+ ":q") exit 0 ;;
+ ":help") echo -e ":q // Quit\n:help // Display this help screen\n:r // Record with sound\n:rn // Record without sound\n:s // Stop recording\n:c // Open the config file in the defined text editor\n:a // Display the about screen" ;;
+ ":r") $startrec && ${0} && exit 0 ;;
+ ":rn") $startrec_no_audio && ${0} && exit 0 ;;
+ ":s") $stoprec && ${0} && exit 0 ;;
+ ":c") $DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpegrc && ${0} && exit 0 ;;
+ ":a") $DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpeg_about && ${0} && exit 0 ;;
+esac
+
+case "$DFMPEG_USE_DMENU" in
+ "false") DFMPEG_ACTION=:help && exit 0
+esac
+
+# Only do this if DMENU is enabled.
case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout' | dmenu -p 'Record your screen:')" in
"Exit") DFMPEG_STATUS=idle && exit 0 ;;
"Start") DFMPEG_STATUS=recording && $startrec && exit 0 ;;
diff -up dfmpeg-vanilla/dfmpegrc dfmpeg-patch/dfmpegrc
--- dfmpeg-vanilla/dfmpegrc 2022-04-03 14:45:53.344170048 +0200
+++ dfmpeg-patch/dfmpegrc 2022-04-03 14:23:24.205256743 +0200
@@ -10,3 +10,4 @@ DFMPEG_WH=:0.0 # Width and height, no ne
DFMPEG_DMENU=dmenu # Path to dmenu
DFMPEG_TERM=$TERMINAL # Terminal to use when editing the configuration file.
DFMPEG_EDITOR=vim # Editor to edit the config file with
+DFMPEG_USE_DMENU=false # Use dmenu

2
dfmpeg/patches/patch Normal file
View file

@ -0,0 +1,2 @@
This is the directory where patches are stored.
Feel free to submit patches.

View file

@ -0,0 +1,34 @@
diff -up dfmpeg-vanilla/dfmpeg dfmpeg-patch/dfmpeg
--- dfmpeg-vanilla/dfmpeg 2022-04-03 00:24:23.548491608 +0200
+++ dfmpeg-patch/dfmpeg 2022-04-03 00:24:30.992491129 +0200
@@ -17,6 +17,7 @@ defaultConfig() {
DFMPEG_DMENU="dmenu" # Path to dmenu
DFMPEG_TERM="$TERMINAL" # Terminal to use when editing the configuration file.
DFMPEG_EDITOR="vim" # Editor to edit the config file with
+ DFMPEG_PLAYER="mpv" # Player to use
}
defaultConfig
@@ -29,12 +30,13 @@ about_screen="dfmpeg $dfmpeg_ver."
about_screen_2="Licensed under MIT, written by speedie + contributors."
about_screen_3="https://github.com/speediegamer/dfmpeg"
-case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout' | dmenu -p 'Record your screen:')" in
+case "$(printf 'Start\nStop\nStart-No-Audio\nConfigure\nExit\nAbout\nPlay' | dmenu -p 'Record your screen:')" in
"Exit") DFMPEG_STATUS=idle && exit 0 ;;
"Start") DFMPEG_STATUS=recording && $startrec && exit 0 ;;
"Stop") $stoprec && DFMPEG_STATUS=idle ;;
"Configure") $DFMPEG_TERM $DFMPEG_EDITOR $DFMPEG_DOTDIR/dfmpegrc ;;
"Start-No-Audio") DFMPEG_STATUS=recording && $startrec_no_audio && exit 0 ;;
+ "Play") DFMPEG_PLAY=$(ls -A --color=auto $DFMPEG_OUTPUT_PATH | dmenu) && $DFMPEG_PLAYER $DFMPEG_OUTPUT_PATH/$DFMPEG_PLAY && exit 0 ;;
"About")
echo $about_screen > $DFMPEG_DOTDIR/dfmpeg_about
echo $about_screen_2 >> $DFMPEG_DOTDIR/dfmpeg_about
diff -up dfmpeg-vanilla/dfmpegrc dfmpeg-patch/dfmpegrc
--- dfmpeg-vanilla/dfmpegrc 2022-04-03 00:25:16.410488211 +0200
+++ dfmpeg-patch/dfmpegrc 2022-04-03 00:24:57.511489425 +0200
@@ -10,3 +10,4 @@ DFMPEG_WH=:0.0 # Width and height, no ne
DFMPEG_DMENU=dmenu # Path to dmenu
DFMPEG_TERM=st # Terminal to use when editing the configuration file.
DFMPEG_EDITOR=vim # Editor to edit the config file with
+DFMPEG_PLAYER=mpv # Player to play videos in