[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Does it makes sense to port all your aliases as bash scripts
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 19
Thread images: 5
File: qt white girl.jpg (44 KB, 825x960) Image search: [Google]
qt white girl.jpg
44 KB, 825x960
Does it makes sense to port all your aliases as bash scripts in your
/usr/local/bin/
directory so that Alt+F2 or dmenu acknowledges their existence?
>>
>>52181618
sure why not it's your computer do whatever will make your life better
>>
Now what would be the use of that?

Lets say you make an alias for
apt-get install
wouldn't it be just as fast just to write it in your terminal? what kind of alias would be useful in the dmenu?
It just never occured to me, I have never tried opening anything like that with the dmenu.
>>
File: life is a burden.jpg (250 KB, 530x397) Image search: [Google]
life is a burden.jpg
250 KB, 530x397
>>52181662
>wouldn't it be just as fast just to write it in your terminal?
Yeah, but then I wouldn't have to clutter up my desktop with another terminal window

>what kind of alias would be useful in the dmenu?
Well, for example I had an i3 bindsym that did the following:
bindsym Mod4+Shift+y exec echo 'youtube-dl "'`gpaste get 0`'"' > yt.sh ; exec echo mpv --quiet ~/pr/done.mp3 \*`gpaste get 0`\* >> yt.sh ; exec xterm -e bash yt.sh

bindsym Mod4+Shift+s exec echo 'youtube-dl --extract-audio' "'`gpaste get 0`'"' > yt.sh ; exec echo mpv --quiet ~/pr/done.mp3 \*`gpaste get 0`\* >> yt.sh ; exec xterm -e bash yt.sh

Which would instantly create a new xterm window that I could shove off to the side and be audibly alerted when it was finished downloading and if I was careful to only copy the end of the Youtube URL, then it would automatically play the video when it was done as well.

Since youtube-dl commands don't seem to do anything by themselves in dmenu, it might be useful to port this command to the /usr/local/bin since it makes use of a bash file and I think it seems to respect the actions of bash files more, since I've had no problems with my bash script for downloading the latest episode of The Biggest Problem in the Universe
#!/bin/sh

EPISODE_NUMBER=`cat /home/anon/.episode_num`
NEXT_EPISODE=`expr $EPISODE_NUMBER + 1`

xterm -e links https://traffic.libsyn.com/biggestproblem/BiggestProblemInTheUniverse${NEXT_EPISODE}.mp3
wget -nc https://traffic.libsyn.com/biggestproblem/BiggestProblemInTheUniverse${NEXT_EPISODE}.mp3 && echo $NEXT_EPISODE > /home/anon/.episode_num
>>
>>52181618
qt 3.14 10/10 88/88
>>
File: how to learn perl.png (203 KB, 1360x768) Image search: [Google]
how to learn perl.png
203 KB, 1360x768
>>52181662
>Lets say you make an alias for
>apt-get install
>wouldn't it be just as fast just to write it in your terminal?
You just gave me an idea.

install.sh
xterm -e sudo apt-get install `gpaste get 0`"
>>
>>52182419
What does gpaste do?
>>
File: Mr Robot Started In 2016!.png (885 KB, 1360x768) Image search: [Google]
Mr Robot Started In 2016!.png
885 KB, 1360x768
>>52182447
>What does gpaste do?
It copies anything from the clipboard buffer. Unfortunately xterm doesn't know about the clipboard buffer, only the primative primary buffer and it's such a good minimal terminal for so many other things, and I have no idea of anything I can do to either paste clipboard data into xterm or paste primary buffer data inside a command.
>>
>>52181618
why not just add your $HOME/bin to your $PATH?
>>
>>52182587
>why not just add your $HOME/bin to your $PATH?
It's finicky, as far as I can tell. Works somewhat inconsistently.
>>
>>52181618
drun is just a shell script wrapper around dmenu, go patch it if that's what you want.
>>
File: Latex Fuct.png (204 KB, 1230x758) Image search: [Google]
Latex Fuct.png
204 KB, 1230x758
>>52182637
>dmenu, go patch it if that's what you want.
Well, what about Alt+F2 for other DE's?
>>
>>52182673
Oh, right. I forgot what Alt-F2 does on normie DEs, I thought that was just your choice of keybinding for drun.

In that case I'd say add ~/.local/bin to your $PATH (which you should do anyway) and write a bash script to parse the output of `alias` and dump shell scripts in that directory.
>>
>>52182637
>>52182637
>drun is just a shell script wrapper around dmenu, go patch it if that's what you want.
Won't that make it go slower? The whole point of dmenu is that it's instantaneous. I once tried out some dmenu substitute I read about somewhere I forget what it's called, but it had more features but was much slower, and I found myself often executing misspelled commands simply because I was too confident in it's speed.

If there are any good dmenu substitutes, though, I'd love to try them.
>>
>>52181618
Happa girls are such cuties.
>>
>>52182755
Happa?
>>
>>52182718
>write a bash script to parse the output of `alias` and dump shell scripts in that directory.
You sound like a smart guy. Do you know of a way to port .i3/config files to xbindkeys or sxhkd.
>>
>>52182765
>Happa?
It's weeb for Herpes Girls
>>
>>52183027
OP is a bug catcher?
Thread replies: 19
Thread images: 5

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.