-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(icons): improve icon quality and extration of files
- Loading branch information
Showing
28 changed files
with
540 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/apps/seelen_rofi/reducer.ts → ...s/seelen_rofi/modules/shared/store/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IRootState } from 'src/shared.interfaces'; | ||
|
||
export interface LauncherState extends IRootState<{}> { | ||
apps: any[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
import { SavedPinnedApp } from '../../../../shared/schemas/SeelenWegItems'; | ||
import { convertFileSrc, invoke } from '@tauri-apps/api/core'; | ||
|
||
import { getImageBase64FromUrl, LAZY_CONSTANTS } from '../../shared/utils/infra'; | ||
|
||
import { SpecialItemType, SwPinnedApp } from '../../shared/store/domain'; | ||
|
||
export class SwPinnedAppUtils { | ||
static async fromSaved(item: SavedPinnedApp): Promise<SwPinnedApp> { | ||
let icon = ''; | ||
let icon_path = await invoke<string | null>('get_icon', { path: item.exe }) || LAZY_CONSTANTS.MISSING_ICON_PATH; | ||
|
||
try { | ||
icon = await getImageBase64FromUrl(convertFileSrc(icon_path)); | ||
} catch { | ||
icon = convertFileSrc(icon_path); | ||
} | ||
|
||
return { | ||
type: SpecialItemType.PinnedApp, | ||
icon, | ||
exe: item.exe, | ||
execution_path: item.execution_path, | ||
title: '', | ||
opens: [], | ||
}; | ||
} | ||
} | ||
import { SavedPinnedApp } from '../../../../shared/schemas/SeelenWegItems'; | ||
import { convertFileSrc, invoke } from '@tauri-apps/api/core'; | ||
|
||
import { LAZY_CONSTANTS } from '../../shared/utils/infra'; | ||
|
||
import { SpecialItemType, SwPinnedApp } from '../../shared/store/domain'; | ||
|
||
export class SwPinnedAppUtils { | ||
static async fromSaved(item: SavedPinnedApp): Promise<SwPinnedApp> { | ||
let icon_path = | ||
(await invoke<string | null>('get_icon', { path: item.exe })) || | ||
LAZY_CONSTANTS.MISSING_ICON_PATH; | ||
|
||
return { | ||
type: SpecialItemType.PinnedApp, | ||
icon: convertFileSrc(icon_path), | ||
exe: item.exe, | ||
execution_path: item.execution_path, | ||
title: '', | ||
opens: [], | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
import { convertFileSrc } from '@tauri-apps/api/core'; | ||
|
||
import { fs } from '../../../../settings/modules/shared/tauri/infra'; | ||
import { getImageBase64FromUrl, LAZY_CONSTANTS } from '../../shared/utils/infra'; | ||
|
||
import { AppFromBackground, SpecialItemType, SwTemporalApp } from '../../shared/store/domain'; | ||
|
||
export class SwTemporalAppUtils { | ||
static async clean(item: AppFromBackground): Promise<AppFromBackground> { | ||
if (!(await fs.exists(item.icon_path))) { | ||
item.icon_path = LAZY_CONSTANTS.MISSING_ICON_PATH; | ||
} | ||
|
||
try { | ||
item.icon = await getImageBase64FromUrl(convertFileSrc(item.icon_path)); | ||
} catch { | ||
item.icon = convertFileSrc(item.icon_path); | ||
} | ||
return item; | ||
} | ||
|
||
static fromBackground(item: AppFromBackground): SwTemporalApp { | ||
return { | ||
type: SpecialItemType.TemporalApp, | ||
icon: item.icon || '', | ||
exe: item.exe, | ||
execution_path: item.execution_path, | ||
title: item.exe.split('\\').at(-1) || 'Unknown', | ||
opens: [item.hwnd], | ||
}; | ||
} | ||
} | ||
import { convertFileSrc } from '@tauri-apps/api/core'; | ||
|
||
import { fs } from '../../../../settings/modules/shared/tauri/infra'; | ||
import { LAZY_CONSTANTS } from '../../shared/utils/infra'; | ||
|
||
import { AppFromBackground, SpecialItemType, SwTemporalApp } from '../../shared/store/domain'; | ||
|
||
export class SwTemporalAppUtils { | ||
static async clean(item: AppFromBackground): Promise<AppFromBackground> { | ||
if (!(await fs.exists(item.icon_path))) { | ||
item.icon_path = LAZY_CONSTANTS.MISSING_ICON_PATH; | ||
} | ||
item.icon = convertFileSrc(item.icon_path); | ||
return item; | ||
} | ||
|
||
static fromBackground(item: AppFromBackground): SwTemporalApp { | ||
return { | ||
type: SpecialItemType.TemporalApp, | ||
icon: item.icon || '', | ||
exe: item.exe, | ||
execution_path: item.execution_path, | ||
title: item.exe.split('\\').at(-1) || 'Unknown', | ||
opens: [item.hwnd], | ||
}; | ||
} | ||
} |
Oops, something went wrong.