-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adder timer function and option for filename #39
base: master
Are you sure you want to change the base?
Conversation
Dark-Kernel
commented
Jul 13, 2024
- Developed a small timer function, which will run after running the script to check the length during recording.
- Added -o option which takes the filename as an argument, to save the file with the name you want
- Included DIR entry in configuration to change the path, where the file will be saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions and minor concerns about possible unintended changes.
bin/ffscreencast
Outdated
@@ -40,7 +40,7 @@ TIME=$(date +%H.%M.%S) | |||
NAME="Screencast ${DATE} at ${TIME}" | |||
|
|||
# Where to save it | |||
DIR="${HOME}/Desktop" | |||
DIR="${HOME}/Videos/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dark-Kernel Is this a mistaken commit? I imagine it might be left over from your development, since it's not called out in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but, No it's not mistaken. Is there something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be very clear: I think this is a good change to make, and might resolve #34 (or might not, perhaps that user doesn't keep a ~/Videos/
either).
This is a change in prior behavior from how the tool used to operate. It might be worth making a separate PR just for changing the default save directory, so @cytopia can either approve or reject it as they see fit, independent of the timer functionality your PR is adding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Videos directory is most likely available on all Desktop Linux distributions, and if it's not there that means most probably that user will neither have Desktop directory. (Like me)
BTW thanks.
bin/ffscreencast
Outdated
echo | ||
|
||
echo "# Default Directory to save video files" | ||
echo "DIR=\"$HOME/Videos\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I wonder whether this is an intended change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having DIR in configuration, one can easily change it to intended location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to reply here as well, changing default behavior of tools can surprise users. Though I personally think ~/Videos/
is a more sensible default location than ~/Desktop/
, I have also gotten used to the existing behavior of the tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, so I think I should change it to ~/Desktop again.
Sorry for the inconvenience.
bin/ffscreencast
Outdated
echo "CHOSEN_A_NUM=\"\"" | ||
echo "CHOSEN_C_NUM=\"\"" | ||
echo | ||
} >> "${conf}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dark-Kernel FYI there's a subtle change in behavior here. Previously passing through this code would do
echo "foo" > $conf # clobber
and then a series of
echo "bar" >> $conf # append new file
Changing this to
{
echo "foo"
echo "bar"
} >> $conf
means we no longer clobber the old config, instead we'll append a new config to it.
I think you can just use
{
echo "foo"
echo "bar"
} > $conf # note, just a single `>`
to achieve the prior behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's small mistake, i didn't noticed that one > is extra, sorry 😅.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dark-Kernel cool, it seems like an easy fix - but this PR doesn't contain it (yet - maybe you haven't had a chance to make it yet: totally understandable!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened Dark-Kernel#1 which targets your branch - if merged it will resolve this >>
-> >
issue.
bin/ffscreencast
Outdated
@@ -1053,7 +1093,7 @@ if [ "${RECORD_S}" = "yes" ]; then | |||
if [ ${#CHOSEN_S_NUM} -gt 0 ]; then | |||
if ! screen_device_exists "$CHOSEN_S_NUM"; then | |||
echo "Screen recording device: '${CHOSEN_S_NUM}' does not exist." | |||
exit -1 | |||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dark-Kernel I'm curious about this change? Again, it's a slight change, but it's not commented in the PR so I'm uncertain as to the rationale.
$ bash -c 'exit -1'
$ echo $?
255
$ bash -c 'exit 1'
$ echo $?
1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what difference it makes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is just me noticing an unacknowledged change in default behavior.
My interest in this project is to be able to easily record my screen on Linux. I use i3wm
, which is a very customizable window manager.
Right now it is nice that ffscreencast
has three different exit values:
0
-- no errors; my screen recording is where I want it to be1
-- some sort of error occurred, probably while running255
-- the script couldn't even start doing its work
Changing from exit -1
to exit 1
here means I get a little less information from the exit value of ffscreencast
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Learned something new. Will change it.
bin/ffscreencast
Outdated
-o*) | ||
shift | ||
NAME="$1" | ||
run_timer & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, this line is indented with spaces rather than tabs. The file in general uses tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I saw in git diff, I always use tabs. I don't know how this occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened Dark-Kernel#1 which targets your branch - if merged, it will resolve this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This preserves the prior behavior of the script. See cytopia#39 (comment)
No logic change * delete trailing spaces * swap a space-indent to a hard-tab indent
Tidy whitespace and clobber config
@belden |
@Dark-Kernel I wish that I could! I am not a contributor on this project - just another programmer out in the wild who also has some open PRs for this project. I've tried to help this PR along to make sure there aren't any broken backwards compatibility issues, but it's up to @cytopia to ultimately review and approve/reject this work. @cytopia can you have a look at this PR please? |