LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

Prototype/principle for a wrapper script for multiple media players to use the same Openbox keybindings, depending on which one is running

Posted 03-25-2021 at 10:50 AM by the dsc (linux-related notes)
Tags mpc, mpv, openbox

Most likely not the most elegant way of doing it, and not fully functional (for mpv) regarding the display of media info:


Code:
#!/bin/bash

if pgrep -x mpv ; then

echo '{"command": ["playlist-next"]}' > /tmp/mpvsocket

#title=$(echo '{ "command": ["get_property", "media-title"] }'  >  /tmp/mpvsocket)

#title=( $(wmctrl -l | grep mpv$ ) ) 

#title=$(echo
...
Member
Posted in Uncategorized
Views 703 Comments 0 the dsc is offline
Old

Silly volume control scripts for openbox that probably won't work for everyone

Posted 03-20-2016 at 10:03 PM by the dsc (linux-related notes)
Updated 03-20-2016 at 10:22 PM by the dsc

Code:
#!/bin/bash

# volume changer+notifier, using notify-send, and tested only with xfce4-notifyd
# the syntax is the same of the "end" of what you'd use in plain amixer, see "$1"
# Ex.: 5%-, 5%+, 30, 60%

com=(`amixer set "Master" $1`)

vol1=${com[20]} 

# and here's why it won't work for everybody. The output of amixer includes
# things like soundcard features, which are array elements I'm just
...
Member
Posted in Uncategorized
Views 740 Comments 0 the dsc is offline
Old

Timeline / "slider" for Openbox' MPC pipe menu (obmpc.sh)

Posted 08-17-2015 at 07:27 PM by the dsc (linux-related notes)
Updated 03-18-2016 at 12:20 PM by the dsc

My most recent customization/tweak to a script that isn't really mine:

https://github.com/leomeloxp/dotfile...enbox/obmpc.sh

Change the denominator of "slice1" and the put the same number in the loop in order to have more or less time slices. It seems there may be something somewhat wrong with the maths, but seems to work nevertheless.

Code:
  echo "  <separator />"
    dur=$(mpc -f %time% | head -n 1)
...
Member
Posted in Uncategorized
Views 954 Comments 0 the dsc is offline
Old

Passing some mplayer options to smplayer from a script

Posted 12-18-2014 at 12:56 PM by the dsc (linux-related notes)
Updated 12-28-2014 at 06:22 PM by the dsc (fixing the method)

PS/edit.: renamed the title as it's really something that makes more sense from within scripts, not from the command line itself. Unless perhaps one makes a wrapper script that edits smplayer.ini with whatever parameters are set by command line and resets afterwards, while still somehow preserving smplayer's own syntax, if that's even possible.


Major edit:

Apparently the best way to go is to dinamically edit or switch/rename the smplayer.ini file, in the following...
Member
Posted in Uncategorized
Views 3578 Comments 0 the dsc is offline
Old

Random song constrained by keyword on MPC

Posted 08-12-2010 at 12:17 AM by the dsc (linux-related notes)
Updated 08-12-2010 at 12:21 AM by the dsc
Tags mpc, music

Save it as a script, perhaps even as an alias:

Code:
mpc play `shuf -e $(mpc playlist -f "[(%position%) %artist% %title% %file%]" |egrep $1 | grep -Eo "\(.*\)"| sed 's:).*::g' | sed 's:(::g') -n 1`
Then type at some terminal:

mpcr[andom] <artist/keyword>

(or however you chose to name/alias it)

And mpc will play a random song from the pool resulting from the keyword filter.

I guess the whole...
Member
Posted in Uncategorized
Views 1983 Comments 1 the dsc is offline

  



All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration