(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 27 Nov 2020, 13:31
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Wine, extract icon and set it for Rox Filer in XenialPup 7.5
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
fabrice_035


Joined: 28 Apr 2014
Posts: 768
Location: Bretagne / France

PostPosted: Sun 26 Jan 2020, 12:20    Post subject:  Wine, extract icon and set it for Rox Filer in XenialPup 7.5
Subject description: Beautification
 

EDIT [ 26 / 01 / 2020] V1.1 Modify code because I found a bug in the handling of folder names with spaces. Solved.

Hi,

I use programs with Wine, but icons are never visible and you often have to do a lot of manipulations to get an icon that matches the program and if you make a shortcut on the desktop by default it's not very nice

An example :



I couldn't come up with a ready-made solution to solve this problem so I made a program
Just drag the Windows icon on this program or do an "open with" by choosing executable to do the work.

Look :


And rather quickly here is the result on the desktop :



But in order for this to be possible it is necessary to install icoutils from the Puppy Packet Manager!

...And to be most effective :
1) Open folder /usr/local/apps
2) Create empty dir, rename as SetWindowsIcon
3) Enter into this new folder
4) create file named AppRun
5) edit this file (use a file editor such as Geany)
6) copy paste this simple and unpretentious little program :

Code:

#!/bin/sh
# set icon, extract and attribute icon to Rox Filer
# need icoutils tools
#
# 26 JAN 2020, version 1.1
# --> update, found bug with folder name with space... add double quote in arg string
# ckeck command exist
cmd=$(command -v  wrestool)

if [ "$cmd" = "" ] ; then
xmessage "For working, you need install icoutils_ from Puppy Package Manager!"
exit
fi
#

# get argument
PASSED="$1"

if [ "$PASSED" = "" ] ; then
xmessage "Please, drag and drop Windows executable to set new icon."
exit
fi

BASEDIR=$(dirname "$0")
tmp=$(date +"%d_%m_%y.%H%M%S")
# extract filename and basedir
path=$(dirname "$1")
name=$(basename "$1")


# defaut Rox-Filer globicons file
source="/root/.config/rox.sourceforge.net/ROX-Filer/globicons"


# extract icon and write icon file
filetest="$path/$name.ico"
# check already exist
if [ -f  "$filetest" ] ; then
xmessage -c "Icon already exist! Continue ?" -buttons yes,no -default no
ANSWER=$?
else
ANSWER="101"
fi

case ${ANSWER} in
101)
# check globicons file
if grep -Fxq "<icon>$filetest</icon>" $source ; then
xmessage "Checking globicons file... an icon exist! Do nothing."
exit
fi

# comment/uncomment this line for create or not tmp file
#cp $source $source.$tmp

# extract icon -
# you need install icoutils_ from Puppy Package Manager!

wrestool -x -t 14 "$1" > "$path/$name.ico"

# check extracting file
checkicon=$(file  "$path/$name.ico" | grep icon)
if [ "$checkicon" = "" ] ; then
xmessage "Sorry, icon can't extract, exit"
rm $path/$name.ico
exit
fi


# rox_filer globicons modify
a='  <rule match="'$1'">'
b='    <icon>'$path/$name'.ico</icon>'
c='  </rule>'
d='</special-files>'

file="/root/.config/rox.sourceforge.net/ROX-Filer/globicons"
cat $file | head -n -1 > $file".tmp"
echo $a >> $file".tmp"
echo $b >> $file".tmp"
echo $c >> $file".tmp"
echo -e "$d\c" >> $file".tmp"
rm -f $file
sleep .5
mv $file".tmp" $file
xmessage "Success, new icon created!"
#redraw Desktop option
#/usr/local/apps/ROX-Filer/ROX-Filer -p /root/Choices/ROX-Filer/PuppyPin
exit
;;
esac



7) Create AppInfo.xml (always in /usr/local/apps/SetWindowsIcon) file, edit and add
Code:
<?xml version="1.0"?>
<AppInfo>
  <Summary>Extract Windows .exe icon and set globicons file</Summary>
</AppInfo>


Cool Create a link (absolute) from your new folder to
Code:
/root/.config/rox.sourceforge.net/SendTo/.application_x-ms-dos-executable/


Try it!



Regard

_________________
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

Last edited by fabrice_035 on Sun 26 Jan 2020, 16:34; edited 2 times in total
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 1874
Location: Connecticut, United States

PostPosted: Sun 26 Jan 2020, 13:51    Post subject:  

I've needed this for years! Thank you for sharing the script.

I am going to try it out in Bionic64 where I am using Photofiltre Studio X and Total Commander

**
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0301s ][ Queries: 11 (0.0039s) ][ GZIP on ]