Creating A "Help" Program For DTOS Using Dmenu

  Рет қаралды 11,896

DistroTube

DistroTube

Күн бұрын

I decided to create a simple bash script to create a "help" program for DTOS. This script will list (in dmenu) some of my tutorial videos on topics such as XMonad, Doom Emacs, etc. Creating such a script should take just a few minutes, so I thought I'd do it on camera.
REFERENCED:
► gitlab.com/dwt... - The script
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
SOCIAL PLATFORMS:
🗨️ Mastodon: distrotoot.com...
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/$/i...
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gemini Capsule: gemini://distro.tube
📁 GitLab: gitlab.com/dwt1
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Ardour: ardour.org/
💻 VirtualBox: www.virtualbox...
🗒️ Doom Emacs: github.com/hli...
Your support is very much appreciated. Thanks, guys!

Пікірлер: 54
@user-ux2kk5vp7m
@user-ux2kk5vp7m 2 жыл бұрын
Another way to add quotes to the end of all the lines is to select them and do the command s/$/"/ It replaces the end of each line with a quote. You can do the same with ^ to prepend text to lines
@DistroTube
@DistroTube 2 жыл бұрын
Yea a substitution works. I could have also used command mode like I did inserting the text at the beginning of the line. But I had already shown both of those, so I thought I'd show how a macro works. ;)
@haidermirza192
@haidermirza192 2 жыл бұрын
Thank you for making videos on scripting. Has become VERY useful lately.
@vlatkosurlan545
@vlatkosurlan545 2 жыл бұрын
Should've been 'Shift+v G' to select visually everything to the end of the buffer. Thanks for your work! Love it!
@Miguel_GM
@Miguel_GM 2 жыл бұрын
Great video. I like this step-by-step scripting videos. They are very educational. Thanks!
@sharqueeshajohnalaneesha2019
@sharqueeshajohnalaneesha2019 2 жыл бұрын
2:47 No, it was a beginner’s mistake
@ewancox4895
@ewancox4895 2 жыл бұрын
In vim, there is a quicker way to add something to multiple lines using "Visual block" mode; 1) Use Ctrl+V to enter mode 2) Then simply down arrow (or J key) to highlight the beginning of all of the desired lines you wish to prefix 3) Then use Shift+I to enter insert mode at the beginning of the top line to start typing 4) Then press Esc key to re-enter normal mode and in doing so, Vim will prepend each of the previously selected lines with the text you entered on the first line. You can also use this method to quickly add text to the end of each line without the need for a macro. Simply follow as above, with a few differences; 1) Go to end of the first line to add text to 2) Use Ctrl+V for Visual block mode and select the desired lines 3) Use Shift+A for append text mode 4) Enter the text to append to each of the lines selected in Step 2 5) Press Esc to exit back to normal mode, writing the text to all of the lines in the process.
@Chinmoku_No_Te
@Chinmoku_No_Te 2 жыл бұрын
Much appreciated brah, I'm totally loving DTOS!!! I got it on my main production desktop and laptop!!!
@DistroTube
@DistroTube 2 жыл бұрын
^^ This guys lives dangerously! :D
@haidermirza192
@haidermirza192 2 жыл бұрын
I did it the very first minute you posted the initial video on my main machine.
@zhenya2055
@zhenya2055 2 жыл бұрын
Testing in PROD is the best kind of testing. Finds all the bugs extremely quickly. And fixes get implemented at an expedited pace. :D
@BlindRambler
@BlindRambler 2 жыл бұрын
I'm not going to install yet, but I might actually put it on my current machine when I get a new machine just after January.
@jonnypeace2810
@jonnypeace2810 2 жыл бұрын
Always learn something from fellow script writers, great stuff :)
@swayamshree5951
@swayamshree5951 2 жыл бұрын
It is surprising that this video showed up on my timeline as I am working on my own post installation script for ubuntu using spectrWM
@wer3eng760
@wer3eng760 2 жыл бұрын
Not sure if doing 2 normal commands but then resulting to doing a macro just for the closing ending quote is really the way to do that instead of just sticking with normal commands or doing only one macro in the first place. But all right.
@0x007A
@0x007A 2 жыл бұрын
DT may have been demonstrating two ways to modify multiple lines of text without worrying about optimisations. The closing quote mark could, as you said, been done the same way as the other two edits.
@stephenreaves3205
@stephenreaves3205 2 жыл бұрын
Have you gone over how you make the strikethroughs in your vims replacement? Or is that an evil mode feature?
@DistroTube
@DistroTube 2 жыл бұрын
The default behavior in Doom Emacs.
@deansundquist9601
@deansundquist9601 2 жыл бұрын
This man would have been a wonderful radio host if it was 1935. Give er a bad shebang
@SlideRSB
@SlideRSB 2 жыл бұрын
13:50 Why are you using printf inside of command substitution to get the video url? Can't you just take the array value and assign it to your url variable? url=${dtvids[$title]}
@DistroTube
@DistroTube 2 жыл бұрын
Of course, I could do that! Keep in mind that this was a "I'm doing this on the fly" kinda video. ;) That being said, I have removed the unnecessary printf in the script now.
@SlideRSB
@SlideRSB 2 жыл бұрын
@@DistroTube Fair enough. Always interested to see your thought process during a live coding session. As for myself, I don't normally think to resort to command substation until other solutions fail to execute the desired objective.
@henrikmunch8609
@henrikmunch8609 2 жыл бұрын
6:33 How are you able to highlight not only all the instances of the search, but also the how the text would look after the replacement? PS: great vid!
@ganeshhkuramsetti
@ganeshhkuramsetti 2 жыл бұрын
may be we can use mpv .. if someone intrested only in the video content but not on the comments or show notes. We can add that choice 😊
@voiceofthetrue1849
@voiceofthetrue1849 2 жыл бұрын
Hey DT! You should pip it to mpv instead.
@DistroTube
@DistroTube 2 жыл бұрын
Mpv is going to have a lot of latency and new users are going to wonder if they even selected something when mpv takes forever to load. Of course, anyone could edit the script and change "qutebrowser" to "mpv". But the browser is definitely the better default in this case.
@SlideRSB
@SlideRSB 2 жыл бұрын
Instead of editing all of that table data to shoehorn it into an associative array, I think a better approach would have been to wrap it into a Heredoc and then read the entire table into a shell variable. Then you could pipe it into cut or awk to present the list of titles with dmenu. Once a choice has been made, grep the selection against the variable containing the Heredoc to get the line and then use cut or awk again to get the URL. That will also get rid of all your bashisms and make things more POSIX.
@stevie1da_
@stevie1da_ 2 жыл бұрын
Its funny, ChrisTitusTech just finished his arch install script. Now you can combine forces and make a proper arch based distro
@fallsdp
@fallsdp 2 жыл бұрын
They are approaching things from somewhat different perspectives. But…yes….these two have very interesting projects.
@N0zer0
@N0zer0 2 жыл бұрын
No, it's not funny. CTT stopped using Linux, switched back to Windows and promotes that. Just ignore that guy.
@vgg175
@vgg175 2 жыл бұрын
i have an idea for this script! I think pæaying the video in mpv over qutebrowser would be best (less load time and mpv is better for playing videos)
@mohammedhaman6517
@mohammedhaman6517 2 жыл бұрын
Yup.
@edbeckerich3737
@edbeckerich3737 2 жыл бұрын
Get rid of YT adds too
@Ironpants57
@Ironpants57 2 жыл бұрын
If only the cache wasn't so slow in mpv :/
@svenkarlsen2702
@svenkarlsen2702 2 жыл бұрын
Aren't array keys limited by length/charset?
@ocsanik502
@ocsanik502 2 жыл бұрын
Always end if statements with a hanging ifelse just to scare it into working.
@robertoaks8260
@robertoaks8260 2 жыл бұрын
First DT ❤️
@DistroTube
@DistroTube 2 жыл бұрын
🎉 Congrats!
@michaelplaczek9385
@michaelplaczek9385 2 жыл бұрын
Hey DT, why do you Emacs instead of Vim?
@ShitTot
@ShitTot 2 жыл бұрын
Might be answered in his video here... [Vim vs Emacs. Which is Better?] kzbin.info/www/bejne/jJKllZ-ZjsaNgrM
@aratof18
@aratof18 2 жыл бұрын
Not first
@DistroTube
@DistroTube 2 жыл бұрын
Confirmed!
@amiraloi1694
@amiraloi1694 2 жыл бұрын
Hey DT can you test Qubes OS on a video? I checked tour channel for such a video but I didn't find anything yet.
@thefossenjoyer3346
@thefossenjoyer3346 2 жыл бұрын
Nah, I'm not first.
@simondj8572
@simondj8572 2 жыл бұрын
waht about sway wm ?
@mrchristoph5674
@mrchristoph5674 2 жыл бұрын
Hope be doesn't get de monitized for "assarray"
@ghareluvlogger3234
@ghareluvlogger3234 2 жыл бұрын
please try a steno keyboard
@leviticus8930
@leviticus8930 2 жыл бұрын
Dmenu. No Bloat. Merica
@christianhofmann7223
@christianhofmann7223 2 жыл бұрын
sorry @DT, I can not really follow you - why putting Data and Programm into one File ? - You can read that from Stream (ls or preprocessed file) - so here you have to preprocess the Data every time it changes manually ??? - have I missed something ?
@edbeckerich3737
@edbeckerich3737 2 жыл бұрын
Pipe it ytfzf
@11WicToR11
@11WicToR11 2 жыл бұрын
and you did that all manually? xD have you heard of youtube-dl ? *youtube-dl -e "video url or channel url"* => gets title *youtube-dl --get-id "video url or channel url"* => gets video id you paste at the end of youtube url its funny that your "linux tingle" didnt go off after you copy and pasted things 50+ times. That baffles me *EDIT:* at the last line of his script add: *mpv $url* when you have youtube-dl and mpv they work together to avoid using entire browser to play ads then video but instead play it in neat separate video player !
@thenextpoetician6328
@thenextpoetician6328 2 жыл бұрын
Beginner's ...
Shell Aliases Every Linux User Needs
29:03
DistroTube
Рет қаралды 37 М.
Want A List Of Your Keybindings? Write A Shell Script!
27:11
DistroTube
Рет қаралды 24 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
ТИПИЧНОЕ ПОВЕДЕНИЕ МАМЫ
00:21
SIDELNIKOVVV
Рет қаралды 1,9 МЛН
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 80 МЛН
The Tragedy of systemd
47:18
linux.conf.au
Рет қаралды 1,1 МЛН
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 100 М.
Become a bash scripting pro - full course
36:00
CODE IS EVERYTHING
Рет қаралды 61 М.
dmenu: Your own Custom Script Menus!
10:29
Luke Smith
Рет қаралды 137 М.
Essential Linux Commands - Cat, Tac and Tee
21:07
DistroTube
Рет қаралды 24 М.
Installing Arch Linux Plus DTOS
34:19
DistroTube
Рет қаралды 66 М.
Arch Linux Experience - Hyprland
39:02
Bog
Рет қаралды 192 М.
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,7 МЛН
Learning Sed Is Beneficial For Linux Users
19:27
DistroTube
Рет қаралды 85 М.
Linux is a MAJOR Rabbit Hole
36:40
TechHut
Рет қаралды 674 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47