Comments (8)
But can you change
cmd := exec.Command(shell, "-l", "-i", "-c", "which "+a)
to
cmd := exec.Command(shell, "-l", "-i", "-c",a)
would directly spawn the alias process.
from noti.
Could you post more information about this? I wasn't able to reproduce this.
I set this in my ~/.zshrc
.
alias n="noti"
Then I ran source ~/.zshrc
.
I was able to run n -V alex
successfully.
from noti.
I am not talking about set "noti" as an alias. For example, in osx:
alias speak_hello=' say "hello"'
noti speak_hello give an error. No detailed information, but the command in alias does not run.
Try that.
from noti.
Ah, yes.
In v2, you now see more information.
Currently, noti
assumes utility
is an executable in your $PATH
. It didn't evaluate your alias. Interestingly, the time
command does evaluate aliases, so, yes: this is a bug.
from noti.
Wait. I just realized time
isn't /usr/bin/time
in my shell. Running /usr/bin/time speak_hello
also results in the same behavior as noti
. I'm guessing the reason it worked before was because Zsh knew how to expand the alias when it ran its version of time
.
Getting this behavior right seems trickyβand doing it in a way that works across different shells seems even more difficult.
Technically, you can get this to work in bash, version 3.2.57, like this.
shopt -s expand_aliases
alias speak_hello='say "hola"'
noti $(speak_hello)
I'd recommend to avoid doing this though. It seems like most apps can't handle expanding alias arguments.
from noti.
Hi, @vyasgiridhar, @chmaynard, and @simioes.
I think I might have finally found a solution to this, that's not too crazy. (No regexp.)
cd github.com/variadico/noti/cmd/noti
git fetch --all
git checkout expand-alias
go install
Then try running noti
on some shell alias.
noti speak_hello
Can anyone else verify this works? I tried this on macOS Sierra with ZSH. It would be awesome if someone could test on other platforms and shells. βοΈ
Thanks!!
from noti.
It works on bash in Arch linux. π
from noti.
Merged the alias change to dev, 1598292.
@vyasgiridhar, I liked your change, but I kept it the way I had it because executing the alias in the subshell caused arguments passed to aliases to be escaped.
$ which findhere
findhere: aliased to find . -iname
$ noti findhere '*.go' # <- Expanding
$ noti findhere '\*.go' # <- Executing directly
Maybe we can optimize this later.
from noti.
Related Issues (20)
- Pushbullet has stopped working HOT 2
- Support Twilio SMS notification HOT 1
- how to send message to a user defined url HOT 5
- Automatically notify on all iTerm2 commands
- A detailed documentation to setup noti with the push notification providers on windows HOT 3
- Adding gotify as a push service HOT 1
- Windows Defender false positive? HOT 1
- github.com/variadico/vbs is no longer provided HOT 2
- Noti is not producing a notification on Mac os HOT 1
- Mute sound for specific notifications
- Unable to add exemption for noti when "focus" enabled. HOT 2
- Cant login
- On windows tail-format doesn't work
- Add support for ntfy HOT 1
- request feature
- RFE: Add support for telegram topics
- Add Teams as notification service
- 'NSUserNotification' is deprecated: first deprecated in macOS 11.0
- Add Discord as notification service HOT 2
- "Default" voice ("Alex") doesn't seem to exist anymore on macOS 14.2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noti.