Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next #313

Open
wants to merge 17 commits into
base: next
Choose a base branch
from
Open

Next #313

wants to merge 17 commits into from

Conversation

SmartFinn
Copy link

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

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.

* Extendable code
* No requires root permissions
* Can get icon name from CSV file by application name
* Better determining new icon name (from application name)
* Fixes icons on a user desktop and hides backup files
* Does not break shebang in launchers
* Works with files that have spaces in the name
* remove text between parentheses
* icon_lookup: change local icons path
* icon_lookup: return only the first match
* simplify show_menu
* apply: clean up
SC2021: Don't use [] around ranges in tr, it replaces literal square
brackets.
* added and changed several messages and comments
* some functions and variable have been renamed
* minor changes in code style and code refactoring
- get applications directories from XDG_DATA_DIR variable
- recursive search for desktop files
* added --csv-file option
* added --no-download option
* deleted --force-download option
* revert verb func name to verbose
* minor visual changes
- fix the local at first (don't read the same file twice)
- rename marker key
- fix get_upstream_version
- add clear command to show_menu
@SmartFinn
Copy link
Author

The command for quick testing:

wget -qO- https://raw.githubusercontent.com/SmartFinn/hardcode-fixer/next/fix.sh | VERBOSE=1 bash

@SmartFinn
Copy link
Author

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.

@Foggalong Foggalong added the merge label Dec 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants