![]() |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
Amusingly, setting quickmix stations in the pianobar UI is easier than setting it up on the web page! At least IMHO. Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Thanks!
Hey, I'm terrible at scripting so how could I get all of these commands to execute with a simple launch file? xmodmap /home/user/.Xmodmap_pan PATH=$PATH:/usr/local/bin llib pianobar xte 'keydown rightparenth' 'keyup parenth' 'keydown rightparenth' 'keyup parenth' 'keydown rightparenth' 'keyup parenth' 'keydown rightparenth' 'keyup parenth' 'keydown rightparenth' 'keyup parenth' 'keydown rightparenth' 'keyup parenth' |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
#!/bin/sh at the top, chmod a+x <file> and then run it when I needed to. I'm sure there's an easy way to invoke a shell script from an icon, maybe somebody here can help? Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
I asked because it needs to run inside Xterminal or Roxterm, yes?
Also I would like to raise the default volume level but a simple copy and paste from what I posted in Xterm doesn't work either. I'm just a little confused on how to do this, that's all. Oh, and Xmodmap is for some hardware key shortcuts in case you were wondering. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
2 Attachment(s)
My first ever script that I did on my own without any help. :)
So I've got 1 minute email notifications and a running SIP phone. Since it takes me some time to fall asleep, I'll just run this script before I close my eyes. If there are no new messages right away (default 15 minutes) it turns off the master and ringtone volume. The other script brings back both sounds and stops the first one from fully executing if needed. Goodnight #! /bin/sh dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Quiet mode in 15 minutes" sleep 900 dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Goodnight...." gconftool-2 -s "/apps/osso/sound/ringtone_volume" 0 -t INT gconftool-2 -s "/apps/osso/sound/master_volume" 0 -t INT Wakeup #! /bin/sh killall kill goodnight dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Quiet mode terminated" gconftool-2 -s "/apps/osso/sound/ringtone_volume" 100 -t INT gconftool-2 -s "/apps/osso/sound/master_volume" 100 -t INT |
Re: Your Favorite Apps/Mods NOT In Repositories
Does anyone know if there is already an app like this? ^
If so, I would like to try it out. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Hey Andy, quick question for you.
In Xterm or any other terminal, do you know if there is a way to gag certain text output such as "|> " and "(i) Receiving new playlist... Ok."? I know such a thing exists using Tinyfugue. After I'm done listening on pybar, I tend to copy everything it played during that time and would like to remove some of that extra clutter when saving those list of songs. Cheers. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
which match <pattern>. So: command | grep -v "|>" > output.txt would filter off lines with "|>" (as output by "command") and the result goes into output.txt file. Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
So I enter that command before starting pybar?
|
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
If it doesn't, then probably it would be better to modify pianobar to do the initial setup itself. Yes, that means modifying the app, but this sounds like a reasonable enhancement (setting initial volume). FWIW, it might be easier to grep -v the cruft after you grab the song list. Then it won't interfere with the app's TTY access, and you don't have to hack C code either. :-> Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Okay, I'll give it a try. Thanks!
Oh, and what if I want to gag multiple outputs such as llib pianobar | grep -v "|>" "(i) Receiving new playlist... Ok."? I don't know how to add a second filter to that grep command, and yes, I looked online for about 30 minutes on this already and couldn't find it. |
Re: Your Favorite Apps/Mods NOT In Repositories
This almost worked. :)
llib pianobar | grep -v "|>" Instead of gagging just those two character symbols, it mutes out the entire line all together. Is there a better way to use that grep command? |
Re: Your Favorite Apps/Mods NOT In Repositories
Okay. At least this a good start. :)
llib pianobar | grep -v "(i) Receiving new playlist... Ok." Now it only shows the songs that have played making the output in Xterm a little less messy. All I would like is to also get rid of all the "|> " and """ characters as well if this is possible. Thanks Andy. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
command | sed 's/|>//' > outfile.txt Would remove the first "|>" sequence it found in each line. If you want to remove *all* such, it's 's/|>//g' (g suffix to sed substitute command). sed can also remove whole lines: command | sed '/foobar/d' Matches line with "foobar" within them and deletes them. I point this out because sed can run with a whole list of rules (provided by a file) and thus can probably do all your folding, spindling, and mutilating with a single "sed" command. If the file cleanup.sed had the two lines: /Receiving/d s/|>//g Then running it with: command | sed -f cleanup.sed > output.txt Would both trim off lines with "Receiving" as well as remove the character sequence |> (without otherwise changing the line). Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
I'm confused. :)
This seems to kind of work.... PATH=$PATH:/usr/local/bin llib pianobar | sed 's/|> //' That's 2 spaces after /> and not just 1. The thing is it won't display the song now until after it has finished playing. No big deal I guess. Anyway, can you help me pipe all of these exceptions together? llib pianobar | sed 's/|> //' | sed 's/ "//' | grep -v "(i) Receiving new playlist... Ok." | grep -v "Station" If I try and do more than one filter, Xterm just hangs without doing anything. I'm not sure what I'm doing wrong on this. Cheers. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Dang it I'm super dumb. :(
llib pianobar | sed -u 's/|> //' sed: invalid option -- u llib pianobar | sed 'u/|> //' sed: unsupported command u llib pianobar | sed '/|> //u' sed: unsupported command / How do you use the -u option? |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
www.vsta.org/andy/pickup/n810_sed Probably you shouldn't scribble on top of the Busybox one, just put this one in /usr/local/bin/sed (or /usr/local/bin/gsed to be really defensive) and it definitely has the -u option. Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Thanks!
Okay, once last thing, how do I string these all together? llib pianobar -u | sed 's/|> //' | sed -u 's/ "//' | grep -v "(i) Receiving new playlist... Ok." | grep -v "Station" Am I using the pipe command correctly? |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
s/|> // s/"//g /Receiving new playlist/d /Station/d In one file, say "filter.sed". Then run pianobar as: llib pianobar | sed -u -f filter.sed I don't think pianobar looks at its command line arguments, so I left off that -u you had put for pianobar. Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Thanks Andy!
I'll give this a try is just a few minutes. Oh, and the reason why I wanted to weed out all of the extra junk is so that I can simply copy and paste any good song from Xterm and then head on over to this site to download it. http://mp3juices.com/ |
Re: Your Favorite Apps/Mods NOT In Repositories
I didn't get anywhere new with your advice Andy.
Sorry. :( What am I doing wrong here? http://imageshack.us/a/img23/5319/sc...3022119461.png llib pianobar | sed -u -f filter.sed sed: invalid option -- u BusyBox v1.6.1 (2010-08-15 19:12:28 BST) multi-call binary Usage: sed [-efinr] pattern [files...] |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
Quote:
_________________ Per aspera ad astra... |
Re: Your Favorite Apps/Mods NOT In Repositories
I downloaded n810_sed, renamed the file sed, placed it in /usr/local/bin/ and made it executable like Andy suggested.
Did I somehow misread his post? |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
Try llib pianobar | /usr/local/bin/sed -u -f filter.sed Best wishes. _________________ Per aspera ad astra... |
Re: Your Favorite Apps/Mods NOT In Repositories
Joy!
This now works perfect! llib pianobar | /usr/local/bin/sed -u -f /usr/local/bin/filter.sed Thank you Wiki! :) |
All times are GMT. The time now is 19:20. |
vBulletin® Version 3.8.8