Skip to content

Commit dbbfcc2

Browse files
committed
Merge branch 'dev'
2 parents 33f76b1 + 15e6882 commit dbbfcc2

31 files changed

Lines changed: 1400 additions & 370 deletions

.github/workflows/build-release.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,54 +32,50 @@ jobs:
3232
go-version: 'stable'
3333
cache-dependency-path: src/backend/go.sum
3434

35-
- name: Get version from package.json
35+
- name: Update version from tag
3636
run: |
37-
VERSION=$(grep -Po '"version"\s*:\s*"\K[^"]+' package.json)
37+
TAG_NAME=${{ github.ref_name }}
38+
39+
if [[ $TAG_NAME == v* ]]; then
40+
VERSION=${TAG_NAME#v}
41+
echo "Updating package.json to version $VERSION"
42+
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
43+
else
44+
VERSION=$(grep -Po '"version"\s*:\s*"\K[^"]+' package.json)
45+
fi
46+
3847
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
3948
40-
- name: Cache Bun dependencies
41-
uses: actions/cache@v4
42-
with:
43-
path: ~/.bun/install/cache
44-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
45-
restore-keys: |
46-
bun-${{ runner.os }}-
47-
48-
- name: Cache Electron & electron-builder
49+
- name: Cache dependencies
4950
uses: actions/cache@v4
5051
with:
5152
path: |
53+
~/.bun/install/cache
5254
~/.cache/electron
5355
~/.cache/electron-builder
54-
key: electron-${{ runner.os }}-${{ hashFiles('package.json') }}
56+
key: ${{ runner.os }}-deps-${{ hashFiles('bun.lock', 'package.json') }}
5557
restore-keys: |
56-
electron-${{ runner.os }}-
57-
58-
- name: Cache APT packages
59-
uses: actions/cache@v4
60-
id: apt-cache
61-
with:
62-
path: /var/cache/apt/archives
63-
key: apt-release-${{ runner.os }}-rpm-libarchive-gtk3-appindicator
58+
${{ runner.os }}-deps-
6459
6560
- name: Install system dependencies (Linux)
6661
run: |
6762
sudo apt-get update
68-
sudo apt-get install -y rpm libarchive-tools libgtk-3-dev libayatana-appindicator3-dev
63+
sudo apt-get install -y --no-install-recommends \
64+
rpm libarchive-tools libgtk-3-dev libayatana-appindicator3-dev
65+
env:
66+
DEBIAN_FRONTEND: noninteractive
6967

7068
- name: Install dependencies
7169
run: bun install --frozen-lockfile
7270

7371
- name: Build App
7472
run: bun run build:all
7573
env:
76-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7775

7876
- name: Zip linux-unpacked
7977
run: |
80-
cd dist
81-
zip -r "linux-wallpaperengine-gui.zip" linux-unpacked
82-
cd ..
78+
zip -r "dist/linux-wallpaperengine-gui.zip" dist/linux-unpacked
8379
8480
- name: Upload Release Assets
8581
uses: softprops/action-gh-release@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</h1>
55

66
<p align="center">
7-
<strong>◈ A graphical user interface for managing wallpapers on Linux ◈</strong>
7+
<strong>◈ A graphical user interface for managing wallpapers for [linux-wallpaperengine](https://github.com/Almamu/linux-wallpaperengine) ◈</strong>
88
<br>
99
<strong>◈ Powered by Go (Backend) and Electron (Frontend) ◈</strong>
1010
</p>

src/backend/internal/core/wallpaper/data.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88
"strings"
9+
"syscall"
910

1011
"linux-wallpaperengine-gui/src/backend/internal/config"
1112
)
@@ -56,7 +57,11 @@ func GetWallpapers() (map[string]WallpaperData, error) {
5657

5758
var installDate int64
5859
if info, err := entry.Info(); err == nil {
59-
installDate = info.ModTime().Unix()
60+
if stat, ok := info.Sys().(*syscall.Stat_t); ok {
61+
installDate = stat.Ctim.Sec
62+
} else {
63+
installDate = info.ModTime().Unix()
64+
}
6065
}
6166

6267
wallpapers[folderName] = WallpaperData{

src/frontend/main/preload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
2828
selectDir: createInvokeMethod("select-dir"),
2929
selectFile: createInvokeMethod("select-file"),
3030
openExternal: createInvokeMethod("open-external"),
31+
getVersion: createInvokeMethod("get-version"),
3132
openPath: createInvokeMethod("open-path"),
3233

3334
// File system
@@ -80,7 +81,6 @@ contextBridge.exposeInMainWorld("electronAPI", {
8081
unsubscribeWorkshopItem: createInvokeMethod("unsubscribe-workshop-item"),
8182
getWorkshopItemDownloadInfo: createInvokeMethod("get-workshop-item-download-info"),
8283
getWorkshopItemInstallInfo: createInvokeMethod("get-workshop-item-install-info"),
83-
getAllWorkshopInstallInfo: createInvokeMethod("get-all-workshop-install-info"),
8484
isSteamRunning: createInvokeMethod("is-steam-running"),
8585
getAllDownloadingItems: createInvokeMethod("get-all-downloading-items"),
8686
getSubscribedItems: createInvokeMethod("get-subscribed-items"),

src/frontend/main/services/systemService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export function registerSystemService() {
1212
return app.getPath("home");
1313
});
1414

15+
ipcMain.handle("get-version", () => {
16+
logger.ipcReceived("get-version");
17+
return app.getVersion();
18+
});
19+
1520
ipcMain.handle("open-external", async (_, url: string) => {
1621
logger.ipcReceived("open-external", url);
1722
await shell.openExternal(url);

src/frontend/main/services/workshopService.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -364,24 +364,4 @@ export function registerWorkshopService() {
364364
return null;
365365
}
366366
});
367-
368-
ipcMain.handle("get-all-workshop-install-info", async () => {
369-
const client = getSteamworksClient();
370-
if (!client) return {};
371-
372-
try {
373-
const subscribedItems = client.workshop.getSubscribedItems();
374-
const result: Record<string, number> = {};
375-
for (const fileId of subscribedItems) {
376-
const info = client.workshop.installInfo(fileId);
377-
if (info) {
378-
result[fileId.toString()] = info.timestamp;
379-
}
380-
}
381-
return result;
382-
} catch (error) {
383-
logger.error("Error fetching all install info:", error);
384-
return {};
385-
}
386-
});
387367
}

src/frontend/svelte/App.svelte

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { onMount } from 'svelte';
88
import { backOut, cubicOut } from 'svelte/easing';
99
import { fly, fade } from 'svelte/transition';
10+
import { flip } from 'svelte/animate';
1011
import { initLogger } from '@/core/logger';
1112
import { loadSettings, settingsStore } from '@/features/settings/scripts/settings';
1213
import {
@@ -83,9 +84,18 @@
8384
</div>
8485
{/if}
8586

86-
{#if $toastStore}
87-
<Toast message={$toastStore.message} type={$toastStore.type} />
88-
{/if}
87+
<div class="toast-stack">
88+
{#each $toastStore as toast (toast.id)}
89+
<div animate:flip={{ duration: 300 }}>
90+
<Toast
91+
id={toast.id}
92+
message={toast.message}
93+
type={toast.type}
94+
duration={toast.duration}
95+
/>
96+
</div>
97+
{/each}
98+
</div>
8999

90100
<ContextMenu />
91101

@@ -104,4 +114,16 @@
104114
padding: 10px;
105115
position: relative;
106116
}
117+
118+
.toast-stack {
119+
position: fixed;
120+
bottom: 32px;
121+
right: 32px;
122+
z-index: 2000;
123+
display: flex;
124+
flex-direction: column-reverse;
125+
gap: 12px;
126+
pointer-events: none;
127+
align-items: flex-end;
128+
}
107129
</style>

src/frontend/svelte/core/i18n/locales/en/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"sectionInteraction": "Interaction",
77
"sectionAdvanced": "Advanced",
88
"sectionExecutable": "Executable",
9+
"sectionAbout": "About",
910
"openConfig": "Open Config",
1011
"loading": "Loading settings...",
1112
"general": {

src/frontend/svelte/core/i18n/locales/zh/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"sectionInteraction": "交互",
77
"sectionAdvanced": "高级",
88
"sectionExecutable": "可执行文件",
9+
"sectionAbout": "关于",
910
"openConfig": "打开配置文件",
1011
"loading": "正在加载设置...",
1112
"general": {

src/frontend/svelte/core/i18n/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type I18nKey =
1717
| 'settings.sectionInteraction'
1818
| 'settings.sectionAdvanced'
1919
| 'settings.sectionExecutable'
20+
| 'settings.sectionAbout'
2021
| 'settings.openConfig'
2122
| 'settings.loading'
2223
| 'settings.general.language'

0 commit comments

Comments
 (0)