Want A List Of Your Keybindings? Write A Shell Script!

  Рет қаралды 24,622

DistroTube

DistroTube

Күн бұрын

Пікірлер: 94
@nikkehtine
@nikkehtine 3 жыл бұрын
I like these kinda videos where the presenter shows the problem and how they solved it, from a purely problem-solving mindset, instead of holding your hand telling you what to do so that you can just copy-paste their code and learn nothing from it
@agushex
@agushex 3 жыл бұрын
Totally agree, when coding mistakes WILL happen, people need to understand that because they tend to believe that if something doesn't work something is going to break... which well can be true in some extreme cases like it happen to me yesterday but if you're just playing with sed and grep it's okay xD
@temudjin1155
@temudjin1155 3 жыл бұрын
That is what I like when I watch your videos : You make mistakes and you show how to deal with the problems. Great man
@Noukkis
@Noukkis 3 жыл бұрын
You can get rid of the invert grep by using '^\s*, ("' instead of ', ("' o the first one, or even simply '^, ("' if you get rid of the spaces first. And also, you can use \s instead of [\t ] in sour sed command (\s basically means "all stuff that looks like a space but might not actually be that actual character")
@yoannguillard6877
@yoannguillard6877 3 жыл бұрын
So something like this : ^\s*[[,] (" Would do complete job !
@jeremywhetzel4007
@jeremywhetzel4007 3 жыл бұрын
What a great idea! That's been the one thing that's made it hard for me to get into tiling window managers, and it never occurred to me to just parse the bindings out of the config file. Thanks for showing how easy it can be!
@freedombsd2539
@freedombsd2539 3 жыл бұрын
AwesomeWM Windows Manager is not as Awesome as Derek's tips and tutorials! I no longer fear the terminal and scripts. Thank you for my daily dose of DT.
@Zoltar358
@Zoltar358 3 жыл бұрын
Ingenious. I think you should make more videos like that.
@justjie1008
@justjie1008 3 жыл бұрын
I really like how your terminal looks as it shows terminal with having the word “terminal” on the top
@Not-THAT-ChrisPratt
@Not-THAT-ChrisPratt 3 жыл бұрын
Thanks for introducing yad. I appreciate these little utility programs. Please introduce more of these as you see fit.
@edwardsmith1237
@edwardsmith1237 3 жыл бұрын
A very nice tutorial, DT, and a great way to show less confident users that you can make nice and useful scripts by starting with an idea of what you want to achieve, and then working thru the steps bit by bit. I like how you tested each step before proceeding to the next one. Yes, I'm sure the super duper ninja scripters will (and have) point out faster ways of doing this, but that's missing the point. Keep up the good work!
@matthewmiller3630
@matthewmiller3630 2 жыл бұрын
Distro, you are an underreated teacher. Thanks for these great videos.
@fakharhaider2357
@fakharhaider2357 3 жыл бұрын
Just the video I needed, I literally subbed to this channel so that I can learn a bit about Linux before switching to it, nice to see that this channel actually gives you the content you need, awesome video keep it up, I Hope you make a video about sudo and other command previleges and how to remember them just like this method Thanks
@clayotissmith158
@clayotissmith158 3 жыл бұрын
I am personally a huge fan of using grep like: grep (-v) "first pattern\|second pattern\|third pattern" Rather than multiple grep commands or splitting it between multiple lines. I know that Linux source commits mandate lines be less than 100 columns, but damn is bash hard to read when split between multiple lines with how terse it is. I just wish see had a similar technique to prevent a large sed command from being so hard to read and follow.
@whale5086
@whale5086 3 жыл бұрын
Awesome vid! Taught me a few neat tricks. Wasn't aware of the Yad program either, and I've been looking for something exactly like that for one of my own scripts! Thanks :)
@torsten.breswald
@torsten.breswald 3 жыл бұрын
parsing through a text file, transform the text and put it out, that screams for awk, and you can use awk for everything i learned on a channel called distrotube, maybe you've heard of ^^ i'm just to lazy right now to tinker it out myself, but i would try to filter for "spawn" then set the delimiter to the double quote " to have like 4 fields, strip away some unneeded stuff and give that to yad, yea as i think about it, it wouldn't be any shorter then, so many ways lead to rome i guess i appreciate you leaving your fails in the video, often times these mistakes help me more than just the run over the script
@IvicaAnteski
@IvicaAnteski 3 жыл бұрын
thank you DT, just what I needed!
@Danielddiniz
@Danielddiniz 3 жыл бұрын
Derek You always anticipate our needs my friend! Thanks 😊 🙏🏻 as always for the video and your teaching skills are amazing!
@stevie1da_
@stevie1da_ 3 жыл бұрын
I have a little script in my qtile build that generates a markdown file with all my keybinds whenever I restart qtile. I also have a bind that opens that markdown file in a viewer for a quick help menu!
@krzysztofwaleska
@krzysztofwaleska 2 жыл бұрын
Do you share it somewhere? I would be very much interested in something like this. MarkDown sounds like very good idea. Qtile lacks functionality in that region.
@SilentFire08
@SilentFire08 3 жыл бұрын
I see you changed your audio recommed audio software from audacity to ardour can you make a video about it?
@indrajitsarkar3169
@indrajitsarkar3169 3 жыл бұрын
great timing, I was looking for a solution to this exact problem
@snipzmattio5887
@snipzmattio5887 3 жыл бұрын
This is a amazing idea/video! Thank you so much
@Chris-ip8uv
@Chris-ip8uv 3 жыл бұрын
Good stuff, DT. Thank you!
@Jeff_Seely
@Jeff_Seely Жыл бұрын
I am really enjoying the DTOS config and this is a good piece to the key bindings puzzle😁. And Awesome is very aptly named. Being rather new to TWM I find it quite a bit easier to hop around on. All good things though 👍
@himalpoudel7558
@himalpoudel7558 3 жыл бұрын
This is what I wanted forever
@RAndrewNeal
@RAndrewNeal 3 жыл бұрын
Before getting 5 minutes into the video, I paused it and did it for my i3 config file. I colored all the output to make it easy to read. But since I colored it with ANSI escape codes, I couldn't properly display it in YAD, so it displays in the terminal.
@GodIsTheReason
@GodIsTheReason 3 жыл бұрын
This is a fun idea for someone who already likes tinkering with TWMs and shell scripts, but honestly... I don't think you're going to convince anyone else to start using TWMs and shell scripting with this video ;)
@jrlepage
@jrlepage 3 жыл бұрын
@DT this was amazing!! Btw, how much caffeine did you consume before recording this? 😂
@BenitoF2009
@BenitoF2009 3 жыл бұрын
Hey DT! Thank you very much! That came exactly at the right time! 👍 And it works great with xfce. I only just had to change the file to read from and some commands.
@Phydoux2112
@Phydoux2112 3 жыл бұрын
Great stuff! I love shell scripting! Yad is a new one for me. I'll have to play around with that one of these days. Looks pretty slick. BTW, I'm running AwesomeWM and I tried the holding the Super Key and the shortcuts did not come up.
@ZuluEchoRomeoOscar
@ZuluEchoRomeoOscar 3 жыл бұрын
Super + 's' in the default config I believe...
@Phydoux2112
@Phydoux2112 3 жыл бұрын
@@ZuluEchoRomeoOscar thanks. I'll try that when I get home tonight.
@lamprospitsillou6325
@lamprospitsillou6325 3 жыл бұрын
Can you please do a video on yad? There isn't much online and my imagination goes wild from the uses i can think in scripts!
@MrQwebek
@MrQwebek 3 жыл бұрын
Is it like when you love your old car and keep upgrading it instead of switching to new one and live further?
@florianfelix8295
@florianfelix8295 3 жыл бұрын
A true real world problem :D
@soanvig
@soanvig 3 жыл бұрын
I would print this as table using column command
@FedoraRose
@FedoraRose 3 жыл бұрын
Man that’s really helpful 😂👌
@bostickdoesmusic1746
@bostickdoesmusic1746 3 жыл бұрын
I always just write out a text file called like .keyhelp or something and list all the keybindings there. Then I alias it in my zshrc with cat so "keyhelp" just pops them out in the terminal for me.
@XenHat
@XenHat 3 жыл бұрын
Nice! You really need to up your regex game though, DT.
@TheJustinist
@TheJustinist 3 жыл бұрын
@@detboi2287 But is really powerful even with just the basics
@dkosmari
@dkosmari 3 жыл бұрын
I was going to comment something like this, but he's actually teaching a very useful way to build up a regex by iteration. Instead of having to think how to combine multiple regexes, it's easier to just supply them separately.
@gerarddelapatefeuilletee4063
@gerarddelapatefeuilletee4063 3 жыл бұрын
I wonder if I have a hearing problem or a vision problem: I hear you say that you use emacs, but what I see is vim and its typical keystrokes. Anyways, thanks for the scripting tips and tricks, I must see that yad thing.
@YannMetalhead
@YannMetalhead 2 жыл бұрын
Fantastic video.
@maskedredstonerproz
@maskedredstonerproz 3 жыл бұрын
11:11 Can't you pipe everything through awk, and then use that to print the keybindings and what they are used for??
@act.13.41
@act.13.41 3 жыл бұрын
He stated in the video that he could have done it in awk, but viewers have been asking for things done other ways. This was done for the noobs (like me) who don't know awk.
@elys7563
@elys7563 3 жыл бұрын
Can we make some(4-5) keybinding script and show it in yad and by select any script would show the particular dialogue? Like in qutebrowser
@megabates9016
@megabates9016 3 жыл бұрын
Great video, thx 👍👍
@fauzirfandika
@fauzirfandika 3 жыл бұрын
Hey DT, great vid as usual! I've been trying to record a video/podcast (linux related stuffs, in my language) and having trouble with the speech (kinda nervous and all), any tips on that? Do you make script about the topics? I would love to see and learn how you do the creative process (mainly pre-recording stuffs like topic research, script writing, etc) on making a video!
@TON-vz3pe
@TON-vz3pe 3 жыл бұрын
Shell script is pretty easy to write once practice.
@j777111able
@j777111able 3 жыл бұрын
3+ people with perfect memories disliked this video. 🤷‍♂️
@terrydaktyllus1320
@terrydaktyllus1320 3 жыл бұрын
More like three self-entitled people with parents that didn't say the word "no" enough to them in their formative years.
@MsAlfred1996
@MsAlfred1996 3 жыл бұрын
Where can I learn all this programs like grep, sed and such ?? How do I know how many of these are ??
@foobars3816
@foobars3816 3 жыл бұрын
learn regex ask they all just use that.
@MsAlfred1996
@MsAlfred1996 3 жыл бұрын
@@foobars3816 What is "regex" ?
@beardog5245
@beardog5245 2 жыл бұрын
That was awesome
@hamzab1821
@hamzab1821 3 жыл бұрын
Make more of this worflow video. awesome
@dougtilaran3496
@dougtilaran3496 3 жыл бұрын
XFCE rules the key game.
@GreyDeathVaccine
@GreyDeathVaccine 3 жыл бұрын
XML file?
@JuanPerez-iu9vk
@JuanPerez-iu9vk Жыл бұрын
Thank you
@noferblatz
@noferblatz 3 жыл бұрын
Wouldn't it have been easier to just use "spawn" for your search criteria? Is that guaranteed to catch all the key bindings?
@DistroTube
@DistroTube 3 жыл бұрын
The "spawn" isn't used in all keybindings.
@jondow1988
@jondow1988 3 жыл бұрын
its diffcult if you have keybindings all around your config files. maybe awk is a better option to do that. since it process line by line all the file.
@jondow1988
@jondow1988 3 жыл бұрын
very easy with awk interpreter. just get the patterns you wanna grab, and awk will output all lines matching those patterns. and also you can use awk interpreter. no need to use the shell. an awk script would be nice.
@leviticus8930
@leviticus8930 3 жыл бұрын
Dude, who do you use for internet? I would have done gone Nick Saban on them.
@bullpup1337
@bullpup1337 Жыл бұрын
I would have used awk I think.
@ejbully
@ejbully 3 жыл бұрын
In all honesty After I remeber my binds They are similar across $USER I sort of like the mysteriousisty of not having a handicap. Only I know my shortcuts. It doesn't need to advertised. BUT regardless scripting is ALWAYS fun
@misterchief5378
@misterchief5378 3 жыл бұрын
dwm lists all the keybindings in config.h
@FreeRoger
@FreeRoger 3 жыл бұрын
5th! I mean 3rd!
@FreeRoger
@FreeRoger 3 жыл бұрын
@Hai Red i was doing a monty python reference
@dkosmari
@dkosmari 3 жыл бұрын
"So what's the best way to do this" is how you start on the wrong foot, as a shell script programmer. The time to second guess yourself is after the point of no return.
@terrydaktyllus1320
@terrydaktyllus1320 3 жыл бұрын
Nonsense! That's exactly how you ***DO*** write a shell script - you decide what the problem is you want to solve, and that start thinking about the best ways to do each part. And what do you mean by "second guess yourself"? How can you "guess" something that is already inside your own head anyway? How many shell scripts have you written? Not too many by the sound of it, if you spend that much time faffing about.
@ananthuskumar1286
@ananthuskumar1286 3 жыл бұрын
use regex instead of 2 grep, ^
@terrydaktyllus1320
@terrydaktyllus1320 3 жыл бұрын
Why? He's trying to solve a problem, not impress someone looking over his shoulder with his coding expertise. Once a script works and you've solved the problem that you need to solve, then you can keep going back to it later and refining it. If you're always trying to "impress your friends", you'll never get anything finished.
@Tn5421Me
@Tn5421Me 3 жыл бұрын
tfw DT isn't a Haskell Witch
@tetbundy5683
@tetbundy5683 3 жыл бұрын
Use column -s ',' -t to get a nice table format instead of substituting with colon Not respected by yad tough :(
@moutasim_ayoubi
@moutasim_ayoubi 3 жыл бұрын
First
@DistroTube
@DistroTube 3 жыл бұрын
Confirmed!
@jrlepage
@jrlepage 3 жыл бұрын
Doh did ya beat me? Haha congrats 🎊
@moutasim_ayoubi
@moutasim_ayoubi 3 жыл бұрын
@@jrlepage Haha Gg
@FekuEntertainmentLtd
@FekuEntertainmentLtd 2 жыл бұрын
Why not just use an inverse grep, with pattern "\-\- *" and remove all comments.
@alexzander__6334
@alexzander__6334 3 жыл бұрын
please update video title to mention that these keybindings are ONLY for xmonad
@killistan
@killistan 3 жыл бұрын
Performance wise (not that it matters), I think you could do all of that with a single invocation of sed. Sanity wise, maybe Perl would be a good fit for this?
@foobars3816
@foobars3816 3 жыл бұрын
dear god no!
Fix Your Shell Scripts With Shellcheck
11:18
DistroTube
Рет қаралды 14 М.
Three Incredibly Useful Command Line Tools (shuf, sort, uniq)
10:57
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Essential Keybindings For Bash, Fish and Zsh
16:41
DistroTube
Рет қаралды 29 М.
Why Are Open Source Alternatives So Bad?
13:06
Eric Murphy
Рет қаралды 710 М.
How To Use Shell Environment Variables
15:08
DistroTube
Рет қаралды 34 М.
What Are Linux Users Putting In Their Config Files?
31:47
DistroTube
Рет қаралды 93 М.
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 102 М.
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 263 М.
I Think I Like AppImages More Than Snaps And Flatpaks
14:15
DistroTube
Рет қаралды 29 М.
Solve Problems With Shell Scripting And Dmenu
18:26
DistroTube
Рет қаралды 33 М.
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Рет қаралды 2 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.