You are not logged in.

#1 2015-11-23 02:27:31

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Script to colorize Papirus icons

This was inspired by @KrunchTime's thread: Papirus Eye Candy.

Unfortunately (for me, anyway) the 'Smaller' and 'Very Small' use #000000 as a basis, so look odd if that size is chosen in Thunar IMO. Also they don't show up well if a dark theme is used.

This script colorizes the folder icons, and also changes the small sizes to match. The new Papirus GreyBlue iconset complements the FlatStudioDark and FlatStudio-OB themes

FtkknRbp.jpg

#!/bin/bash
##
# Script to colorize "papirus" icons to complement FlatStudioDark GTK theme
# The "Smaller" and "Very Small" icon sizes are also colorized from the default black.
#
# Writen by damo <damo@bunsenlabs.org>, November 2015
#
# USAGE: cd to icons location, then run script.
#        The 'papirus' icon directory is copied, and the changes made to 
#        the new directory contents.
########################################################################
ICODIR1="papirus"
ICODIR2="papirus-greyblue"

COL1_0="bb9e7b"     # folder dark colour
COL2_0="c6ae91"     # folder light colour
COL1_M_0="66bfb7"   # image folder bg colour
COL2_M_0="fff"      # image folder fg colour

COL1="8898AC"       # folder new light colour
COL2="6D8199"       # folder new dark colour
COL1_M="5C7AD0"     # image new icon bg
COL2_M="AFCDDA"     # image new icon fg

ICO_PLACES="48x48/places"       #   Colored folder icons
ICO_MIMES="48x48/mimetypes/image-x-generic.svg" # Yucky default greenish colour :(

arrICONS=( 16x16 22x22 24x24 )

# folder icons not to be changed
arrEXCLUDED=( black blue cyan green grey magenta pink red yellow )

[[ -d $ICODIR1 ]] &>/dev/null && mkdir -p $ICODIR2
cp -r $ICODIR1/* $ICODIR2/ && cd $ICODIR2

# change coloured icons
for f in "$ICO_PLACES"/*;do
    unset FLAG
    for i in ${arrEXCLUDED[@]};do
        if [[ $f = $ICO_PLACES/folder-$i.svg ]] &>/dev/null;then
            FLAG=1
            break
        fi
    done
    [[ ! $FLAG ]] && sed -i "s/$COL1_0/$COL1/g;s/$COL2_0/$COL2/g" "$f"
done

#change 'smaller' and 'very small 'dark icons
for fsmall in ${arrICONS[@]};do
    for f in $(find  "$fsmall/"   -name '*.svg' ); do 
        unset FLAG
        for i in ${arrEXCLUDED[@]};do
            if [[ ${f##*/} = "folder-$i.svg" ]] &>/dev/null; then
                FLAG=1
                break
            fi
        done
        [[ ! $FLAG ]] && sed -i "s/000000/$COL1/g; s/opacity:0.3/opacity:0.6/g; s/opacity:0.5/opacity:0.8/g" "$f"
    done
done

# Change image-x-generic.svg to match theme
sed -i "s/$COL1_M_0/$COL1_M/g;s/$COL2_M_0/$COL2_M/g" "$ICO_MIMES"

# Edit theme name in theme file
sed -i "s/Papirus/Papirus GreyBlue/g" index.theme

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#2 2015-11-23 03:38:16

gako
Member
Registered: 2015-10-02
Posts: 241

Re: Script to colorize Papirus icons

awesome! thx damo

Offline

#3 2015-11-23 07:49:51

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Script to colorize Papirus icons

Very nice, thank you!

I thought Papirus was for KDE?

Isn't the GTK version called Paper?

Offline

#4 2015-11-23 09:01:40

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: Script to colorize Papirus icons

Cool script. Thanks, damo.

Offline

#5 2015-11-23 14:28:50

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Script to colorize Papirus icons

Head_on_a_Stick wrote:

Very nice, thank you!

I thought Papirus was for KDE?

Isn't the GTK version called Paper?

I guess so, but although "Paper" is smaller it doesn't have dedicated folder images for the user-dirs, and many of the icons are washed-out and difficult to distinguish between (eg, all the x-text-*, package-, media-*, several others).

(I am working on a script to colorize "Paper" as well, btw wink )


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB