Skip to content

Latest commit

 

History

History
103 lines (68 loc) · 4.95 KB

README.md

File metadata and controls

103 lines (68 loc) · 4.95 KB


XDG Unused Data

A simple way to identify unused applications data in user directories such as ~./config and ~/.cache.

Shellcheck   JSON validation  Application Support  Lizense

Table of Contents

About

A package manager (such as dpkg, rpm, apt, or dnf) generally does not remove application files from user directories. Over time, these folders might accumulate redundant files due to the installation and removal of various applications on the system, leading to clutter.

The goal of xdg-unused-data.sh is to identify this files and folders.

Screenshot

How it works

The applications/ folder contains JSON files that provide information about each application, including its executable name and associated files and folders.

The scripts scans for each application. During execution, the script verifies the presence of both the executable and its corresponding files or folders. If the executable is missing but at least one of the associated files or folders exists, it is flagged for attention.

How to delete found files

There is no built-in feature for deleting those files, as an earlier version had such functionality but was subsequently removed. The decision to eliminate this feature was made due to concerns about potential risks associated with modifying or removing user data.

If you wish to delete these files, you have a couple of options. One approach is to manually remove them using a file manager or terminal. However, a more elegant solution involves piping the script's output through xargs to rm.

The script detects when its output is being piped and automatically removes unnecessary information such as names, file sizes, and summary. Alternatively, you can achieve the same behavior by adding the --raw argument`.

⚠️ Data Loss Risk - Proceed with Caution

Before executing any commands, please be aware that you are solely responsible for the consequences of running them. Deleting files using the following commands can lead to permanent data loss, and it is essential to exercise caution and understand what the commands mean before proceeding.

To delete all the files found by the script, you can run the following command:

./xdg-unused-data.sh | xargs rm -rf

If you only want to delete specific files, you can first filter the output using grep:

./xdg-unused-data.sh | grep gimp | xargs rm -rf

Dependencies

The following requirements are needed to run xdg-unused-data

Installation

1. Clone repository:

git clone https://github.com/pawel-0/xdg-unused-data

2. Change directory

cd xdg-unused-data/

3. Set permission

chmod +x ./xdg-unused-data.sh

4. Run application

./xdg-unused-data.sh

Arguments

Usage: xdg-unused-data.sh [argument]

  • --help Print help message
  • --raw Print raw file pathes without colors and additional information to process them further

Contribution

The projects success is all about how many applications it can support. And to achieve that excellent coverage, I could really use your help! If you happen to come across any files or folders in one of the xdg directories that aren't currently covered, I'd be thrilled if you could contribute to this project with a:

Thank you for supporting this project. You are highly appreciated.