VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » IT, programs, coding
Creating A -Help- Program For DTOS Using Dmenu DistroTube

Creating A -Help- Program For DTOS Using Dmenu DistroTube

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Creating A -Help- Program For DTOS Using Dmenu 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. - https://gitlab.com/dwt1/dtos-configs/-/blob/main/etc/dtos/.local/bin/dtos-help - The script
Date: 2022-03-30

Comments and reviews: 10


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.

reply

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.
reply

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 ?
reply

I like how you leave all the mistakes you do on the video instead of editing them out, because not only you show us, the viewers, what not to do, but also you show that you aren-t that powerful Linux god that does everything perfectly first try.
reply

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.
reply

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

reply

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]-

reply

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!

reply

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 -

reply

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
reply
Add a review, comment






Other channel videos