mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
launcher: add sort by alphabetically option
sounds: convert files to wav
This commit is contained in:
@@ -97,6 +97,7 @@ Singleton {
|
|||||||
property alias dankBarRightWidgetsModel: rightWidgetsModel
|
property alias dankBarRightWidgetsModel: rightWidgetsModel
|
||||||
property string appLauncherViewMode: "list"
|
property string appLauncherViewMode: "list"
|
||||||
property string spotlightModalViewMode: "list"
|
property string spotlightModalViewMode: "list"
|
||||||
|
property bool sortAppsAlphabetically: false
|
||||||
property string networkPreference: "auto"
|
property string networkPreference: "auto"
|
||||||
property string iconTheme: "System Default"
|
property string iconTheme: "System Default"
|
||||||
property var availableIconThemes: ["System Default"]
|
property var availableIconThemes: ["System Default"]
|
||||||
@@ -376,6 +377,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list"
|
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list"
|
||||||
spotlightModalViewMode = settings.spotlightModalViewMode !== undefined ? settings.spotlightModalViewMode : "list"
|
spotlightModalViewMode = settings.spotlightModalViewMode !== undefined ? settings.spotlightModalViewMode : "list"
|
||||||
|
sortAppsAlphabetically = settings.sortAppsAlphabetically !== undefined ? settings.sortAppsAlphabetically : false
|
||||||
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto"
|
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto"
|
||||||
iconTheme = settings.iconTheme !== undefined ? settings.iconTheme : "System Default"
|
iconTheme = settings.iconTheme !== undefined ? settings.iconTheme : "System Default"
|
||||||
if (settings.useOSLogo !== undefined) {
|
if (settings.useOSLogo !== undefined) {
|
||||||
@@ -529,6 +531,7 @@ Singleton {
|
|||||||
"dankBarRightWidgets": dankBarRightWidgets,
|
"dankBarRightWidgets": dankBarRightWidgets,
|
||||||
"appLauncherViewMode": appLauncherViewMode,
|
"appLauncherViewMode": appLauncherViewMode,
|
||||||
"spotlightModalViewMode": spotlightModalViewMode,
|
"spotlightModalViewMode": spotlightModalViewMode,
|
||||||
|
"sortAppsAlphabetically": sortAppsAlphabetically,
|
||||||
"networkPreference": networkPreference,
|
"networkPreference": networkPreference,
|
||||||
"iconTheme": iconTheme,
|
"iconTheme": iconTheme,
|
||||||
"launcherLogoMode": launcherLogoMode,
|
"launcherLogoMode": launcherLogoMode,
|
||||||
@@ -1009,6 +1012,11 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setSortAppsAlphabetically(enabled) {
|
||||||
|
sortAppsAlphabetically = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
// Weather location setter
|
// Weather location setter
|
||||||
function setWeatherLocation(displayName, coordinates) {
|
function setWeatherLocation(displayName, coordinates) {
|
||||||
weatherLocation = displayName
|
weatherLocation = displayName
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ Item {
|
|||||||
function onPluginListUpdated() { updateCategories() }
|
function onPluginListUpdated() { updateCategories() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onSortAppsAlphabeticallyChanged() {
|
||||||
|
updateFilteredModel()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function updateFilteredModel() {
|
function updateFilteredModel() {
|
||||||
@@ -123,16 +130,22 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (searchQuery.length === 0) {
|
if (searchQuery.length === 0) {
|
||||||
apps = apps.sort((a, b) => {
|
if (SettingsData.sortAppsAlphabetically) {
|
||||||
const aId = a.id || a.execString || a.exec || ""
|
apps = apps.sort((a, b) => {
|
||||||
const bId = b.id || b.execString || b.exec || ""
|
return (a.name || "").localeCompare(b.name || "")
|
||||||
const aUsage = appUsageRanking[aId] ? appUsageRanking[aId].usageCount : 0
|
})
|
||||||
const bUsage = appUsageRanking[bId] ? appUsageRanking[bId].usageCount : 0
|
} else {
|
||||||
if (aUsage !== bUsage) {
|
apps = apps.sort((a, b) => {
|
||||||
return bUsage - aUsage
|
const aId = a.id || a.execString || a.exec || ""
|
||||||
}
|
const bId = b.id || b.execString || b.exec || ""
|
||||||
return (a.name || "").localeCompare(b.name || "")
|
const aUsage = appUsageRanking[aId] ? appUsageRanking[aId].usageCount : 0
|
||||||
})
|
const bUsage = appUsageRanking[bId] ? appUsageRanking[bId].usageCount : 0
|
||||||
|
if (aUsage !== bUsage) {
|
||||||
|
return bUsage - aUsage
|
||||||
|
}
|
||||||
|
return (a.name || "").localeCompare(b.name || "")
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const seenNames = new Set()
|
const seenNames = new Set()
|
||||||
|
|||||||
@@ -457,6 +457,71 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StyledRect {
|
||||||
|
width: parent.width
|
||||||
|
height: sortingSection.implicitHeight + Theme.spacingL * 2
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: Theme.surfaceContainerHigh
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||||
|
Theme.outline.b, 0.2)
|
||||||
|
border.width: 0
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: sortingSection
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Theme.spacingL
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "sort_by_alpha"
|
||||||
|
size: Theme.iconSize
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Sort Alphabetically")
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width - parent.children[0].width
|
||||||
|
- parent.children[1].width
|
||||||
|
- sortToggle.width - Theme.spacingM * 3
|
||||||
|
height: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
DankToggle {
|
||||||
|
id: sortToggle
|
||||||
|
|
||||||
|
width: 32
|
||||||
|
height: 18
|
||||||
|
checked: SettingsData.sortAppsAlphabetically
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onToggled: checked => {
|
||||||
|
SettingsData.setSortAppsAlphabetically(checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
width: parent.width
|
||||||
|
text: I18n.tr("When enabled, apps are sorted alphabetically. When disabled, apps are sorted by usage frequency.")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
|
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ Singleton {
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.oga")
|
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.wav")
|
||||||
audioOutput: AudioOutput { volume: 1.0 }
|
audioOutput: AudioOutput { volume: 1.0 }
|
||||||
}
|
}
|
||||||
`, root, "AudioService.VolumeChangeSound")
|
`, root, "AudioService.VolumeChangeSound")
|
||||||
@@ -70,7 +70,7 @@ Singleton {
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-plug.ogg")
|
source: Qt.resolvedUrl("../assets/sounds/plasma/power-plug.wav")
|
||||||
audioOutput: AudioOutput { volume: 1.0 }
|
audioOutput: AudioOutput { volume: 1.0 }
|
||||||
}
|
}
|
||||||
`, root, "AudioService.PowerPlugSound")
|
`, root, "AudioService.PowerPlugSound")
|
||||||
@@ -79,7 +79,7 @@ Singleton {
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-unplug.ogg")
|
source: Qt.resolvedUrl("../assets/sounds/plasma/power-unplug.wav")
|
||||||
audioOutput: AudioOutput { volume: 1.0 }
|
audioOutput: AudioOutput { volume: 1.0 }
|
||||||
}
|
}
|
||||||
`, root, "AudioService.PowerUnplugSound")
|
`, root, "AudioService.PowerUnplugSound")
|
||||||
@@ -88,7 +88,7 @@ Singleton {
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message.oga")
|
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message.wav")
|
||||||
audioOutput: AudioOutput { volume: 1.0 }
|
audioOutput: AudioOutput { volume: 1.0 }
|
||||||
}
|
}
|
||||||
`, root, "AudioService.NormalNotificationSound")
|
`, root, "AudioService.NormalNotificationSound")
|
||||||
@@ -97,7 +97,7 @@ Singleton {
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtMultimedia
|
import QtMultimedia
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message-new-instant.oga")
|
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message-new-instant.wav")
|
||||||
audioOutput: AudioOutput { volume: 1.0 }
|
audioOutput: AudioOutput { volume: 1.0 }
|
||||||
}
|
}
|
||||||
`, root, "AudioService.CriticalNotificationSound")
|
`, root, "AudioService.CriticalNotificationSound")
|
||||||
|
|||||||
BIN
assets/sounds/freedesktop/audio-volume-change.wav
Normal file
BIN
assets/sounds/freedesktop/audio-volume-change.wav
Normal file
Binary file not shown.
BIN
assets/sounds/freedesktop/message-new-instant.wav
Normal file
BIN
assets/sounds/freedesktop/message-new-instant.wav
Normal file
Binary file not shown.
BIN
assets/sounds/freedesktop/message.wav
Normal file
BIN
assets/sounds/freedesktop/message.wav
Normal file
Binary file not shown.
BIN
assets/sounds/plasma/power-plug.wav
Normal file
BIN
assets/sounds/plasma/power-plug.wav
Normal file
Binary file not shown.
BIN
assets/sounds/plasma/power-unplug.wav
Normal file
BIN
assets/sounds/plasma/power-unplug.wav
Normal file
Binary file not shown.
21
assets/sounds/wavconvert.sh
Executable file
21
assets/sounds/wavconvert.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Convert freedesktop sounds
|
||||||
|
cd freedesktop
|
||||||
|
for file in *.oga; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
echo "Converting $file to WAV..."
|
||||||
|
ffmpeg -i "$file" -acodec pcm_s16le -ar 44100 -ac 2 "${file%.oga}.wav"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Convert plasma sounds
|
||||||
|
cd ../plasma
|
||||||
|
for file in *.ogg; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
echo "Converting $file to WAV..."
|
||||||
|
ffmpeg -i "$file" -acodec pcm_s16le -ar 44100 -ac 2 "${file%.ogg}.wav"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Conversion complete!"
|
||||||
Reference in New Issue
Block a user