You are not logged in.
The folder icons in Papirus come in a variety of colours: black,blue,brown,cyan,green,grey,magenta,orange,red,violet,yellow
The default is blue, and this is set by symlinks from eg user-home.svg to user-home-blue.svg
That blue is a bit bright, but the Papirus site currently says:
Currently, there is no easy way to change the global color of folders. You may edit the themes by yourself if you wish.
Changing the folders to eg grey would mean rewriting all the symlinks to eg user-home-grey.svg
That's certainly easier than editing all the svg files, but there are still a lot of symlinks in there!
EDIT: please see the much improved script below.
Today I hacked together a one-liner using find to find all the symlinks that point to *-blue-* or *-blue.* and rewrite them to the grey equivalent (substitute some other colour for "grey" if you wish):
find /usr/share/icons/Papirus -type l -path '*/places/*' \( -ilname '*-blue-*' -o -ilname '*-blue.*' \) ! -iname '*-blue-*' ! -iname '*-blue.*' -exec bash -c 'echo "icon: $0"; link="$(readlink "$0")"; echo "link: $link"; newlink="${link/-blue/-grey}"; echo "newlink: $newlink"; sudo ln -sf "$newlink" "$0";echo' '{}' \;
It outputs what happened so you can go back and fix things if necessary. I tried to avoid mistakes with things like bluetooth, but if anyone tries this and hits a snag, please report back!
You'll probably want to do a
sudo update-icon-caches /usr/share/icons/*
to see the result.
EDIT: added a */places/* condition to keep it down to folders only.
Last edited by johnraff (2017-10-28 08:57:58)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Clever!
Offline
Here's a "proper" script to do the job. It generates a new icon theme in ~/.local/share/icons/Papirus-color (you can change the name) which holds the recoloured folder icons (symlinks actually) and inherits Papirus for everything else. You can choose to recolour folders to one of black, blue, bluegrey, brown, cyan, green, grey, magenta, orange, pink, purple, red, teal, violet or yellow. If you do not choose a colour it defaults to grey, although I think bluegrey is nice too.
Run 'papirus-folder-color.sh -h' to see a usage message.
After running 'papirus-folder-color.sh' set your icon theme to Papirus-color to see the change.
And please post back if you hit any problems!
#!/bin/bash
# papirus-folder-color.sh
# Generate icon theme inheriting Papirus,
# but with different coloured folder icons.
new_theme='Papirus-color' # Name of new generated theme
source_dir=/usr/share/icons/Papirus
#source_dir="$PWD"
target_dir="$HOME/.local/share/icons/${new_theme}"
#target_dir=../"${new_theme}"
copy_files=false # If true, copy icons into new theme instead of symlinking.
USAGE="
papirus-folder-color.sh [color]
Where color can be one of:
black,blue,bluegrey,brown,cyan,green,grey,magenta,orange,pink,purple,red,teal,violet,yellow
If color is not specified, it defaults to grey.
Generates a user custom icon theme with a different folder color from
the default Papirus blue.
papirus-folder-color.sh [-h|--help]
Display this message.
The Papirus theme is read from /usr/share/icons/Papirus, and
the generated theme written to $HOME/.local/share/icons/${new_theme}
These paths can be changed by editing the variables
source_dir, target_dir and new_theme at the top of this file.
If copy_files=true then icons will be copied into the new theme,
not symlinked (which is the default). This increases the size,
but improves portability.
If source_dir and target_dir are under the same top-level directory
then symlinked icons will use relative paths, otherwise absolute paths.
"
########################################################################
defcolor=blue # the Papirus default
error_exit() {
echo "$0 error: $1" >&2
exit 1
}
[[ $(basename "$source_dir") = Papirus ]] || error_exit "$source_dir: Not a Papirus theme directory"
[[ $(basename "$target_dir") = Papirus* ]] || error_exit "$target_dir: Not a Papirus theme directory" # try to avoid accidents
case "$1" in
black|blue|bluegrey|brown|cyan|green|grey|magenta|orange|pink|purple|red|teal|violet|yellow)
color="$1";;
'')
color=grey;;
-h|--help)
echo "$USAGE"; exit;;
*)
error_exit "$1: Unrecognized option."
esac
# Define function to make symlinks,
# relative if source & target have same top-level directory.
# If copy_files is true, copy instead of linking.
set_linking() {
if [[ $copy_files = true ]]
then
link_file() { cp "$1" "$2"; }
else
local tld_src=$( readlink -f ${source_dir} )
tld_src=${tld_src#/}
tld_src=${tld_src%%/*}
local tld_tgt=$( readlink -f ${target_dir} )
tld_tgt=${tld_tgt#/}
tld_tgt=${tld_tgt%%/*}
if [[ $tld_src = $tld_tgt ]]
then
link_file() { ln -sfr "$1" "$2"; }
else
link_file() { ln -sf "$1" "$2"; }
fi
fi
}
set_linking
[[ -e "$target_dir" ]] && {
echo "$target_dir will be removed and replaced, OK?"
read -r -p ' remove? (y/n) '
case ${REPLY^^} in
Y|YES)
rm -rf "$target_dir" || error_exit "Failed to remove $target_dir";;
*)
echo 'User cancelled. Exiting...'; exit;;
esac
}
mkdir -p "$target_dir" || error_exit "Failed to create $target_dir"
shortdirlist=
longdirlist=
for subdir in "$source_dir"/*
do
[[ -d ${subdir}/places && ! -h $subdir ]] || continue
files=()
while IFS= read -r -d '' file
do
files+=("$file")
done < <(find "${subdir}/places" -type l \( -ilname "*-$defcolor-*" -o -lname "*-$defcolor.*" \) ! -iname "*-$defcolor-*" ! -iname "*-$defcolor.*" -print0)
[[ ${#files[@]} -gt 0 ]] || continue
dirname=${subdir##*/}
mkdir -p "$target_dir/${dirname}/places" || error_exit "Failed to create $target_dir/${dirname}/places"
scaledname=${dirname}@2x
[[ $dirname != symbolic ]] && ln -s "${dirname}" "${target_dir}/${scaledname}" || error_exit "Failed to link ${target_dir}/${scaledname} to ${dirname}"
for i in "${files[@]}"
do
find "${subdir}/places" -type l -lname "${i##*/}" -exec cp --no-dereference '{}' "$target_dir/${dirname}/places" \;
target="$(readlink "$i")"
target="${target/-${defcolor}/-${color}}"
[[ -f "$subdir/places/$target" ]] || { echo "$subdir/places/$target: not found"; continue; }
link_file "$subdir/places/$target" "$target_dir/$dirname/places/${i##*/}" || error_exit "Failed to link_file() $target_dir/$dirname/places/${i##*/} to $subdir/places/$target"
done
case "${dirname}" in
64x64)
shortdirlist+="${dirname}/places,${scaledname}/places,"
longdirlist+="[${dirname}/places]
Context=Places
Size=64
MinSize=64
MaxSize=512
Type=Scalable
[${scaledname}/places]
Context=Places
Size=64
Scale=2
MinSize=64
MaxSize=512
Type=Scalable
"
;;
symbolic)
shortdirlist+="${dirname}/places,"
longdirlist+="[${dirname}/places]
Context=Places
Size=16
MinSize=16
MaxSize=512
Type=Scalable
"
;;
*)
shortdirlist+="${dirname}/places,${scaledname}/places,"
longdirlist+="[${dirname}/places]
Context=Places
Size=${dirname%x*}
Type=Fixed
[${scaledname}/places]
Context=Places
Size=${dirname%x*}
Scale=2
Type=Fixed
"
;;
esac
done
cat <<EOF > "$target_dir/index.theme"
[Icon Theme]
Name=$new_theme
Comment=Recoloured Papirus icon theme for BunsenLabs
Inherits=Papirus,breeze,ubuntu-mono-dark,gnome,hicolor
DesktopDefault=48
ToolbarDefault=16
ToolbarSizes=16,22,32,48
MainToolbarDefault=16
MainToolbarSizes=16,22,32,48
PanelDefault=22
PanelSizes=16,22,32,48,64,128,256
FollowsColorScheme=true
# Directory list
Directories=${shortdirlist%,}
$longdirlist
EOF
gtk-update-icon-cache "$target_dir"
Last edited by johnraff (2019-05-22 03:35:55)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
^good news - thanks!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Thankyou for this John, seems to be working ok on my desktop.
https://cdn.scrot.moe/images/2017/11/03/Screenshot_2017-11-03_19-09-28.th.png
That simple grey theme really looks nice and easy on the old eyes
Real Men Use Linux
Offline
I could be mistaken, but this seems to always output Papirus-bluegrey in Debian 11??
Offline
^Papirus-bluegrey is the default - you should be able to pass some other colour as an option though.
But there's a newer version of the script here, you might want to try that:
https://github.com/BunsenLabs/bunsen-pa … r-color.sh
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Now that Papirus has more colors than when this thread was already made so you all can sure have fun with them. Good that you updated the script and does it account for all the new colors?
Real Men Use Linux
Offline
Yes indeed it does have all the new colors included:) Wonderful script @johnraff
Offline
There is a tool called papirus-folders available as a deb file that offers about a dozen colors. Here's the list:
black
blue
bluegrey
breeze
brown
cyan
deeporange
green
grey
indigo
magenta
> nordic
orange
palebrown
paleorange
pink
red
teal
violet
white
yaru
yellow
Pax vobiscum,
Mark Rabideau - https://many-roads.com https:/eirenicon.org
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Offline
Latest version of bunsen-papirus-icon-theme ships an improved script installed to /usr/share/bunsen/papirus/papirus-folder-color.sh No need to edit variables, pass everything via CLI options. Run papirus-folder-color.sh --help for, er, help.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline