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

v2.1.0 #74

Merged
merged 34 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a859f26
new project structure
jszczerbinsky Dec 30, 2023
814ad6c
Wallpaper subprocess
jszczerbinsky Dec 31, 2023
cc55b03
Exit dialog
jszczerbinsky Dec 31, 2023
99837c7
Monitor scanner
jszczerbinsky Dec 31, 2023
ff60426
Monitor list box
jszczerbinsky Jan 2, 2024
e3475a5
Changed screenWindow to monitorWindow
jszczerbinsky Jan 2, 2024
9f8d8c8
Building on Windows
Jan 2, 2024
27f41e8
Windows wlp subprocess and monitor scanner
Jan 4, 2024
079f0d5
Update compilation steps for Windows in README
Jan 4, 2024
a8f6519
Wallpaper scanner
jszczerbinsky Jan 15, 2024
9a917a7
Monitor config window
jszczerbinsky Jan 15, 2024
d6a2873
Saving basic monitor config
jszczerbinsky Jan 15, 2024
281805d
Saving and loading monitor configuration
jszczerbinsky Jan 16, 2024
94a0ab0
Loading configuration from wallpaper process
jszczerbinsky Jan 31, 2024
c568392
Fixed few bugs
jszczerbinsky Jan 31, 2024
740a70b
Cleaned code
jszczerbinsky Jan 31, 2024
9118623
Freeing memory at exit
jszczerbinsky Jan 31, 2024
17fe386
version label
jszczerbinsky Jan 31, 2024
ea51023
Running on Windows (but wlp not moving
Feb 7, 2024
71d9672
Tray icon
Feb 8, 2024
c08bac5
Tray icon
Feb 16, 2024
3fc4a7a
Finding paths to different program components
jszczerbinsky Feb 16, 2024
fd39c40
New window template
jszczerbinsky Feb 17, 2024
2607347
Application settings window and wallpaper filtering
jszczerbinsky Feb 18, 2024
5bf368c
Update README.md
jszczerbinsky Feb 18, 2024
29912ed
Creating user settings dirs at startup
jszczerbinsky Feb 19, 2024
6445b63
G_APPLICATION_FLAGS_NONE compatibility
jszczerbinsky Feb 20, 2024
14a1ab7
Update build.yml
jszczerbinsky Mar 8, 2024
878043a
Hiding window on start
jszczerbinsky Mar 8, 2024
8ff13a4
Custom installation prefix on Linux
jszczerbinsky Mar 8, 2024
4e34348
Working on Windows
Mar 9, 2024
513147c
Update README.md
jszczerbinsky Mar 9, 2024
389bcee
Removed unnecessary files
Mar 9, 2024
02f0903
Merge pull request #66 from jszczerbinsky/config-window
jszczerbinsky Mar 9, 2024
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
62 changes: 21 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install cmake
uses: lukka/get-cmake@v3.26.0
- name: Install dependencies
run: sudo apt install libsdl2-dev
run: sudo apt update && sudo apt install libsdl2-dev libconfig-dev libgtk-3-dev
- name: Build
run: mkdir -p build && cd build && cmake ../ && cmake --build . && cpack

Expand All @@ -28,45 +28,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cmake
uses: lukka/get-cmake@v3.26.0
- name: Install MinGW
uses: egor-tensin/setup-mingw@v2
- name: Install MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install wget
run: choco install wget
- name: Install dependencies`
run: |
wget -nv https://github.com/libsdl-org/SDL/releases/download/release-2.26.3/SDL2-devel-2.26.3-mingw.zip
7z x -bd SDL2-devel-2.26.3-mingw.zip -omingw
wget -nv https://github.com/libsdl-org/SDL/releases/download/release-2.26.3/SDL2-devel-2.26.3-VC.zip
7z x -bd SDL2-devel-2.26.3-VC.zip -omsvc
- name: Build with MSVC
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW64
install: >-
git
curl
unzip
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gtk3
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-libconfig
- name: Download SDL2 runtime
shell: msys2 {0}
run: |
mkdir buildMSVC
cd buildMSVC
cmake -G "Visual Studio 17" -DSDL2_DIR=${{ github.workspace }}\msvc\SDL2-2.26.3\cmake -DSDL2_RUNTIME_DIR=${{ github.workspace }}\msvc\SDL2-2.26.3\lib\x64 ..\
cmake --build .
cd ..
- name: Build with MinGW
run: |
mkdir buildMinGW
cd buildMinGW
cmake -G "MinGW Makefiles" -DSDL2_DIR=${{ github.workspace }}\mingw\SDL2-2.26.3\cmake -DSDL2_RUNTIME_DIR=${{ github.workspace }}\mingw\SDL2-2.26.3\x86_64-mingw32\bin -DCMAKE_BUILD_TYPE=Release ..\
cmake --build .


macOS:
name: Build on MacOS
runs-on: macos-12

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cmake
uses: lukka/get-cmake@v3.26.0
- name: Install dependencies`
run: brew install sdl2
curl -L https://github.com/libsdl-org/SDL/releases/download/release-2.30.1/SDL2-2.30.1-win32-x64.zip > sdl2.zip
unzip sdl2.zip
- name: Build
run: mkdir build && cd build && cmake ../ && cmake --build . && sudo cpack
shell: msys2 {0}
run: mkdir -p build && cd build && cmake -DSDL2_RUNTIME_DIR=${GITHUB_WORKSPACE} ../ && cmake --build . && ../distributeDLLs.sh && cpack
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
resource.rc
.DS_Store

compile_commands.json
.cache

data/
build/
*.res

.vscode

# Prerequisites
*.d

Expand Down
130 changes: 22 additions & 108 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
cmake_minimum_required(VERSION 3.13)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

project(lwp
LANGUAGES C)

if(SDL2_RUNTIME_DIR)
string(REPLACE "\\" "/" SDL2_RUNTIME_DIR ${SDL2_RUNTIME_DIR})
endif()

# Detect the platform
if (APPLE)
set(_UNAME "DARWIN")
elseif (WIN32)
set(_UNAME "WIN32")
if (MSYS OR MINGW)
set(_UNAME "WIN32")
elseif(UNIX)
set(_UNAME "LINUX")
else()
set(_UNAME "LINUX")
message(FATAL_ERROR "Unsupported platform")
endif()

# Detect version
Expand All @@ -35,135 +33,51 @@ if(NOT DEFINED PROGRAM_VERSION)
message(WARNING "Can't determine Layered WallPaper version")
endif()

set(_SOURCE_FILES
main.c
debug.c
parser.c
wallpaper.c
window.c
)

# Windows resource file
if(_UNAME STREQUAL "WIN32")
if(MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE(RC)
SET(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
endif(MINGW)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resource.template.rc ${CMAKE_CURRENT_SOURCE_DIR}/resource.rc
@ONLY)
list(APPEND _SOURCE_FILES "resource.rc")
endif()

# SDL2 dependency
find_package(SDL2 REQUIRED CONFIG)
set(_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
set(_LIBS ${SDL2_LIBRARIES})

if (_UNAME STREQUAL "DARWIN")
# MacOSX framework dependencies
list(APPEND _LIBS "-framework CoreGraphics" "-framework Foundation")
endif()

if (_UNAME STREQUAL "LINUX")
# X11 dependency
find_package(X11 REQUIRED)
list(APPEND _INCLUDE_DIRS ${X11_INCLUDE_DIR})
list(APPEND _LIBS ${X11_LIBRARIES})
endif()

option(LWP_INSTALL_LAUNCHD "Launch lwp on login (MacOSX only)" OFF)

# Config file
set(_DEFAULT_CONFIG_FILE default.cfg)
if(_UNAME STREQUAL "WIN32")
set(_DEFAULT_CONFIG_FILE defaultWin.cfg)
endif()
if (_UNAME STREQUAL "DARWIN")
set(_DEFAULT_CONFIG_FILE defaultMac.cfg)
endif()

# Main executable
if (_UNAME STREQUAL "DARWIN")
add_executable(lwp MACOSX_BUNDLE ${_SOURCE_FILES})
else()
add_executable(lwp ${_SOURCE_FILES})
endif()

# Windows specific properties for executable
if(_UNAME STREQUAL "WIN32")
set_property(TARGET lwp PROPERTY VS_DPI_AWARE "PerMonitor")
endif()

if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
endif()
add_subdirectory(src/wlp)
link_directories(src/wlp)

target_compile_definitions(lwp PUBLIC __${_UNAME})
target_include_directories(lwp PUBLIC ${_INCLUDE_DIRS})
target_link_libraries(lwp PRIVATE ${_LIBS})
add_subdirectory(src/core)
link_directories(src/core)

# Installation rules
if(_UNAME STREQUAL "WIN32")
install(TARGETS lwp
DESTINATION .)
install(DIRECTORY wallpapers
DESTINATION .)
install(FILES LICENSE.txt
install(DIRECTORY build/dlls/
DESTINATION .)
install(FILES ${_DEFAULT_CONFIG_FILE}
install(DIRECTORY src/window_templates
DESTINATION .)
install(FILES LICENSE.txt
DESTINATION .)
install(FILES ${SDL2_RUNTIME_DIR}/SDL2.dll
DESTINATION .)
install(FILES ${SDL2_RUNTIME_DIR}/README-SDL.txt
DESTINATION .)
elseif(_UNAME STREQUAL "LINUX")
install(TARGETS lwp
DESTINATION usr/local/bin)
else()
install(DIRECTORY wallpapers
DESTINATION usr/local/share/lwp)
DESTINATION share/lwp)
install(DIRECTORY src/window_templates
DESTINATION share/lwp)
install(FILES LICENSE.txt
DESTINATION usr/local/share/lwp)
install(FILES ${_DEFAULT_CONFIG_FILE}
TYPE SYSCONF
RENAME lwp.cfg)
else()
install(TARGETS lwp
DESTINATION Layered_WallPaper)
install(DIRECTORY wallpapers
DESTINATION Layered_WallPaper)
install(FILES LICENSE.txt
DESTINATION Layered_WallPaper)
install(FILES ${_DEFAULT_CONFIG_FILE}
DESTINATION Layered_WallPaper
RENAME lwp.cfg)
install(FILES lwp.template.plist
DESTINATION Layered_WallPaper)
install (FILES setupPlist.command
DESTINATION Layered_WallPaper
RENAME Toggle_Autorun.command
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install (FILES setupPlist.command
DESTINATION .
RENAME Toggle_Autorun.command
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

DESTINATION share/lwp)
endif()


# Installer
if (_UNAME STREQUAL "WIN32")
set(CPACK_GENERATOR NSIS)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Layered WallPaper")
elseif(_UNAME STREQUAL "LINUX")
set(CPACK_GENERATOR TGZ)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
elseif(_UNAME STREQUAL "DARWIN")
set(CPACK_GENERATOR DragNDrop)
set(CPACK_DMG_BACKGROUND_IMAGE ${CMAKE_CURRENT_SOURCE_DIR}/dmgBg.png)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/setupDmg.applescript)
endif()

set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.ico)
set(CPACK_NSIS_MUI_UNIICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.ico)
set(CPACK_NSIS_INSTALLED_ICON_NAME ${CMAKE_CURRENT_SOURCE_DIR}/icon.ico)
Expand Down
Loading
Loading