You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Name: Karabiner Elements Profile Switcher// Acknowledgements:// - https://www.alfredforum.com/topic/9927-karabiner-elements-profile-switcher/// Notes:// - Probably could also work with cli https://github.com/raycast/extensions/blob/be03024b4c4f4f1ad0af7f4d20ea4630d7f0ee20/extensions/karabiner-profile-switcher/src/model/KarabinerManager.tsimport"@johnlindquist/kit"importfsfrom'fs'constCONFIG_PATH=home('.config/karabiner/karabiner.json')constconfigJson=JSON.parse(fs.readFileSync(CONFIG_PATH,'utf8'))constprofileChoices=configJson.profiles.map((profile: any)=>({name: profile.name,value: profile.name,tag: profile.selected ? '🟢' : '',// Note: Not sure if there's a better way to highlight currenly active}))constselectedProfile=awaitarg({placeholder: 'Select a profile',choices: profileChoices,})for(constprofileofconfigJson.profiles){profile.selected=profile.name===selectedProfile// intentional mutation}fs.writeFileSync(CONFIG_PATH,JSON.stringify(configJson,null,2))notify(`Karabiner Elements profile switched to "${selectedProfile}"`)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Open karabiner-elements-profile-switcher in Script Kit
Beta Was this translation helpful? Give feedback.
All reactions