Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Pull base image
FROM python:3
FROM python:3.11-slim

# Set the working directory to /code
WORKDIR /code

# Copy the current directory content into the container at /code
ADD . /code

# Udate and install all in the container
# Update and install all in the container and clean up apt cache to reduce image size
RUN apt-get update && \
apt-get install -y
apt-get install -y \\
xvfb \\
libx11-6 \\
libxext6 \\
xauth \\
&& rm -rf /var/lib/apt/lists/*

# Install pipenv and install all dependency
RUN pip install --upgrade pip
RUN pip install pipenv
COPY ./Pipfile /code/Pipfile
RUN pipenv install --deploy --system --skip-lock --dev
# Install and update pip and pipenv and install all dependency
RUN pip install --upgrade pip pipenv
COPY Pipfile Pipfile.lock /code/
RUN pipenv install --deploy --system

# Copy the current directory content into the container at /code
ADD . /code
# Set enviroment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
17 changes: 17 additions & 0 deletions Extension_Sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Image extensions source:

[Raster_Image] (https://fileinfo.com/filetypes/raster_image)
[Vector_Image](https://fileinfo.com/filetypes/vector_image)
[Camera_Raw](https://fileinfo.com/filetypes/camera_raw)

# Music extensions source:

[Audio](https://fileinfo.com/filetypes/audio)

# Movie extensions source:

[Movie](http://bit.ly/2wvYjyr)

# Text extensions source:

[Text](http://bit.ly/2wwcfZs)
82 changes: 70 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,47 @@ The setup file is not yet configured (work in progress). To run the program, dow
the repo and install the required packages then run the `Clean.py` file.

# Technologies Used
Python 3.7

### Python Libraries Used ###
beautifulsoup4 - 4.6.0 | certifi - 2018.1.18 | chardet - 3.0.4 | colorama - 0.3.9 | crontab - 0.22.0 | idna - 2.6 | py-stackexchange - 2.2.7 | requests - 2.18.4
six - 1.11.0 | urllib3 - 1.22 | urwid - 2.0.1
Python 3.7

### Python Libraries Used

beautifulsoup4 - 4.6.0 | certifi - 2018.1.18 | chardet - 3.0.4 | colorama - 0.3.9 | crontab - 0.22.0 | idna - 2.6 | py-stackexchange - 2.2.7 | requests - 2.18.4
six - 1.11.0 | urllib3 - 1.22 | urwid - 2.0.1

# Demo

![Screenshot](demo1.png)

The buttons are `Clean`, `Exit`, `Undo`, `Schedule`, `Remove Schedule` and do exactly as they are implied.

`Clean` - will move the files to the correct folder based on extension. If the folder does not exist, it will create one.
`Exit` - will close out of the program
`Undo` - undos where the files were placed in the folders when `Clean` was used
`Undo` - undos where the files were placed in the folders when `Clean` was used
`Schedule` - schedules when the program will run every day in the users command line/ terminal
`Remove Schedule` - removes the previously established schedule

# Prerequisites
### Running a Virtual Environment ###
All the necessary packages are mentioned in `requirements.txt`. They can be installed by running `pip install -r requirements.txt` or using ``pipenv install`` and it will automatically detect the `requirements.txt` and setup an enviroment for you. For development purposes, I suggest you create a
virtual environment or use a dependency manager like [pipenv](https://github.com/pypa/pipenv) to keep a clear state, separate from your own setup.

To create a virual environment yourself in pipenv, follow the steps below:
### Running a Virtual Environment

All the necessary packages are mentioned in `requirements.txt`. They can be installed by running `pip install -r requirements.txt` or using `pipenv install` and it will automatically detect the `requirements.txt` and setup an enviroment for you. For development purposes, I suggest you create a
virtual environment or use a dependency manager like [pipenv](https://github.com/pypa/pipenv) to keep a clear state, separate from your own setup.

To create a virual environment yourself in pipenv, follow the steps below:

1. Make a project directory `mkdir project && cd project` where "project" would be the name of the project
2. Initiate the virtual environment `pipenv --three`
3. Start the virtual enviroment `pipenv shell`
If the `pipenv install` does not work, insert the following `pipenv install -r requirements.txt`
If the `pipenv install` does not work, insert the following `pipenv install -r requirements.txt`
4. To exit the virtual environment run `exit`

The `activate.sh` script has been provided to ensure a standard development environment. To create the environment if it doesn't already exist, or simply load it otherwise, run `source ./activate.sh`

You can also use docker in combination with pipenv, [here](https://github.com/dfederschmidt/docker-pipenv-sample) you have an example.
### Not Running from Virtual Environment ###

### Not Running from Virtual Environment

If you do not want to create a virtual environment, just run the pip command above and ignore the following. Otherwise, the `activate.sh` script will handle the creation and loading of the virtual environment with all the necessary dependencies. Furthermore, once a new dependency is established, remove `requirements.txt` and please run `pip freeze > requirements.txt` to generate a new file that should be committed to version control.

Python3 Instructions:
Expand All @@ -64,12 +72,62 @@ Navigate to the repo and run the following command:
`$ pip install -r requirements.txt`

# Contributing

Please read the [Contributing Guidlines](https://github.com/blavejr/OrganiseDesktop/blob/master/CONTRIBUTING.md) for details about pull requests, bug reports or opening an issue.

Believe in the tech, use the tech, buy a dev coffee.
Btc: 3GiHDAed4UFcE9itaVxQnTrKbW4Uw2kq3o
Ether: 0x14fe9256e1a0d35AB57FdE974E44C1Eaee8005d6
Ltc:MJNKM9SYannnrFuAcMubzEvKBgVPFeBaKm
Bat:0x744de3A9b1882C44dCB3AFD1e6f2dB459b64c45c
USDC:0x8EC9ae0DC0147422c1e9e46124d0BfeE7d16a3e7
USDC:0x8EC9ae0DC0147422c1e9e46124d0BfeE7d16a3e7
USDC:0x8EC9ae0DC0147422c1e9e46124d0BfeE7d16a3e7

---

## Fork Modifications

> This is a fork of [blavejr/OrganiseDesktop](https://github.com/blavejr/OrganiseDesktop). The following changes were made on top of the original project.

### Changes by [@hasanshinnar](https://github.com/hasanshinnar)

#### 2026-04-07

**`activate.bat`** _(new file)_

- Added a Windows-friendly activation script as an alternative to `activate.sh`, following the same setup/activation flow.

**`Dockerfile`**

- Optimized the build to reduce unnecessary layers and improve build performance.

**`organise_desktop/Clean.py`**

- Removed `root.resizable` and `position` constraints for better layout flexibility.
- General code modernization and performance improvements.

**`organise_desktop/CronController.py`**

- Modernized and refactored code for efficiency.
- Fixed bugs in the Windows-specific code path.

**`organise_desktop/organiseDesktop.py`**

- Merged `list_directory_content()` into `mover()` to reduce function overhead.
- Extracted extension definitions into `Extension_Sources.md` for cleaner separation.
- Added `_PatternRules` support: matches files by exact name rather than extension alone.
- General logic and performance improvements.

**`Extension.json`**

- Added `_PatternRules` entries to support exact filename matching.

#### 2026-04-09

**`run.py`** _(new file)_

- Single entry point that runs both setup and the main script, replacing the need to invoke two files manually.

**`setup.py` → `environment.py`** _(renamed)_

- Renamed to avoid conflict with Python's built-in `setup.py` convention, which caused import resolution issues.
52 changes: 52 additions & 0 deletions activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@echo off
:: Check for administrative privileges if not, relaunch the script with admin rights
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /b

:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
:: IMPORTANT: Move to the directory where the script is located
cd /d "%~dp0"

:: Check if the virtual environment folder exists if not create it and load the environment
if exist organise_desktop_env\ (
call :load_env
) else (
echo Creating new virtual environment...
pip install virtualenv
virtualenv organise_desktop_env

if not exist virtual_desktop mkdir virtual_desktop

call :load_env

if %ERRORLEVEL% EQU 0 (
if exist requirements.txt (
pip install -r requirements.txt
) else (
echo.
echo [INFO] requirements.txt not found. Skipping library installation.
echo.
)
) else (
echo Loading the environment has failed
)
)

pause
exit /b

:load_env
call organise_desktop_env\Scripts\activate.bat
set TEST_DIR=%CD%\virtual_desktop
echo Environment loaded as Admin in: %CD%
exit /b 0
48 changes: 48 additions & 0 deletions environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import sys, os


def setup_environment():

if sys.version_info < (3, 6):
print("Python 3.6 or higher is required...")
sys.exit(1)
with open("README.md", encoding="utf-8") as f:
longd = f.read()

base_path = os.path.dirname(os.path.abspath(__file__))
ext_path = os.path.join(base_path, "organise_desktop", "Extension.json")
if __name__ == "__main__":
setup(
name="OrganiseDesktop",
include_package_data=True,
packages=find_packages(),
data_files=[("OrganiseDesktop", [ext_path])],
entry_points={
"console_scripts": ["organise_desktop = organise_desktop.Cli:main"]
},
install_requires=[
"BeautifulSoup4",
"requests",
"colorama",
"Py-stackExchange",
"urwid",
"crontab",
],
requires=[
"os",
"getpass",
"time",
"sys",
"tkinter",
],
version="1.0",
url="https://github.com/blavejr/OrganiseDesktop.git",
keywords="Desktop Organiser",
license="MIT",
author="Remigius Kalimba",
author_email="kalimbatech@gmail.com",
description="Organise your desktop with one click.",
long_description="\n\n{}".format(longd),
)
Loading