Users browsing this thread: 1 Guest(s)
neeasade
Grey Hair Nixers
tangently-related: Sometimes in my dotfiles I will wrap a program with some opinionated behavior (EG dmenu, or mpv). When that happens, I need a way to call the original program/fix the name collision. Enter the script `og`:

Code:
#!/bin/sh
# call the original version of some thing in $PATH
og=$1
shift
"$(type -a "$og" | tail -n 1 | sed -E "s/${og}//;s/ is //;")" "$@"

Then, in my 'wrapped' ~/bin/mpv, I can do something like:

Code:
og mpv \
   --write-filename-in-watch-later-config \
   --save-position-on-quit \
   "$@"


Messages In This Thread
Where is what - by venam - 05-06-2017, 11:19 AM
RE: Where is what - by evbo - 05-06-2017, 12:20 PM
RE: Where is what - by xero - 05-06-2017, 12:58 PM
RE: Where is what - by alxndr - 05-06-2017, 03:13 PM
RE: Where is what - by yossarian - 05-06-2017, 10:02 PM
RE: Where is what - by venam - 06-06-2017, 01:13 PM
RE: Where is what - by jkl - 06-06-2017, 01:17 PM
RE: Where is what - by venam - 06-06-2017, 01:26 PM
RE: Where is what - by venam - 23-11-2021, 01:45 PM
RE: Where is what - by neeasade - 29-11-2021, 02:03 PM
RE: Where is what - by z3bra - 29-11-2021, 07:50 PM
RE: Where is what - by neeasade - 30-11-2021, 02:26 AM