Explore the source / dotfiles

Inside dotfiles.

Shell, terminal, backup, and the configuration that joins them. Browse the current public files here, or visit the dotfiles repository on GitHub.

dotfiles / main

home/.config/karabiner/assets/complex_modifications/scripts/is_screen_locked.sh

View on GitHub
#!/bin/bash
if python3 -c 'import sys,Quartz; d=Quartz.CGSessionCopyCurrentDictionary(); print(d)' | grep "CGSSessionScreenIsLocked = 1" > /dev/null; then
    exit 0
else
    exit 1
fi

#"shell_command": "if /Users/kevinmuka/.config/karabiner/assets/complex_modifications/is_screen_locked.sh; then exit 0; else sleep 0.2 && pmset sleepnow; fi"