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) |
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 | |
# | |
# add this, for example, /home/marcin/bin/startgimp.py | |
# to IfranViews Miscellaneus Properties/Settings | |
# | |
import os | |
import sys | |
gimp_cmd = '/usr/bin/gimp-2.8 ' | |
if len(sys.argv) == 2: | |
img_file = sys.argv[1] | |
img_file = img_file.replace('\\', '/') | |
img_file = img_file.replace('Z:', '') | |
gimp_cmd += '"'+img_file+'"' | |
#with open('/home/marcin/Desktop/test.txt', 'w') as f: | |
# f.write(img_file) | |
#print(gimp_cmd ) | |
os.system(gimp_cmd ) |