mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Use launcher hides list
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -1,2 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
@@ -9,7 +9,6 @@ gtk-update-icon-cache ~/.local/share/icons/hicolor &>/dev/null
|
||||
# Copy .desktop declarations
|
||||
mkdir -p ~/.local/share/applications
|
||||
cp ~/.local/share/omarchy/applications/*.desktop ~/.local/share/applications/
|
||||
cp ~/.local/share/omarchy/applications/hidden/*.desktop ~/.local/share/applications/
|
||||
|
||||
if omarchy-cmd-present alacritty; then
|
||||
cp ~/.local/share/omarchy/default/alacritty/alacritty.desktop ~/.local/share/applications/
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
avahi-discover
|
||||
bssh
|
||||
btop
|
||||
bvnc
|
||||
cmake-gui
|
||||
cups
|
||||
dropbox
|
||||
electron34
|
||||
electron36
|
||||
electron37
|
||||
fcitx5-configtool
|
||||
fcitx5-wayland-launcher
|
||||
foot-server
|
||||
footclient
|
||||
java-java-openjdk
|
||||
jconsole-java-openjdk
|
||||
jshell-java-openjdk
|
||||
kbd-layout-viewer5
|
||||
kcm_fcitx5
|
||||
kcm_kaccounts
|
||||
kvantummanager
|
||||
libreoffice-base
|
||||
libreoffice-draw
|
||||
libreoffice-math
|
||||
libreoffice-startcenter
|
||||
libreoffice-xsltfilter
|
||||
limine-snapper-restore
|
||||
lstopo
|
||||
org.fcitx.Fcitx5
|
||||
org.fcitx.fcitx5-config-qt
|
||||
org.fcitx.fcitx5-migrator
|
||||
org.fcitx.fcitx5-qt5-gui-wrapper
|
||||
org.fcitx.fcitx5-qt6-gui-wrapper
|
||||
qv4l2
|
||||
qvidcap
|
||||
uuctl
|
||||
xgps
|
||||
xgpsspeed
|
||||
@@ -1,3 +0,0 @@
|
||||
echo "Adding hidden entries for electron apps"
|
||||
|
||||
cp $OMARCHY_PATH/applications/hidden/electron*.desktop ~/.local/share/applications/
|
||||
@@ -1,4 +0,0 @@
|
||||
echo "Hide OpenJDK applications from app launcher"
|
||||
|
||||
cp $OMARCHY_PATH/applications/hidden/*openjdk.desktop ~/.local/share/applications/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
echo "Hide limine-snapper-restore from app launcher"
|
||||
|
||||
mkdir -p ~/.local/share/applications
|
||||
cp "$OMARCHY_PATH/applications/hidden/limine-snapper-restore.desktop" ~/.local/share/applications/
|
||||
@@ -0,0 +1,75 @@
|
||||
echo "Move launcher hides from hidden desktop overrides to launcher.hides"
|
||||
|
||||
remove_legacy_hidden_override() {
|
||||
local file=$1
|
||||
local line
|
||||
local found_section=false
|
||||
local found_hidden=false
|
||||
|
||||
[[ -f $file ]] || return
|
||||
|
||||
while IFS= read -r line || [[ -n $line ]]; do
|
||||
line=${line%$'\r'}
|
||||
[[ -z $line ]] && continue
|
||||
|
||||
case $line in
|
||||
"[Desktop Entry]")
|
||||
found_section=true
|
||||
;;
|
||||
"Hidden=true")
|
||||
found_hidden=true
|
||||
;;
|
||||
*)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
done < "$file"
|
||||
|
||||
if [[ $found_section == "true" && $found_hidden == "true" ]]; then
|
||||
rm -f "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
for app in \
|
||||
avahi-discover \
|
||||
bssh \
|
||||
btop \
|
||||
bvnc \
|
||||
cmake-gui \
|
||||
cups \
|
||||
dropbox \
|
||||
electron34 \
|
||||
electron36 \
|
||||
electron37 \
|
||||
fcitx5-configtool \
|
||||
fcitx5-wayland-launcher \
|
||||
foot-server \
|
||||
footclient \
|
||||
java-java-openjdk \
|
||||
jconsole-java-openjdk \
|
||||
jshell-java-openjdk \
|
||||
kbd-layout-viewer5 \
|
||||
kcm_fcitx5 \
|
||||
kcm_kaccounts \
|
||||
kvantummanager \
|
||||
libreoffice-base \
|
||||
libreoffice-draw \
|
||||
libreoffice-math \
|
||||
libreoffice-startcenter \
|
||||
libreoffice-xsltfilter \
|
||||
limine-snapper-restore \
|
||||
lstopo \
|
||||
org.fcitx.Fcitx5 \
|
||||
org.fcitx.fcitx5-config-qt \
|
||||
org.fcitx.fcitx5-migrator \
|
||||
org.fcitx.fcitx5-qt5-gui-wrapper \
|
||||
org.fcitx.fcitx5-qt6-gui-wrapper \
|
||||
qv4l2 \
|
||||
qvidcap \
|
||||
uuctl \
|
||||
xgps \
|
||||
xgpsspeed; do
|
||||
remove_legacy_hidden_override "$HOME/.local/share/applications/$app.desktop"
|
||||
done
|
||||
|
||||
update-desktop-database "$HOME/.local/share/applications" &>/dev/null || true
|
||||
@@ -24,7 +24,8 @@ Item {
|
||||
property var launchActiveToplevel: null
|
||||
property bool launchOsdOpen: false
|
||||
property string launchOsdMessage: ""
|
||||
property var hiddenEntryIds: ({})
|
||||
property var configuredHiddenEntryIds: ({})
|
||||
property var desktopHiddenEntryIds: ({})
|
||||
|
||||
// Bound to the central [launcher] section in shell.toml via Color.qml.
|
||||
// Each color already includes its alpha companion (composed in the
|
||||
@@ -111,17 +112,34 @@ Item {
|
||||
|
||||
function isHiddenEntry(entry) {
|
||||
var id = String((entry && entry.id) || "")
|
||||
return root.hiddenEntryIds[id] === true
|
||||
return root.configuredHiddenEntryIds[id] === true || root.desktopHiddenEntryIds[id] === true
|
||||
}
|
||||
|
||||
function loadHiddenEntries(rawText) {
|
||||
function normalizeDesktopId(id) {
|
||||
var value = String(id || "").trim()
|
||||
if (value.slice(-8) === ".desktop") value = value.slice(0, -8)
|
||||
return value
|
||||
}
|
||||
|
||||
function loadConfiguredHides(rawText) {
|
||||
var next = ({})
|
||||
var lines = String(rawText || "").split(/\n/)
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var id = lines[i].trim()
|
||||
var id = root.normalizeDesktopId(lines[i])
|
||||
if (id.length > 0) next[id] = true
|
||||
}
|
||||
root.hiddenEntryIds = next
|
||||
root.configuredHiddenEntryIds = next
|
||||
if (root.opened) root.rebuildDisplay()
|
||||
}
|
||||
|
||||
function loadDesktopHiddenEntries(rawText) {
|
||||
var next = ({})
|
||||
var lines = String(rawText || "").split(/\n/)
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var id = root.normalizeDesktopId(lines[i])
|
||||
if (id.length > 0) next[id] = true
|
||||
}
|
||||
root.desktopHiddenEntryIds = next
|
||||
if (root.opened) root.rebuildDisplay()
|
||||
}
|
||||
|
||||
@@ -269,7 +287,7 @@ Item {
|
||||
command: ["bash", "-lc", root.hiddenEntryScanCommand()]
|
||||
stdout: SplitParser { onRead: function(line) { hiddenEntryOutput.text += line + "\n" } }
|
||||
onStarted: hiddenEntryOutput.text = ""
|
||||
onExited: root.loadHiddenEntries(hiddenEntryOutput.text)
|
||||
onExited: root.loadDesktopHiddenEntries(hiddenEntryOutput.text)
|
||||
}
|
||||
|
||||
QtObject {
|
||||
@@ -277,6 +295,16 @@ Item {
|
||||
property string text: ""
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: launcherHidesFile
|
||||
path: root.omarchyPath + "/default/omarchy/launcher.hides"
|
||||
watchChanges: true
|
||||
printErrors: false
|
||||
onLoaded: root.loadConfiguredHides(text())
|
||||
onFileChanged: root.loadConfiguredHides(text())
|
||||
onLoadFailed: root.loadConfiguredHides("")
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ToplevelManager.toplevels
|
||||
function onValuesChanged() { root.maybeFinishLaunchFeedback() }
|
||||
|
||||
Reference in New Issue
Block a user