LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass Variable To URL
#5
(11-20-2015, 09:31 PM)misko_2083 link Wrote: Shell can't see %t as a variable
Variables are marked with $t or ${t}
Code:
t="elephant"
/usr/bin/google-chrome-stable %U https://en.wikipedia.org/wiki/$t

This will do:
Code:
/usr/bin/google-chrome-stable %U https://en.wikipedia.g/wiki/"$(mocp --format %title)"
"$(mocp --format %title)" - quotes are here because the title can contain spaces and you need a whole title to be a string
here a command (mocp --format %title) output is used
edit
Oh, you want to search wikipedia. Smile
Next will open a browser and run a wiki search query
Code:
/usr/bin/google-chrome-stable %U https://en.wikipedia.g/wiki/?search="$(mocp --format %title)"

Special search:
Code:
/usr/bin/google-chrome-stable %U http://en.wikipedia.o/wiki/Special:Search?search="$(mocp --format %title)"

Right now I'm lifting my beer can toward the screen. Cheers! Big Grin


Just had to edit %title out of your code because apparently the docs are wrong and this in fact returns artist - title - album. Using %t with your code did the job beautifully though.
Don't believe half of what you see and none of what you hear

- Lou Reed
Reply


Messages In This Thread
Pass Variable To URL - by Duckeenie - 11-20-2015, 07:23 PM
Re: Pass Variable To URL - by firenice03 - 11-20-2015, 08:37 PM
Re: Pass Variable To URL - by Duckeenie - 11-20-2015, 08:49 PM
Re: Pass Variable To URL - by misko_2083 - 11-20-2015, 09:31 PM
Re: Pass Variable To URL - by Duckeenie - 11-20-2015, 10:16 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)