Skip to content

Instantly share code, notes, and snippets.

@ShayBox
Last active December 25, 2023 19:06
Show Gist options
  • Save ShayBox/177fee12bc424dfe79507cb4c827bc7d to your computer and use it in GitHub Desktop.
Save ShayBox/177fee12bc424dfe79507cb4c827bc7d to your computer and use it in GitHub Desktop.
1Password Automatic Login for Windows and Linux

Windows - Hacky AHK Script

#SingleInstance Force
#NoEnv
#Warn
SendMode Input
EnvGet, A_LocalAppData, LocalAppData
Run, %A_LocalAppData%\1Password\app\8\1Password.exe
WinWait, 1Password
Send PASSWORD{Enter}
ExitApp
#Requires AutoHotkey v2.0-beta
#SingleInstance Force
#Warn

LocalAppData := EnvGet("LocalAppData")
Run(LocalAppData . "\1Password\app\8\1Password.exe")
WinWait("1Password")
Send("PASSWORD{Enter}")
ExitApp

Instructions:

  • Install AHK (Current version)
  • Create .ahk file with above code block
  • Change PASSWORD to your password
  • Place file in %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

Alternatives

Other solutions are to use something like NutJS with image matching, or even install BitWarden with auto-fill just for 1Password.

Anything below this line NO LONGER WORKS, Read Aftermath

ArchLinux (and maybe others)

AUR package available here

/* Allow users in wheel group to run 1Password without authentication */
polkit.addRule(function(action, subject) {
if (action.id == "com.1password.1Password.unlock" &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});

Manual Instructions:

  • Create file /etc/polkit-1/rules.d/00-1password.rules with above code block
  • Make sure you're in the wheel group, or change wheel to the sudoers group
  • Enable System authentication service in Security settings

Browsers

If you install an extension that keeps the browser open in the background (Such as Twitch Now) it will also keep 1Password signed in until you reboot, this is the best solution I have found.


Aftermath

Since creating this package (last night), 1Password has updated their program to block using Polkit on first login after restart, I tested this and used it extensively yesterday, but today the message under the System authentication checkbox has changed to You'll still need to enter your account password after you restart., which actually means every time you open the program.

The arrogance of the 1Password team leaves a bad impression and I will not be continuing to use it, they go out of their way to stop this despite it being my computer, my choice to be less secure (even though I use full disk encryption), and my money.

EDIT: I found a better mod that I won't be sharing, if you'd like it you can find me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment