Git Product home page Git Product logo

wineshortcut's Introduction

wineshortcut

A simple Python script aimed at creating shortcuts to Windows executable files to be opened in Wine.

usage: wineshortcut [-h] [-o OUTPUT_FOLDER] [-n NAME] [-i ICON]
                    [-c CATEGORIES] [-w WINE_PREFIX] [-d] [-a] [-s] [-p]
                    input_file

positional arguments:
  input_file            Windows executable file

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_FOLDER, --output OUTPUT_FOLDER
                        write shortcut to output directory
  -n NAME, --name NAME  set custom shortcut name
  -i ICON, --icon ICON  set custom shortcut icon
  -c CATEGORIES, --categories CATEGORIES
                        set custom shortcut categories
  -w WINE_PREFIX, --wine-prefix WINE_PREFIX
                        set custom Wine prefix
  -d, --to-desktop      write shortcut to desktop folder
  -a, --to-appmenu      write shortcut to application menu
  -s, --skip-icon       disable executable icon extraction
  -p, --print-output    disable shortcut creation, just print output

Requirements

Optionally requires wrestool to try and extract the executable icon.

The program comes with the package icoutils and can be installed with:

  • On Ubuntu/Debian: apt install icoutils
  • On Arch/Antergos/Manjaro: pacman -S icoutils
  • On Fedora/CentOS: yum install icoutils
  • On Mageia/Mandriva: urpmi icoutils
  • On SUSE: zypper install icoutils
  • On Gentoo: emerge icoutils

Examples

Write shortcut to current working directory:

wineshortcut.py file.exe

Write shortcut to desktop and application menu:

wineshortcut.py file.exe -d -a

Write shortcut to a specific directory:

wineshortcut.py file.exe -o /path/to/folder

Write shortcut with a system/user icon:

wineshortcut.py file.exe -i icon_name

Write shortcuts with an existing icon file:

wineshortcut.py file.exe -da -i /path/to/icon_file.png

Just print contents and do not extract icon:

wineshortcut.py file.exe -p -s

Write shortcut with custom wine prefix:

wineshortcut.py -w $HOME/.wine

or with the quotation marks if necessary:

wineshortcut.py -w "$HOME/.wine"

Configuration file

With a configuration file named wineshortcut.json, one can easily create shortcuts with predefined preferences, without typing or copying the full arguments again and again. It includes all command line switches described above. They are renamed with the following rules:

  • The prefix -- is removed
  • All - are replaced by _

For example, switch to-desktop is named to_desktop in the configuration file.

An example

With an example configuration file wineshortcut.json:

{
        "wine_prefix": "$HOME/.wine",
        "to_desktop": true,
        "to_appmenu": true
}

The command ./wineshortcut.py ~/example.exe is equivalent to ./wineshortcut.py ~/example.exe -d -w "$HOME/.wine".

wineshortcut's People

Contributors

keuin avatar sarthak96 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.