Last active
July 16, 2019 13:18
-
-
Save obi12341/23da49075b49cf93664c235224143a5d to your computer and use it in GitHub Desktop.
yubikey activate lockscreen on remove and restart pcscd on add
This file contains 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
[Unit] | |
Description=User suspend actions | |
[Service] | |
Type=simple | |
Environment=DISPLAY=:0 | |
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus | |
ExecStart=/usr/bin/betterlockscreen -l dim | |
[Install] | |
WantedBy=multi-user.target |
This file contains 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
# Udev rules for letting the console user access the Yubikey USB | |
# device node, needed for challenge/response to work correctly. | |
ACTION=="add", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="1050", ENV{PROP}=="0", RUN+="/usr/local/bin/yubi_on.sh" | |
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="1050", ENV{PROP}=="0", RUN+="/usr/local/bin/yubi_off.sh" |
This file contains 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
#!/usr/bin/env bash | |
export USER_ID=1000 | |
export USER_NAME=patrick | |
export XAUTHORITY="/home/$USER_NAME/.Xauthority" | |
export DISPLAY=:0 | |
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$USER_ID/bus" | |
/usr/bin/sudo -u $USER_NAME -E /usr/bin/systemctl --no-block --user start i3lock.service | |
/usr/bin/sudo -u $USER_NAME -E /usr/bin/notify-send 'Yubikey off' |
This file contains 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
#!/usr/bin/env bash | |
export USER_ID=1000 | |
export USER_NAME=patrick | |
export XAUTHORITY="/home/$USER_NAME/.Xauthority" | |
export DISPLAY=:0 | |
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$USER_ID/bus" | |
/usr/bin/systemctl --no-block restart pcscd.service | |
/usr/bin/sudo -u $USER_NAME -E /usr/bin/notify-send 'Yubikey on' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment