https://github.com/shnatsel/pantheon-files-colorize
Programmatically colorize files in elementary OS
https://github.com/shnatsel/pantheon-files-colorize
elementary elementary-os pantheon scripting
Last synced: 12 months ago
JSON representation
Programmatically colorize files in elementary OS
- Host: GitHub
- URL: https://github.com/shnatsel/pantheon-files-colorize
- Owner: Shnatsel
- License: mit
- Created: 2017-06-13T19:04:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-15T00:56:50.000Z (about 9 years ago)
- Last Synced: 2025-04-05T10:12:16.317Z (over 1 year ago)
- Topics: elementary, elementary-os, pantheon, scripting
- Language: Python
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Programmatically colorize files in elementary OS
Want to highlight files that fit a certain criteria for later use, and not satisified with search? Then this script is for you.
`pantheon-files-colorize` is a command that lets you set colors for arbitrary files that will be displayed in elementary OS file manager, `pantheon-files`. You can use it from shell scripts or any other programs to highlight files based on arbitrarily complex criteria.
Run `pantheon-files-colorize` without parameters to see the list of supported colors and detailed usage instructions.
## Examples
### Taint code with TODOs or FIXMEs
`for file in ./*; do (grep -q TODO "$file" || grep -q FIXME "$file") && pantheon-files-colorize red "$file"; done`
### Get horrified by the sizes of binaries in /usr/bin
(as well as the amount of stuff in there; due to the sheer number of files this takes a while)
```
for file in /usr/bin/*; do
size_in_bytes=$(stat --format='%s' "$file")
if [ "$size_in_bytes" -lt 100000 ]; then
pantheon-files-colorize green "$file" # under 100kb
elif [ "$size_in_bytes" -lt 1000000 ]; then
pantheon-files-colorize yellow "$file" # under 1Mb
else
pantheon-files-colorize red "$file" # over 1Mb
fi
done
```
### Reset color for all files in the current folder and all of its subfolders
`pantheon-files-colorize none **`
## Limitations
You need to refresh the directory in pantheon-files to see changes made by this script. The keyboard shortcut for that is `Ctrl+R`