그냥 데스크톱 공지 명령을 만들면...
                                            
                                                
                                                
                                                
                                                
                                                
                                                 7374 단어  GoWindowsNotification
                    
어느 날 PS> yarn build
yarn run v1.3.2
$ yarn install
[1/4] Resolving packages...
success Already up-to-date.
$ webpack --config webpack.config.js
...
...
...
...
(인스타그램 좀 업데이트해 주세요.)
브라우저로 이동합니다.
...
[20분 후]
... 아, 짓는 것을 잊어버렸어요.
많아서 끝나고 알려드리고 싶어요.
그나저나 나는 인스타그램을 해 본 적이 없다.
데스크톱 알림 
알아봤는데 있을 줄은 몰랐어요.
PS> yarn build
yarn run v1.3.2
$ yarn install
[1/4] Resolving packages...
success Already up-to-date.
$ webpack --config webpack.config.js
...
알아봤는데 있을 줄은 몰랐어요.
하지만 플랫폼을 뛰어넘는 단일 바이트 녀석을 원합니다.
Hi 
그래서 Hi라는 명령을 내렸어요.
kentork/hi 
크로스 플랫폼이라고 하지만 Circle Ci 구축에서 인기가 많기 때문에 수동으로 향상된 Windows 2진법만 있습니다.
개발
 
그래서나 이거 썼어..표준적인 알림을 사용할 수 있어서 보냈습니다.
실제로 만든 물건은 이것을 얇게 포장했을 뿐이다.
main.go
package main
import (
    "os"
    "runtime"
    "github.com/martinlindhe/notify"
    "github.com/urfave/cli"
)
func main() {
    app := cli.NewApp()
    app.Action = func(c *cli.Context) error {
        appname := "hi"
        if runtime.GOOS == "windows" {
            // 理由は後述
            appname = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe"
        }
        title := "hi"
        contents := "there"
        if len(c.Args()) >= 2 {
            title = c.Args().Get(0)
            contents = c.Args().Get(1)
        } else if len(c.Args()) >= 1 {
            title = "hi there"
            contents = c.Args().Get(0)
        }
        notify.Notify(appname, title, contents, "dorobou_jikan.png")
        return nil
    }
    app.Name = "hi"
    app.Version = "0.1.0"
    app.Usage = "desktop notifier"
    app.Run(os.Args)
}
hi [title] [contents]
go build; hi go complete
 
 나왔습니다.
어?뭐가 이상해..
Fall Creators Update
몇 달 전 Windows에 적용된 Fall Creators Update에서 Notification API가 크게 변경된 것 같습니다.
No Notification is shown
Notification API do not work with Windows 10 16299.19 (fall creators update)
Fall Creators 업데이트 적용 후 토스트 알림 불가
AppID에 맡겨야 하기 때문에 이에 대응하지만 제목과 내용이 잘 바뀌지 않았습니다.
다시 만져봐, 방법이 없으면 직접 설치해.
더 하고 싶은 일
docker run -d postgres 같은 말은 명령은 끝났지만 내부에서 데이터 복구를 하고 접근할 수 없음webpack --watch 파일 업데이트 시간 모니터링 등 알림 구축 완료Reference
이 문제에 관하여(그냥 데스크톱 공지 명령을 만들면...), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kikuchi_kentaro/items/c4a94e3ae28680e75820텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)