chore: standardize build procedure
This commit is contained in:
@@ -89,6 +89,10 @@ install(TARGETS wallpaper-carousel
|
|||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(FILES ${CMAKE_CURRENT_LIST_DIR}/app/wallpaper-carousel.desktop
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
||||||
|
)
|
||||||
|
|
||||||
if(QT_VERSION_MAJOR EQUAL 6)
|
if(QT_VERSION_MAJOR EQUAL 6)
|
||||||
qt_finalize_executable(wallpaper-carousel)
|
qt_finalize_executable(wallpaper-carousel)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,5 +1,52 @@
|
|||||||
It might not be that worthy to write a Qt application for such a small feature, but why not?
|
## What is this
|
||||||
|
|
||||||
|
It might not be that worthy to write a QtWidget application for such a small feature, but I kind of enjoy the pain... So here it is.
|
||||||
|
|
||||||
<img src="https://github.com/Uyanide/backgrounds/blob/master/screenshots/desktop-alt.jpg?raw=true"/>
|
<img src="https://github.com/Uyanide/backgrounds/blob/master/screenshots/desktop-alt.jpg?raw=true"/>
|
||||||
|
|
||||||
The config file should be placed in `~/.config/wallpaper-carousel/config.json`. Refer to [config.example.json](https://github.com/Uyanide/Wallpaper_Chooser/blob/master/config.example.json) and [config.h](https://github.com/Uyanide/Wallpaper_Chooser/blob/master/src/config.h) for specific entries.
|
## How to build
|
||||||
|
|
||||||
|
1. Make sure you have Qt6 libraries, CMake and a C++ compiler installed.
|
||||||
|
|
||||||
|
e.g. On Arch-based systems:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S --needed qt6-base cmake gcc
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Clone the repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Uyanide/Wallpaper_Carousel.git --depth 1
|
||||||
|
cd Wallpaper_Carousel
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run build script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
app/install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
or if you prefer a prefix other than `/usr/local`, e.g. `$HOME/.local`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
PREFIX=$HOME/.local ./app/install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
>
|
||||||
|
> This script will ask for `sudo` permission if the prefix is set to a system directory like `/usr/local`. Please make sure you have read and trust the script before proceeding.
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
The config file should be placed in `~/.config/wallpaper-carousel/config.json`. Refer to [config.example.json](config.example.json) and [config.h](src/config.h) for specific entries.
|
||||||
|
|
||||||
|
A minimum config should at least contain the path(s) to wallpapers, e.g.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"wallpaper": {
|
||||||
|
"dirs": ["/path/to/your/wallpapers"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
+14
-9
@@ -1,18 +1,23 @@
|
|||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
prefix=${PREFIX:-/usr/local}
|
||||||
|
|
||||||
path="$(dirname "$(readlink -f "$0")")"
|
path="$(dirname "$(readlink -f "$0")")"
|
||||||
|
|
||||||
cmake -S "$path/.." -B "$path/../build" \
|
cmake -S "$path/.." -B "$path/../build" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_INSTALL_PREFIX="$prefix"
|
||||||
-DCMAKE_INSTALL_PREFIX="$HOME"/.local || exit 1
|
|
||||||
|
|
||||||
cmake --build "$path/../build" --target install || exit 1
|
cmake --build "$path/../build"
|
||||||
|
|
||||||
cp "$path/wallpaper-carousel.desktop" "$HOME"/.local/share/applications/wallpaper-carousel.desktop
|
if [ ! -w "$prefix" ] && [ "$(id -u)" -ne 0 ]; then
|
||||||
|
sudo cmake --install "$path/../build"
|
||||||
echo "Exec=$HOME/.local/bin/wallpaper-carousel" >>"$HOME"/.local/share/applications/wallpaper-carousel.desktop
|
else
|
||||||
|
cmake --install "$path/../build"
|
||||||
if command -v update-desktop-database &>/dev/null; then
|
|
||||||
update-desktop-database "$HOME"/.local/share/applications/
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if command -v update-desktop-database &>/dev/null; then
|
||||||
|
echo "Updating desktop database..."
|
||||||
|
update-desktop-database "$prefix"/share/applications/ || true
|
||||||
|
fi
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
Version=1.0
|
Version=1.0
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Wallpaper Carousel
|
Name=Wallpaper Carousel
|
||||||
|
GenericName=Animated wallpaper selector
|
||||||
|
TryExec=wallpaper-carousel
|
||||||
|
Exec=wallpaper-carousel
|
||||||
Comment=A small wallpaper utility made with Qt
|
Comment=A small wallpaper utility made with Qt
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Application;Utility;
|
Categories=Application;Utility;DesktopSettings;
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
|
Keywords=wallpapers;
|
||||||
|
|||||||
Reference in New Issue
Block a user