I've been getting in the habit of only preparing for a really brief period nowadays, which means I can get home, have an idea and do it within an hour or so. I think this might actually be my 100th video this year?
Thank you. I always love to hear of new tools in linux. They are actually hard to deliberately find in my experience. So it basically starts a background process that reads stdin(through pipe or other means). That's actually very useful in many single cases(single files) and totally bad practice for anything on scale.
The most important thing I've learned from this video is not entr but notify-send. I'd like to see a video about hybrid terminal/graphic programs like notify-send and dmenu.
Oh bloody hell! This is the answer to the question I couldn't answer in my Facebook interview! It's what cost me the job! In my defense, it was for a Windows Engineering role, but the interviewer was a Linux Engineer....I kinda feel like that was an impossible situation.
I thought in status bar imediatly. The most eficient way of updating a status bar is to use memory. Every change in the status bar can be updated by echoing something in a file and then update the status bar with It, instead of using while commands.
Yay, that's really something I always wanted. First I thought "When would I need this?" And then I remembered, always running commands like this after editing markdown: pandoc Test.md -o Test.pdf I feel like using an environment for editing Markdown, but I don't. Just gedit and evince opened in a tiling window manager. And a terminal opened, which is hidden somewhere.
Something like this should be a part of the system: a daemon that checks modified files. I also recommend doing something like this but with commands. For example "when my clipboard contents change, run this command". It's an essential part of my workflow
This is game changer for automating configuration dot files. If you are someone using the git method for managing configuration files, you can use this to automatically git commit the changes
The key problem with this kind of tool is there is no Unix/POSIX standard for notification of filesystem events. Linux has its own inotify and fanotify systems, other OSes have different ones or none at all, forcing you to resort to periodic polling to notice changes.
I can see one interesting application for this that people might be interested in. Right now I do my note taking at work with Atom, because it has a live Github style markdown preview in-editor. Now I could open the .md file in firefox while editing in vi for example, and have it reload through entr every time I save my md file, and that way I'd be able to get rid of the 100+ mb text editor bloatware.
Where can I find a list of files that entr is currently watching for? I would like to cancel one of my entr scripts, but can't find any sort of config file.
I tried for about 2 hours to re-create this setup with the auto-compiling latex. After a ton of iterations with setsid, ":call system()", silent mode, all in vim or in separate scripts, the best I can get is that the command runs in the background, then vim becomes INCREDIBLY slow and only registers half my keystrokes until I exit and restart it. A bunch of garbage ends up in the command window in those scenarios sometimes, so I think maybe it's being spammed with console output even though I redirected it to "/dev/null" in the script and in the vim call? I have no idea how Luke has gotten his to work.
No. I would not install yet another third-party tool for such fundamental task. Just use `systemd-run \-\-user \-\-path-property=PathModified=$HOME/.bashrc \-\- notify-send "bashrc updated"` for example.
Luke has been on 🔥 lately Luke, how did you make you cursor change in vim? Like in 6:31 In config.h in st folder, I can only assign one type of symbol for the cursor.
In your vimrc: let &t_SI = "\033[5 q" let &t_SR = "\033[1 q" let &t_EI = "\033[1 q" This is for extra fuckery: autocmd InsertEnter * set cul autocmd InsertLeave * set nocul
How are you opening terminals in panels and resizing them like that? What DE are you using? GUSH: Thank you for your videos! you showed me ranger and it is awesome. I want to be as proficient as you so I will continue to watch your videos. I am currently watching your arch linux install video and doing all of the things. Thank you for your work and video creation. I'm a real fan.
might be "terminator", you're able to open new tabs and split the screen estate assigned to the whole application so each tab has its own space - IT recommended it to me when we were figuring out an issue with my workstation in the university i attend
You say you dont like auto compilers, I was just wondering about some LaTeX/groff related issues. Do you write all your documents directly in latex/groff from the first draft or do you write it somewhere else first then when its ready write it all into markdown format to be compiled? I'm speaking as a normie who doesnt use these, it seems like a hassle to think about syntax and whatnot while youre trying to think/focus on your writing, and it could draw you out of the right mindstate, especially without an autocompiler. Am I just too much of a brainlet?
I think that writing in markdown is a huge waste of time if you're just going to convert it. Conversion will also always cause complications, so I find it unnecessary. You don't really have to "think" about the syntax of TeX or groff because it's not really relevant while you're typing 99% of your words. It's really only used when you're formatting special things or setting settings, plus you learn it very quickly. Plus, I use vim snippets to write most of my syntax.
@@LukeSmithxyz That makes sense, I'll start using it for my documents and see if I can get into it. Too bad my school forces me to use *google docs* for everything.
whoa stop right there so I may be very new to bash but what I've learned is that echo outputs something once. And it closes afterwards. The pipe makes it the input of entr. How tf does entr detect when the file changes? Or is my bash world based upon false beliefs?
Luke: check out atchange: alum.mit.edu/www/toms/atchange.html It can be run from the command line like entr, but also can take a file listing many files to watch. Invented around 1997 ...
Maybe it's just me, but how do you tell entr to stop looking for changes to for example a file again. Does entr 'forget' everything on restart of the process?
This can be very usefull for identify some events which can possibly happen during the test. Something crashes or some error happens . Intresting , can i set it to recognize if some specific string has appeared in log and to do some actions as result of this event? How is it works ? Is it gorging cpu? How does it know that file had been changed? I am looking for some real reason to justify the tool usage. I don't think i need it simply for notificate me if file has changed or to update my file immediately in vim , becase mostly what you will want is just the opposite . It's one of vim advantages it uses buffers and doesn't update it immediately.
Hey Luke, how you doing? Just for curiosity, why you don't use tmux? Have you already said the reason before? You don't like it? Another one, how you can change font size in keyboard? I'm using termite as terminal emulator and I have to reload it after changing conf file :(. Anyway, keep this great work.
I don't have any real use for tmux because I use a tiling window manager. I don't know anything about changing font size in termite, but in my terminal I have I binding for it and that's what I use: github.com/LukeSmithxyz/st recent vid on my terminal in case you missed it: ua-cam.com/video/9H75enWM22k/v-deo.html
@@iusewindowsbtw3420 In each workspace I use only one application. For instance, on workspace 1 I use terminal with tmux in fullscreen. It is less distractive for me. So if I need to open a new terminal I won't see because it is in fullscreen. With tmux I can split it or create a new pane. Other benefit, I don't need to use mouse, I can copy/paste to/from my primary/secundary clipboard just using keys. So there is other benefits in my environment, but I think these are the main reasons that I use tmux.
Could you use this to monitor log files and make automatic backups before clearing them after a certain number of updates? Either way seems like a great tool
That's pretty cool. How does it watch changes for "ls" without repeatedly running "ls" in the background? I use ls just as an example, but it applies to anything really. Since you can seemingly feed it any arbitrary command, how does it know how to handle whatever you pipe into it? Using ls as an example.. when you initially pipe ls into entr, I assume it takes the output from ls, and puts it into some kind of background job to rerun the same command and monitor for changes. In order to discover changes to your initial command, it would need to rerun your command and refresh the output.. again, since the input is arbitrary and not hard-coded into entr with explicit callbacks. Is entr just running your commands in a background loop over and over or is it using some kind of linux voodoo I'm not aware of? If it is rerunning your command, it would seem it could get pretty resource hungry if you're not careful what you're piping into it (e.g. ls -R in a massive directory)
Not sure if you really get the whole concept of standard input. Once you pipe the text output to a program, it first program is done. You could uninstall ls from your computer and it wouldn't matter. entr reads text input, which is what ls *html produces on the initial run.
@@LukeSmithxyz Very likely that I don't fully understand how standard input works (source: I don't) :) Thanks for the info. Just trying to wrap my head around how this works
Like the other comments stated: learn about standard output, standard input and standard error. (github.com/hcs/bootcamp-unix/wiki/stdin,-stdout,-stderr,-and-pipes) And about the loop question: No it doesn't it uses the inotify mechanism of linux to be warned when one of the inodes is changed. Tip: learn about the unix filesystem to learn about inodes (www.grymoire.com/Unix/Inodes.html)
Wait are you using i3? Why is your bar on the top? I still don't know how to do that… I do use macOS as my daily driver and just run manjaro i3 in a vm :/
still very new to MacVim, how do some people increase the font size on the fly? I have seen more than one demo on vim and some do this, I can hear the keypresses.
That is terminal-mode vim (not gui vim). You just need to increase the font size of the terminal. The keys depend on the terminal emulator (on PC it's more often than not CTRL+; CMD+ for mac maybe?)
I've been using "when-changed" for this utility until now, is entr better in any way? when-changed is a python script and entr is in C, so entr might be more Linuxy in a sense, but I don't know...
It doesn't use any significant system resources, you can check it yourself. For example, on my machine now, my inactive mpd instance and my inactive notification manager are taking up much more system resources than entr. If you really were concerned, I'm just it wouldn't be too hard to make a wrapper for newsboat that autostarted/stopped entr.
I don't understand his purpose. Can't you just use an "&&" logical operand? For example "sudo pacman -Syu --noconfirm&¬ify-send "Packaged upgraded!""
Dang. This is such a useful channel.
Yup
damn luke pumping out videos day and night like a real "youtuber"
I've been getting in the habit of only preparing for a really brief period nowadays, which means I can get home, have an idea and do it within an hour or so. I think this might actually be my 100th video this year?
@TheFengLord Luke is addicted to upcummies
@@LukeSmithxyz Thats really great man. love your linux videos. your podcast is really gay though
@@LukeSmithxyz
may you take about HABITS, and these stuff ?
@@ashwinadhikari1720 cmon dawg. Your name is ashwin adhikari . Dravidian name
Your multi window management is out of this world! Great to see proper use of desktop environment Luke!
@@floriantraunat He did, ua-cam.com/video/GKviflL9XeI/v-deo.html
Thank you. I always love to hear of new tools in linux. They are actually hard to deliberately find in my experience.
So it basically starts a background process that reads stdin(through pipe or other means). That's actually very useful in many single cases(single files) and totally bad practice for anything on scale.
The most important thing I've learned from this video is not entr but notify-send. I'd like to see a video about hybrid terminal/graphic programs like notify-send and dmenu.
This is actually exactly what I was looking for for a long time, thanks!
Oh bloody hell! This is the answer to the question I couldn't answer in my Facebook interview! It's what cost me the job! In my defense, it was for a Windows Engineering role, but the interviewer was a Linux Engineer....I kinda feel like that was an impossible situation.
I thought in status bar imediatly. The most eficient way of updating a status bar is to use memory. Every change in the status bar can be updated by echoing something in a file and then update the status bar with It, instead of using while commands.
Yay, that's really something I always wanted.
First I thought "When would I need this?"
And then I remembered, always running commands like this after editing markdown:
pandoc Test.md -o Test.pdf
I feel like using an environment for editing Markdown, but I don't.
Just gedit and evince opened in a tiling window manager. And a terminal opened, which is hidden somewhere.
Man, your terminal is nice!
Really nice tool. Thank you Luke. The channel looks way better with the new resolution.
*Programs:*
- github.com/ar-/incron
- github.com/clibs/entr
- github.com/emcrisostomo/fswatch
- github.com/facebook/watchman
- github.com/inotify-tools/inotify-tools
- github.com/l3ib/fsniper
- github.com/m4v/inotify-daemon
- github.com/remy/nodemon
- github.com/silenceper/gowatch
- github.com/systemd/systemd (Path Units under systemd)
- github.com/tycho-kirchner/shournal
- iwatch.sourceforge.net/
*Libraries:*
- pecl.php.net/package/inotify
- github.com/guard/rb-inotify
- github.com/jrockway/anyevent-inotify-simple
- github.com/kolmodin/hinotify
- github.com/rbarrois/aionotify
- github.com/seb-m/pyinotify
- github.com/whitequark/ocaml-inotify
- pypi.org/project/linuxfd/
_p.s. I'll just leave it here_
"A new post appeared on HentaiHaven!"
Put the script
Most of the functionality of entr can be achieved with inotifywait, I think, which is already included on about every system.
Finding this a year late, but inotify and entr have significant limitations with network file systems too. A trap for young players...
ikr wtf is entr :')
@alex mihai in kubuntu it’s knotify
I've actually doing the same with (terribly written) bash scripts for years now, but it's so much easier with this tool, thank you!
Oh this is really nice. I wasn’t getting updates on changes to groff file pdf live comp and this seems to fit the ticket to force it to update.
Wow! Really this is what I have been looking for, as you said. Great thanks.
Love this tool - it's perfect for TDD
Just used this in conjunction with vim's cursorhold thing to get a live preview with groff, it's freaking amazing
2:29 "physically open the file" hahaha
entr is an anagram for rent.
thanks odd bob
Wow Bob
And yours, sir, is due.
Tacocat is tacocat backwards. So is racecar.
And also 'tern'
THE MORE YOU KNOW...
Heck, this is useful. Thanks for sharing!
Excellent! Thank you for sharing such an indispensable tool!
Something like this should be a part of the system: a daemon that checks modified files. I also recommend doing something like this but with commands. For example "when my clipboard contents change, run this command". It's an essential part of my workflow
Awesome! Thank you!👍🏻
Thank You Senpai
LUKE: I listen to Coast to Coast
COMMENTS: *crickets*
Definitely an iconic show...oops, my boomer is showing.
Great show! I miss the days of Art Bell hosting. The Phil Hendrie show was hilarious too.
This is sweet. The possibilities are endless.
Instead of
echo «something» | «cmd»
how about
«cmd»
Thanks for sharing! Didn't know of this one!
This is game changer for automating configuration dot files. If you are someone using the git method for managing configuration files, you can use this to automatically git commit the changes
Great vid!
im trying to figure our why you're wearing shades on your head
It shields his third and fourth eye from CIA surveillance
The key problem with this kind of tool is there is no Unix/POSIX standard for notification of filesystem events. Linux has its own inotify and fanotify systems, other OSes have different ones or none at all, forcing you to resort to periodic polling to notice changes.
I must have that terminal emulator
I can see one interesting application for this that people might be interested in.
Right now I do my note taking at work with Atom, because it has a live Github style markdown preview in-editor.
Now I could open the .md file in firefox while editing in vi for example, and have it reload through entr every time I save my md file, and that way I'd be able to get rid of the 100+ mb text editor bloatware.
You can install kannokanno/previm plugin.
Thx, had my own inotify/-wait wrapper script, but this is way better
this is what i was looking for
Where can I find a list of files that entr is currently watching for? I would like to cancel one of my entr scripts, but can't find any sort of config file.
Very nice. Never heard of this before.
Thanks Luke :)
Sabaton - For whom the bell tolls
I see you have good taste ;)
What color scheme(s) are you using Luke? Your scripts look wicked good on the eyes man! Thanks for another solid video!
gruvbox
@@LukeSmithxyz Sweet thanks!
gb is gay tho, use nord with red and green inverted, get confused by portage prompts
I tried for about 2 hours to re-create this setup with the auto-compiling latex. After a ton of iterations with setsid, ":call system()", silent mode, all in vim or in separate scripts, the best I can get is that the command runs in the background, then vim becomes INCREDIBLY slow and only registers half my keystrokes until I exit and restart it. A bunch of garbage ends up in the command window in those scenarios sometimes, so I think maybe it's being spammed with console output even though I redirected it to "/dev/null" in the script and in the vim call? I have no idea how Luke has gotten his to work.
kinda shocking when you suddenly got rid of your face for a second there
No. I would not install yet another third-party tool for such fundamental task.
Just use `systemd-run \-\-user \-\-path-property=PathModified=$HOME/.bashrc \-\- notify-send "bashrc updated"` for example.
Luke has been on 🔥 lately
Luke, how did you make you cursor change in vim? Like in 6:31
In config.h in st folder, I can only assign one type of symbol for the cursor.
In your vimrc:
let &t_SI = "\033[5 q"
let &t_SR = "\033[1 q"
let &t_EI = "\033[1 q"
This is for extra fuckery:
autocmd InsertEnter * set cul
autocmd InsertLeave * set nocul
You literally saved my life Luke!. Many thanks.
thank you that was useful , what is your linux os name?
"physically opened the file" hahaha
that's the problem with those programs - they don't get enough publicity. thanks for the heads up for entr and tsp.
Damn it never heard of that thanks man
ehhh i just use inotify tools, and for build systems there are language specific tools like guard for ruby, jenkens, etc..
Hi, what window manager are you running?
It's like i finally find the treasure.
Looks interesting, but not really sure how useful ENTR is for automated deployment, when we can use Git hooks to do this.
How are you opening terminals in panels and resizing them like that? What DE are you using?
GUSH: Thank you for your videos! you showed me ranger and it is awesome. I want to be as proficient as you so I will continue to watch your videos. I am currently watching your arch linux install video and doing all of the things. Thank you for your work and video creation. I'm a real fan.
might be "terminator", you're able to open new tabs and split the screen estate assigned to the whole application so each tab has its own space - IT recommended it to me when we were figuring out an issue with my workstation in the university i attend
He's using i3wm
i3wm with custom script for resizing.
You say you dont like auto compilers, I was just wondering about some LaTeX/groff related issues. Do you write all your documents directly in latex/groff from the first draft or do you write it somewhere else first then when its ready write it all into markdown format to be compiled? I'm speaking as a normie who doesnt use these, it seems like a hassle to think about syntax and whatnot while youre trying to think/focus on your writing, and it could draw you out of the right mindstate, especially without an autocompiler. Am I just too much of a brainlet?
I think that writing in markdown is a huge waste of time if you're just going to convert it. Conversion will also always cause complications, so I find it unnecessary.
You don't really have to "think" about the syntax of TeX or groff because it's not really relevant while you're typing 99% of your words. It's really only used when you're formatting special things or setting settings, plus you learn it very quickly.
Plus, I use vim snippets to write most of my syntax.
@@LukeSmithxyz That makes sense, I'll start using it for my documents and see if I can get into it. Too bad my school forces me to use *google docs* for everything.
Thanks.
whoa stop right there so I may be very new to bash but what I've learned is that echo outputs something once. And it closes afterwards. The pipe makes it the input of entr. How tf does entr detect when the file changes? Or is my bash world based upon false beliefs?
Your "se" command seems to be extremely useful.
This almost makes too much sense, so simple. Very light .. du -hs $(which entr) .. 24K
Luke: check out atchange:
alum.mit.edu/www/toms/atchange.html
It can be run from the command line like entr, but also
can take a file listing many files to watch.
Invented around 1997 ...
Editing .Xresources will be less of a chore now.
i am a computer scientist but still i am not as good with bash as luke is ! need to step up my game !
Maybe it's just me, but how do you tell entr to stop looking for changes to for example a file again.
Does entr 'forget' everything on restart of the process?
I really need to get to learn tilling but am scared shitless. Any pointers will be of great help
What Tiling WM are you using?
Wow, I'm impressed, any tips on how to learn coding and this Linux based operating system, at the moment I'm using Windows only??
here is a tip: remove windows, install linux
This can be very usefull for identify some events which can possibly happen during the test.
Something crashes or some error happens .
Intresting , can i set it to recognize if some specific string has appeared in log and to do some actions as result of this event?
How is it works ? Is it gorging cpu?
How does it know that file had been changed?
I am looking for some real reason to justify the tool usage.
I don't think i need it simply for notificate me if file has changed or to update my file immediately in vim , becase mostly what you will want is just the opposite . It's one of vim advantages it uses buffers and doesn't update it immediately.
Hey Luke, how you doing? Just for curiosity, why you don't use tmux? Have you already said the reason before? You don't like it? Another one, how you can change font size in keyboard? I'm using termite as terminal emulator and I have to reload it after changing conf file :(.
Anyway, keep this great work.
I don't have any real use for tmux because I use a tiling window manager. I don't know anything about changing font size in termite, but in my terminal I have I binding for it and that's what I use:
github.com/LukeSmithxyz/st
recent vid on my terminal in case you missed it: ua-cam.com/video/9H75enWM22k/v-deo.html
I use i3 as well and tmux :). Ok thank you.
@@brunocriado8038 why? whats the benefit of using both?
@@iusewindowsbtw3420 In each workspace I use only one application. For instance, on workspace 1 I use terminal with tmux in fullscreen. It is less distractive for me. So if I need to open a new terminal I won't see because it is in fullscreen. With tmux I can split it or create a new pane.
Other benefit, I don't need to use mouse, I can copy/paste to/from my primary/secundary clipboard just using keys.
So there is other benefits in my environment, but I think these are the main reasons that I use tmux.
99% of this makes no sense to me :D But it looks very interesting. Also do you ever use your computer for normal stuff like facebook or twitter? :D
lol
Could you use this to monitor log files and make automatic backups before clearing them after a certain number of updates? Either way seems like a great tool
That's pretty cool. How does it watch changes for "ls" without repeatedly running "ls" in the background? I use ls just as an example, but it applies to anything really. Since you can seemingly feed it any arbitrary command, how does it know how to handle whatever you pipe into it? Using ls as an example.. when you initially pipe ls into entr, I assume it takes the output from ls, and puts it into some kind of background job to rerun the same command and monitor for changes. In order to discover changes to your initial command, it would need to rerun your command and refresh the output.. again, since the input is arbitrary and not hard-coded into entr with explicit callbacks. Is entr just running your commands in a background loop over and over or is it using some kind of linux voodoo I'm not aware of? If it is rerunning your command, it would seem it could get pretty resource hungry if you're not careful what you're piping into it (e.g. ls -R in a massive directory)
Not sure if you really get the whole concept of standard input. Once you pipe the text output to a program, it first program is done. You could uninstall ls from your computer and it wouldn't matter. entr reads text input, which is what ls *html produces on the initial run.
@@LukeSmithxyz Very likely that I don't fully understand how standard input works (source: I don't) :) Thanks for the info. Just trying to wrap my head around how this works
Like the other comments stated: learn about standard output, standard input and standard error.
(github.com/hcs/bootcamp-unix/wiki/stdin,-stdout,-stderr,-and-pipes)
And about the loop question: No it doesn't it uses the inotify mechanism of linux to be warned when one of the inodes is changed. Tip: learn about the unix filesystem to learn about inodes
(www.grymoire.com/Unix/Inodes.html)
@@davidheremans6978 Thanks a lot. I actually really appreciate that .. I'll give them a read
What is your terminal, it looks very nice..
What distro / X is being used in this video please? I admire the window organisation.
i3 window manager
It'd be great if you can do a video about fzf
I have a shell script to reload my c-lang file on save, it is pretty janky and works half the time at best, will definitely give this a shot tonight
Entr the Matrix.
Can anyone without strong indian accent please make a video about Jenkins.
Nice!
Wait are you using i3? Why is your bar on the top? I still don't know how to do that… I do use macOS as my daily driver and just run manjaro i3 in a vm :/
How would you tell entr to watch this command "( task next limit:5 )" out for change but have it always print into terminal?
whats the point of task spooler? is it a replacement for `at now`?
still very new to MacVim, how do some people increase the font size on the fly? I have seen more than one demo on vim and some do this, I can hear the keypresses.
That is terminal-mode vim (not gui vim). You just need to increase the font size of the terminal. The keys depend on the terminal emulator (on PC it's more often than not CTRL+; CMD+ for mac maybe?)
hi Luke, how do you filter you files in 5:43 in command-line?
That's fzf. I might do a video on it later this week.
I've been using "when-changed" for this utility until now, is entr better in any way? when-changed is a python script and entr is in C, so entr might be more Linuxy in a sense, but I don't know...
Isn't it just the catcher of `inotify` event?
hey, a fellow sabaton fan!
What operating system are you using?
What do you think of watchman, the tool that Facebook made that accomplishes the same thing?
Thanks, using podboat is always a pain in the ass. Is entr always running in the background though checking for file updates? Isn't that huge bloat?
It doesn't use any significant system resources, you can check it yourself. For example, on my machine now, my inactive mpd instance and my inactive notification manager are taking up much more system resources than entr.
If you really were concerned, I'm just it wouldn't be too hard to make a wrapper for newsboat that autostarted/stopped entr.
Hey Luke, what terminal software is that exactly?
for web dev you have tool like watching tool(s) in build systems :D
Much automation you do by that so installing next program is meeh :P
sometimes i wish webdevs could just save changes they make in the browsers devtools locally especially when the have access to the source files
Would like to know how you resize and move your windows
I don't understand his purpose. Can't you just use an "&&" logical operand? For example "sudo pacman -Syu --noconfirm&¬ify-send "Packaged upgraded!""
System Administration confirmed.
Hey, what did you use to search for that autocomp file?
yo, this is exactly what i didn't know i needed, you get a subscribe from me dude.
I can't seem to write to the stdin of the command i run with entr.. That's the only reason why i tried it out, and it doesn't wor..
*Whats the name of the font used in the terminal above!!??*