Generate shortcuts to executables and/or folders
- What does ezshortcut do?
- Features & Roadmap
- Why should I use ezshortcut?
- Quick-start
- Additional Documentation
Ez shortcut is a simple API with one primary function that lets you setup shortcuts to executables, or to folders.
The primary features include:
- Cross platform shortcut generation
- Creting folder shortcuts
- Creating executable shortcuts
The full roadmap can be found here.
Ez shortcut is definately the simplest way to setup shortcuts to generic binaries, and/or folder links in python. If however you are looking to make a shortcut to a python script, then checkout pyshortcuts.
- Clone this repo: https://github.com/Descent098/ezshortcut
- Run
pip install .
orsudo pip3 install .
in the root directory
- Run
pip install ezshortcut
Creating a folder shortcut to the Documets folder on the desktop with the minimum necessary fields
import os
from ezshortcut import create_shortcut
# Get the documents folder dependent on OS
DOCUMENTS_FOLDER = f"{os.getenv('USERPROFILE')}\\Documents" if os.name == 'nt' else f"{os.getenv('HOME')}/Documents"
create_shortcut("Documents", DOCUMENTS_FOLDER) # Create shortcut on desktop called Documents
Creating an executable shortcut to blender 2.82 on windows with minimum necessary fields
import os
from ezshortcut import create_shortcut
# The directory you want to open the executable from
WORKING_DIR = f"{os.getenv('USERPROFILE')}\\Documents"
# Get the blender path dependent on windows
BLENDER_PATH = f"{os.getenv('ProgramFiles')}\\Blender Foundation\\Blender 2.82\\blender.exe"
create_shortcut("Blender", WORKING_DIR, executable=BLENDER_PATH) # Create shortcut on desktop called Blender
Creating an executable shortcut on the desktop with all fields possible
import os
from ezshortcut import create_shortcut
# The directory you want to open the executable from
WORKING_DIR = f"{os.getenv('USERPROFILE')}\\Documents"
# Get the blender path dependent on windows
BLENDER_PATH = f"{os.getenv('ProgramFiles')}\\Blender Foundation\\Blender 2.82\\blender.exe"
# The folder to put the shortcut in
SHORTCUT_PATH = f"{os.getenv('USERPROFILE')}\\Desktop"
# The path to a custom icon file (.ico on win/linux, .icns on MacOS)
ICON_PATH = "path\\to\\icon.ico"
create_shortcut("Blender", WORKING_DIR, SHORTCUT_PATH, BLENDER_PATH, ICON_PATH) # Create shortcut on desktop called Documents
Full API docs can be found at https://kieranwood.ca/ezshortcut