Last active
August 29, 2015 14:26
-
-
Save marcinwol/fc77faeb1550192ce6d7 to your computer and use it in GitHub Desktop.
Start IrfanView in Linux with input file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Put the file, for example in: /home/marcin/bin/startirfan.py | |
# and mark it as executable: chmod +x /home/marcin/bin/startirfan.py | |
# | |
# Make IrfanViewMine.desktop in /home/marcin/.local/share/applications that contains: | |
# | |
# [Desktop Entry] | |
# Encoding=UTF-8 | |
# Name=MineIrfanView348 | |
# Comment=IrfanView 3.48 | |
# Exec=/home/marcin/bin/startirfan.py %u | |
# Terminal=false | |
# Type=Application | |
# Icon=B68D_i_view32.0 | |
# Categories=Application;Utility;ImageEditor; | |
# StartupNotify=true | |
# MimeType=text/plain; | |
# NoDisplay=true | |
import getpass | |
import os | |
import sys | |
current_user = getpass.getuser(); | |
wine_prefix = 'env WINEPREFIX="/home/{}/.wine" '.format(current_user) | |
wine_cmd = wine_prefix + 'wine "C:\Program Files\IrfanView\i_view32.exe" ' | |
if len(sys.argv) == 2: | |
img_file = sys.argv[1] | |
img_file = "Z:\\" + img_file.replace('/', '\\') | |
wine_cmd += '"'+img_file+'"' | |
print(wine_cmd) | |
os.system(wine_cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment