hardcode-fixer
hardcode-fixer copied to clipboard
Next
Here is the first stage of improvements to the next version hardcode-fixer.
There is a simple diagram that can help to understand how the script works dia.pdf.
Requires
- bash >= 4 (included in all actual distros)
- GNU sed
- awk (prefer gawk but should work with any version)
- wget | curl (curl is not installed by default in Ubuntu 16.10 and newer, wget is not installed by default in Manjaro)
Features
- Supports XDG Base Directory Specification #310
- Converts invalid icon formats to png #306
- No requires root permission #178
- Auto-translate application name to icon name if matches not found in tofix.csv #220 #285
- Extendable code (as much as possible in bash)
- Has two user interface:
- Simple interactive menu (when args or commands not passed)
Extremely useful when executing via 'Run in Terminal' and through a pipe:
wget -qO- URL | bash
. - Advanced command line.
# the commands in this example do the same hardcode-fixer -Av hardcode-fixer --apply --verbose hardcode-fixer apply -v
- Simple interactive menu (when args or commands not passed)
Extremely useful when executing via 'Run in Terminal' and through a pipe:
- Fixes launchers on user desktop and hides backup files to avoid littering
- Compatible with current version of tofix.csv
Limitations
- doesn't work in BSD-systems. It's easy to fix, but the code will be ugly.
- can't undo changes that made by the previous version (from master branch)
ToDo
- [ ] cleanup tofix.csv:
- [ ] remove duplicates with the same app name
- [ ] fix the wrong app names
- [ ] delete Steam app entries
- [ ] fix launchers with non-standard extensions (
Icon=zotero.ico
, etc..) - [ ] add bash and zsh completions
- [ ] add colors for output messages (?)
NOTE: This PR can be merged. The improvements in the list will be added in another.
The command for quick testing:
wget -qO- https://raw.githubusercontent.com/SmartFinn/hardcode-fixer/next/fix.sh | VERBOSE=1 bash
Comparing the result of converting .desktop filename/app name to icon name -https://docs.google.com/spreadsheets/d/10kCgOZZMnlfBbLea29saV7fThUDwSYGsciRmyyhl-LQ/edit?usp=sharing
I think converting from app name is more predictable.