Skip to content

Instantly share code, notes, and snippets.

Last active July 26, 2021 13:16
Show Gist options
  • Save chrisgrande/d3be9102e805acb8380a8b40c7c8421d to your computer and use it in GitHub Desktop.
Save chrisgrande/d3be9102e805acb8380a8b40c7c8421d to your computer and use it in GitHub Desktop.
import os
from docklib import Dock
from AppKit import NSBundle, NSRunningApplication
from pathlib import Path
import sys
import time
import pwd
uname = sys.argv[3]
uid = pwd.getpwnam(uname)[2]
# app to check if running
app_name = 'Dock'
app_bundle_id = ''
# check if Dock is running - if not - wait
while not NSRunningApplication.runningApplicationsWithBundleIdentifier_(app_bundle_id):
print('Waiting for %s!' % app_name)
home_folder = Path.home()
dock_version = "edu.mxcc.dock.version.1.6"
touch_path = f"{home_folder}/Library/Preferences/{dock_version}"
dock_tickle = f"{home_folder}/Library/Preferences/edu.mxcc.dock.tickle"
if Path(touch_path).exists() and not Path(dock_tickle).exists():
if Path(dock_tickle).exists():
lab_dock = [
"/Applications/Adobe Photoshop 2020/Adobe Photoshop",
"/Applications/Adobe Photoshop 2021/Adobe Photoshop",
"/Applications/Adobe Illustrator 2020/Adobe",
"/Applications/Adobe Illustrator 2021/Adobe",
"/Applications/Adobe InDesign 2020/Adobe InDesign",
"/Applications/Adobe InDesign 2021/Adobe InDesign",
"/Applications/Adobe Premiere Pro 2020/Adobe Premiere Pro",
"/Applications/Adobe Premiere Pro 2021/Adobe Premiere Pro",
"/Applications/Adobe After Effects 2020/Adobe After Effects",
"/Applications/Adobe After Effects 2021/Adobe After Effects",
"/Applications/Adobe Audition 2020/Adobe Audition",
"/Applications/Adobe Audition 2021/Adobe Audition",
"/Applications/Adobe Animate 2020/Adobe Animate",
"/Applications/Adobe Animate 2021/Adobe Animate",
"/Applications/Adobe Dreamweaver 2020/Adobe Dreamweaver",
"/Applications/Adobe Dreamweaver 2021/Adobe Dreamweaver",
dock = Dock()
dock.items["persistent-apps"] = [
dock.makeDockAppEntry(item) for item in lab_dock if os.path.exists(item)
dock.items['persistent-others'] = [
dock.makeDockOtherEntry(os.path.expanduser("~/Downloads"), arrangement=2, displayas=0, showas=1)
dock.show_recents = False
dock.tilesize = 48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment