Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0bd820f
[volt] improve MANGOHUD_CONFIG handling
pythonlover02 Oct 10, 2025
e9f7dd9
[install] ensure that the target dirs exist
pythonlover02 Oct 10, 2025
ee03655
[volt] add and use stdout and stderr
pythonlover02 Oct 10, 2025
e3cbc19
[volt] remove unneded else
pythonlover02 Oct 10, 2025
149043e
[install] ensure that the target dirs exist, but keep it simple
pythonlover02 Oct 10, 2025
96ee9f7
[readme/test] improve the test script
pythonlover02 Oct 10, 2025
951cf7f
[scripts] reorganice the script and remove comments
pythonlover02 Oct 11, 2025
c145010
[readme/test] add the -r flag
pythonlover02 Oct 11, 2025
a41648a
[install/build/test] standarice colors on the scripts
pythonlover02 Oct 11, 2025
3fc9487
[remove] group all variable definitions
pythonlover02 Oct 11, 2025
232e1bb
[volt] bump reported version to 1.3.1
pythonlover02 Oct 11, 2025
fe132ff
[volt/make/install/remove/test] add appimage support
pythonlover02 Oct 14, 2025
f788f74
[volt/install] consider that usr/local/bin might be a symlink
pythonlover02 Oct 14, 2025
68ff01c
[volt/make/install/remove/test] update or add check_commands()
pythonlover02 Oct 14, 2025
08e2252
[readme] update requirements
pythonlover02 Oct 14, 2025
39e413b
[install] fix missing env var error
pythonlover02 Oct 14, 2025
ada9a5a
[make/install] update .desktop comments
pythonlover02 Oct 14, 2025
05f8b1f
[volt] add support for different volt paths
pythonlover02 Oct 15, 2025
e591228
[volt] refactor the volt-helper script
pythonlover02 Oct 15, 2025
e882057
[volt] fix errors created by the volt-helper refactor
pythonlover02 Oct 15, 2025
e465716
[volt] remove not used cmds
pythonlover02 Oct 15, 2025
1558d61
[volt/build/install/remove/test] prefer " "
pythonlover02 Oct 17, 2025
ab924d8
[volt] fix missing spaces
pythonlover02 Oct 17, 2025
c4d64bb
[volt] fix scaling_max_freq and scaling_min_freq
pythonlover02 Oct 17, 2025
67e1e1b
[volt] fix error when no scheduler was passed
pythonlover02 Oct 17, 2025
6d3c9e7
[volt] refactor the volt-helper
pythonlover02 Oct 17, 2025
ab74735
[volt] remove update from the title
pythonlover02 Oct 17, 2025
6519c3b
[volt] set launch_opts to an empy string by default
pythonlover02 Oct 17, 2025
5d94f1e
[make/test] use local vars when they make sense
pythonlover02 Oct 18, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
*.AppImage

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,25 @@ These will be passed to the executed program. Example:
- Each profile has its own set of configurations, which can be applied through the program or system tray.

## Build/Test Requirements:

- Linux operating system
- Python 3.9 or higher
- Pip
- The `python3-venv` package its required on Debian/Debian based distros.
- Linux operating system

## Additional requirements in the case you build the program using Nuitka:
- The `python3-venv` package is required on Debian/Debian based distros.
- bash
- tar
- coreutils
- shasum (for dependency hash checking)

## Additional Requirements for Building with Nuitka:
- C/C++ Compiler
- patchelf
- ccache (optional, for optimizing compiling times)

## Additional Requirements for Creating AppImage:
- fuse or fuse3
- wget
- chmod

## Additional requirements for some Options:

If this software is not provided, its options will be locked.
Expand Down Expand Up @@ -126,20 +133,32 @@ If this software is not provided, its options will be locked.

In the case you want to contribute to the project you can use the provided `test.sh` script to test the changes you made. This script will create a Python virtual environment if one does not already exist. This way, you don't have to install the program dependencies systemwide.

The first time you run it, use the -c flag that will also copy the `volt-helper` to `/usr/local/bin/`, as the program requires it for appliying the settings:
The first time you run it, use the -c flag and sudo, that will copy the `volt-helper` to `/usr/local/bin/`, as the program requires it for appliying the settings:

```
./test.sh -c
sudo ./test.sh -c
```

After this unless you make changes to the `volt-helper`, or the script have been updated, just run it without the flag to avoid unnecessary overwrites of the script:
After this unless you make changes to the `volt-helper`, or the script have been updated, just run it without the flag and sudo, this will create the `py_env` folder and run the program:

```
./test.sh
```

To delete the `py_env` folder you can use:

```
./test.sh -r
```

or:

```
sudo ./test.sh -r
```

> [!NOTE]
> You can use the `remove.sh` script to remove the `volt-helper`. The `py_env` folder should be deleted in the case you created it with your system python, and you want to use a python version that its inside a `distrobox` box, or vice versa.
> You can use the `remove.sh` script to remove the `volt-helper`. The `py_env` folder should be deleted if it becomes corrupted, or if it was created with your system python, and you want to use a python version that its inside a `distrobox` box, or vice versa.

## How to use `volt-gui`:

Expand Down
48 changes: 27 additions & 21 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,49 @@

set -euo pipefail

if [[ $EUID -ne 0 ]]; then
echo -e "\033[31mError: Please run this script as root (use sudo)\033[0m" >&2
exit 1
fi

RED="\033[0;31m"
BLUE="\033[0;34m"
NC="\033[0m"
INSTALL_DIR="/usr/local/bin"
BIN_DIR="bin"
EXECUTABLE="$BIN_DIR/volt-gui"
HELPER_SCRIPT="scripts/volt-helper"
DESKTOP_FILE="/usr/share/applications/volt-gui.desktop"

if [[ ! -d "$BIN_DIR" ]]; then
echo -e "\033[31mError: bin directory not found. Run make-pyinstaller.sh or make-nuitka.sh first.\033[0m" >&2
check_commands() {
for cmd in install mkdir cat update-desktop-database dirname; do
if ! command -v "$cmd" &> /dev/null; then
echo -e "${RED}Error: Required command "$cmd" not found${NC}" >&2
exit 1
fi
done
}

if [[ $EUID -ne 0 ]]; then
echo -e "${RED}Error: Please run this script as root (use sudo)${NC}" >&2
exit 1
fi

if [[ ! -f "$EXECUTABLE" ]]; then
echo -e "\033[31mError: Executable 'volt-gui' not found in bin directory. Run make-pyinstaller.sh or make-nuitka.sh first.\033[0m" >&2
check_commands

if [[ ! -d "$BIN_DIR" ]]; then
echo -e "${RED}Error: bin directory not found. Run make-pyinstaller.sh or make-nuitka.sh first.${NC}" >&2
exit 1
fi

if [[ ! -f "$HELPER_SCRIPT" ]]; then
echo -e "\033[31mError: Helper script $HELPER_SCRIPT not found.\033[0m" >&2
if [[ ! -f "$EXECUTABLE" ]]; then
echo -e "${RED}Error: Executable "volt-gui" not found in bin directory. Run make-pyinstaller.sh or make-nuitka.sh first.${NC}" >&2
exit 1
fi

echo -e "\033[34mInstalling main executable...\033[0m"
echo -e "${BLUE}Installing main executable...${NC}"
install -v -m 755 -T "$EXECUTABLE" "$INSTALL_DIR/volt-gui"

echo -e "\n\033[34mInstalling helper script...\033[0m"
install -v -m 755 -T "$HELPER_SCRIPT" "$INSTALL_DIR/volt-helper"

echo -e "\n\033[34mCreating desktop entry...\033[0m"
echo -e "\n${BLUE}Creating desktop entry...${NC}"
mkdir -p "$(dirname "$DESKTOP_FILE")"
cat > "$DESKTOP_FILE" << EOF
[Desktop Entry]
Name=volt-gui
Comment=A simple GUI program to modify and create the "volt" script and more
Comment=My AMD Adrenaline / NVIDIA Settings Linux Alternative
Exec=volt-gui
Icon=preferences-system
Terminal=false
Expand All @@ -48,8 +54,8 @@ EOF

echo "Desktop entry created at $DESKTOP_FILE"

echo -e "\n\033[34mUpdating desktop database...\033[0m"
echo -e "\n${BLUE}Updating desktop database...${NC}"
update-desktop-database "$(dirname "$DESKTOP_FILE")"

echo -e "\n\033[32mInstallation completed successfully!\033[0m"
echo "You can now run 'volt-gui' from the terminal or application menu."
echo -e "\nInstallation completed successfully!"
echo "You can now run "volt-gui" from the terminal or application menu."
130 changes: 130 additions & 0 deletions make-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#!/bin/bash

set -euo pipefail

RED="\033[0;31m"
BLUE="\033[0;34m"
NC="\033[0m"
APP_NAME="volt-gui"
BIN_DIR="bin"
EXECUTABLE="$BIN_DIR/volt-gui"
APPDIR="AppDir"
DESKTOP_FILE="volt-gui.desktop"
ICON_FILE="preferences-system.png"
SOURCE_ICON="images/1.png"
APPIMAGETOOL="appimagetool-x86_64.AppImage"
OUTPUT_FILE="${APP_NAME}-x86_64.AppImage"

cleanup() {
rm -rf "$APPDIR" 2>/dev/null || true
}

check_commands() {
for cmd in wget chmod mkdir cp cat dirname readlink du cut; do
if ! command -v "$cmd" &> /dev/null; then
echo -e "${RED}Error: Required command "$cmd" not found${NC}" >&2
exit 1
fi
done
}

verify_files() {
if [[ ! -f "$EXECUTABLE" ]]; then
echo -e "${RED}Error: Executable $EXECUTABLE not found${NC}" >&2
echo "Please run the build script first to create the executable" >&2
exit 1
fi
if [[ ! -f "$SOURCE_ICON" ]]; then
echo -e "${RED}Error: Icon file $SOURCE_ICON not found${NC}" >&2
exit 1
fi
}

create_appdir_structure() {
echo -e "${BLUE}Creating AppDir structure...${NC}"
mkdir -p "$APPDIR"
}

copy_icon() {
echo -e "${BLUE}Copying icon...${NC}"
cp "$SOURCE_ICON" "$APPDIR/$ICON_FILE"
}

create_desktop_file() {
echo -e "${BLUE}Creating desktop file...${NC}"
cat > "$APPDIR/$DESKTOP_FILE" << "EOF"
[Desktop Entry]
Name=volt-gui
Comment=My AMD Adrenaline / NVIDIA Settings Linux Alternative
Exec=volt-gui
Icon=preferences-system
Terminal=false
Type=Application
Categories=Utility;
EOF
}

create_apprun() {
echo -e "${BLUE}Creating AppRun script...${NC}"
cat > "$APPDIR/AppRun" << "EOF"
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
export APPDIR="${HERE}"
cd "${HOME}" 2>/dev/null || cd /tmp
exec "${HERE}/volt-gui" "$@"
EOF
chmod +x "$APPDIR/AppRun"
}

copy_executable() {
echo -e "${BLUE}Copying executable...${NC}"
cp "$EXECUTABLE" "$APPDIR/$APP_NAME"
chmod +x "$APPDIR/$APP_NAME"
}

download_appimagetool() {
if [[ ! -f "$APPIMAGETOOL" ]]; then
echo -e "${BLUE}Downloading appimagetool...${NC}"
wget -q --show-progress \
"https://github.com/AppImage/AppImageKit/releases/download/continuous/$APPIMAGETOOL"
chmod +x "$APPIMAGETOOL"
else
echo "appimagetool already downloaded"
fi
}

build_appimage() {
echo -e "${BLUE}Building AppImage...${NC}"
if ! ./"$APPIMAGETOOL" "$APPDIR" "$OUTPUT_FILE"; then
echo -e "${RED}Error: Failed to build AppImage${NC}" >&2
exit 1
fi
chmod +x "$OUTPUT_FILE"
}

print_success() {
local size=""

echo -e "\nBuild successful!"
echo -e "AppImage: $OUTPUT_FILE"
if command -v du &> /dev/null; then
size=$(du -h "$OUTPUT_FILE" 2>/dev/null | cut -f1 || echo "Unknown")
echo -e "File size: $size"
fi
}

main() {
trap cleanup EXIT
check_commands
verify_files
create_appdir_structure
copy_icon
create_desktop_file
copy_executable
create_apprun
download_appimagetool
build_appimage
print_success
}

main "$@"
46 changes: 20 additions & 26 deletions make-nuitka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@

set -euo pipefail

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'

RED="\033[0;31m"
BLUE="\033[0;34m"
NC="\033[0m"
VENV_DIR="py_env"
REQ_FILE="requirements.txt"
REQ_HASH_FILE="$VENV_DIR/requirements.sha256"
SRC_FILE="src/volt-gui.py"
BIN_DIR="bin"
BASE_FILENAME=$(basename "$SRC_FILE" .py)

NUITKA_OPTS=(
"--onefile"
"--output-filename=$BASE_FILENAME"
Expand All @@ -27,18 +23,17 @@ cleanup() {
}

check_commands() {
local commands=("python3" "pip")
for cmd in "${commands[@]}"; do
for cmd in python3 pip shasum cut cat basename mkdir mv du; do
if ! command -v "$cmd" &> /dev/null; then
echo -e "${RED}Error: Required command '$cmd' not found${NC}" >&2
echo -e "${RED}Error: Required command "$cmd" not found${NC}" >&2
exit 1
fi
done
}

create_venv() {
if [[ ! -d "$VENV_DIR" ]]; then
echo -e "${CYAN}Creating python3 virtual environment...${NC}"
echo -e "${BLUE}Creating python3 virtual environment...${NC}"
python3 -m venv "$VENV_DIR"
fi
}
Expand All @@ -51,22 +46,23 @@ verify_requirements() {
}

update_dependencies() {
local current_hash stored_hash
current_hash=$(shasum -a 256 "$REQ_FILE" | cut -d' ' -f1)
local current_hash=""
local stored_hash=""

current_hash=$(shasum -a 256 "$REQ_FILE" | cut -d" " -f1)
stored_hash=$(cat "$REQ_HASH_FILE" 2>/dev/null || true)

if [[ ! -f "$REQ_HASH_FILE" ]] || [[ "$current_hash" != "$stored_hash" ]]; then
echo -e "${CYAN}Updating dependencies...${NC}"
echo -e "${BLUE}Updating dependencies...${NC}"
pip install --upgrade pip
pip install --no-cache-dir -r "$REQ_FILE"
echo "$current_hash" > "$REQ_HASH_FILE"
fi
}

build_executable() {
echo -e "${CYAN}Building executable with Nuitka...${NC}"
echo -e "${YELLOW}Nuitka options: ${NUITKA_OPTS[*]}${NC}"

echo -e "${BLUE}Building executable with Nuitka...${NC}"
echo -e "Nuitka options: ${NUITKA_OPTS[*]}"
if ! nuitka "${NUITKA_OPTS[@]}" "$SRC_FILE"; then
echo -e "${RED}Error: Nuitka failed to build executable${NC}" >&2
exit 1
Expand All @@ -79,24 +75,22 @@ move_to_bin() {
}

main() {
local size=""

trap cleanup EXIT
check_commands
verify_requirements
create_venv

echo -e "${CYAN}Activating virtual environment...${NC}"
echo -e "${BLUE}Activating virtual environment...${NC}"
source "$VENV_DIR/bin/activate"

update_dependencies
build_executable
move_to_bin

echo -e "\n${GREEN}Build successful!${NC}"
echo -e "Executable: ${YELLOW}$BIN_DIR/$(basename "$BASE_FILENAME")${NC}"

echo -e "\nBuild successful!"
echo -e "Executable: $BIN_DIR/$BASE_FILENAME"
if command -v du &> /dev/null; then
local size=$(du -h "$BIN_DIR"/* 2>/dev/null | cut -f1 || echo "Unknown")
echo -e "File size: ${YELLOW}$size${NC}"
size=$(du -h "$BIN_DIR"/* 2>/dev/null | cut -f1 || echo "Unknown")
echo -e "File size: $size"
fi
}

Expand Down
Loading