This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a script for .gitconfig and .ssh/config to manage and switch between user accounts. If first argument to ctx is left empty it is considered default otherwise we append to github.com-* | |
| ``` | |
| [alias] | |
| ctx = "!f() { LABEL=$1; EMAIL=$2; NAME=$3; CURRENT=$(git remote get-url origin); FROM=$(echo \"$CURRENT\" | grep -oE 'git@github\\.com(-[^:]*)?'); if [ -z \"$LABEL\" ]; then TO=\"git@github.com\"; elif echo \"$FROM\" | grep -q -- \"-$LABEL\"; then TO=\"git@github.com\"; else TO=\"git@github.com-$LABEL\"; fi; NEW=$(echo \"$CURRENT\" | sed \"s|$FROM|$TO|\"); git remote set-url origin \"$NEW\"; git config user.email \"$EMAIL\" && git config user.name \"$NAME\" && echo \"* Switched to ${LABEL:-default}: $EMAIL\"; }; f" | |
| whoami = "!echo \"Current email: $(git config user.email)\" && git remote -v | head -n1" | |
| private = "!git ctx private '<private email>' '<private name>'" | |
| default = "!git ctx '' '<work email>' '<work name>'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Tradfri E2001/E2002 light Switch | |
| description: > | |
| Control light or group of lights with switch. | |
| Based on https://gist.github.com/FloppyGit/efaa93c1d63676e30c4b61adb4a861ac | |
| domain: automation | |
| input: | |
| source_switch_action: | |
| name: Tradfri E2001/E2002 Switch | |
| description: Switch triggers action. |