miracle: adjust config, add xdg-autostart support, fix env variables
This commit is contained in:
parent
569b4cc84a
commit
2998131d57
5 changed files with 157 additions and 23 deletions
|
@ -9,12 +9,15 @@ sway)
|
|||
river)
|
||||
riverctl exit
|
||||
;;
|
||||
miracle)
|
||||
miracle-wm)
|
||||
miraclemsg exit
|
||||
;;
|
||||
mir)
|
||||
miraclemsg exit
|
||||
;;
|
||||
mir:miracle-wm)
|
||||
miraclemsg exit
|
||||
;;
|
||||
qtile)
|
||||
bash -c /usr/share/tileos/scripts/qtile-exit.sh
|
||||
;;
|
||||
|
|
|
@ -1,33 +1,23 @@
|
|||
terminal: alacritty
|
||||
|
||||
# Start waybar and Azote on startup
|
||||
# Autostart section
|
||||
startup_apps:
|
||||
- command: bash ~/.azotebg
|
||||
- command: /usr/bin/mate-polkit
|
||||
restart_on_death: true
|
||||
- command: bash -c ~/.azotebg
|
||||
restart_on_death: true
|
||||
- command: wl-paste --watch cliphist store &
|
||||
|
||||
environment_variables:
|
||||
- key: XDG_SESSION_TYPE
|
||||
value: wayland
|
||||
- key: XDG_CURRENT_DESKTOP
|
||||
value: mir
|
||||
- key: QT_QPA_PLATFORM
|
||||
value: wayland
|
||||
- key: QT_QPA_PLATFORMTHEME
|
||||
value: qt6ct
|
||||
- key: XCURSOR_SIZE
|
||||
value: 24
|
||||
- key: ECORE_EVAS_ENGINE
|
||||
value: wayland-egl
|
||||
- key: ELM_ACCEL
|
||||
value: gl
|
||||
- key: _JAVA_AWT_WM_NONREPARENTING
|
||||
value: 1
|
||||
- command: wl-paste --watch pkill -RTMIN+9 waybar &
|
||||
- command: nwg-drawer -r
|
||||
restart_on_death: true
|
||||
- command: pcmanfm-qt -d
|
||||
in_systemd_scope: true
|
||||
- command: playerctl -a metadata --format \'{{status}} {{title}}\' --follow | while read line; do pkill -RTMIN+5 waybar; done &
|
||||
|
||||
border:
|
||||
size: 2
|
||||
color: a5adcb
|
||||
focus_color: 8aadf4
|
||||
color: 0xa5adcb
|
||||
focus_color: 0x8aadf4
|
||||
|
||||
enable_animations: true
|
||||
|
||||
|
@ -70,3 +60,43 @@ workspaces:
|
|||
layout: tiled
|
||||
- number: 9
|
||||
layout: tiled
|
||||
|
||||
default_action_overrides:
|
||||
- name: toggle_floating
|
||||
action: down
|
||||
modifiers:
|
||||
- primary
|
||||
- shift
|
||||
key: KEY_SPACE
|
||||
|
||||
custom_actions:
|
||||
- command: wofi
|
||||
action: down
|
||||
modifiers:
|
||||
- primary
|
||||
key: KEY_D
|
||||
- command: nwg-bar
|
||||
action: down
|
||||
modifiers:
|
||||
- primary
|
||||
- shift
|
||||
key: KEY_E
|
||||
- command: /usr/share/tileos/scripts/brightness.sh up
|
||||
action: down
|
||||
key: KEY_BRIGHTNESSUP
|
||||
- command: /usr/share/tileos/scripts/brightness.sh down
|
||||
key: KEY_BRIGHTNESSDOWN
|
||||
- command: /usr/share/tileos/scripts/mic-mute.sh
|
||||
key: KEY_MICMUTE
|
||||
- command: playerctl play-pause
|
||||
key: KEY_PLAYPAUSE
|
||||
- command: playerctl next
|
||||
key: KEY_NEXTSONG
|
||||
- command: playerctl previous
|
||||
key: KEY_PREVIOUSSONG
|
||||
- command: pulsemixer --change-volume +5
|
||||
key: KEY_VOLUMEUP
|
||||
- command: pulsemixer --change-volume -5
|
||||
key: KEY_VOLUMEDOWN
|
||||
- command: pulsemixer --toggle-mute
|
||||
key: KEY_MUTE
|
||||
|
|
30
miracle-wm/usr/bin/start-miracle-wm
Executable file
30
miracle-wm/usr/bin/start-miracle-wm
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
## General exports
|
||||
export XDG_CURRENT_DESKTOP=mir:miracle-wm
|
||||
export XDG_SESSION_DESKTOP=mir:miracle-wm
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
|
||||
## Load system environment customizations
|
||||
if [ -d /etc/environment.d ]; then
|
||||
set -o allexport
|
||||
for f in /etc/environment.d/*.conf; do
|
||||
# shellcheck source=/dev/null
|
||||
. "$f"
|
||||
done
|
||||
set +o allexport
|
||||
fi
|
||||
|
||||
## Load user environment customizations
|
||||
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d" ]; then
|
||||
set -o allexport
|
||||
for i in "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d"/*.conf; do
|
||||
# shellcheck source=/dev/null
|
||||
. "$i"
|
||||
done
|
||||
set +o allexport
|
||||
fi
|
||||
|
||||
systemd-cat --identifier=miracle-wm /usr/bin/miracle-wm \
|
||||
--systemd-session-configure=/usr/libexec/miracle-wm-session-setup \
|
||||
--display-config=static=$(systemd-path user-configuration)/miracle-wm-display.yaml
|
|
@ -0,0 +1,10 @@
|
|||
# Systemd provides xdg-desktop-autostart.target as a way to process XDG autostart
|
||||
# desktop files. The target sets RefuseManualStart though, and thus cannot be
|
||||
# used from scripts.
|
||||
#
|
||||
[Unit]
|
||||
Description=XDG autostart for MiracleWM session
|
||||
Documentation=man:systemd.special(7) man:systemd-xdg-autostart-generator(8)
|
||||
BindsTo=xdg-desktop-autostart.target
|
||||
PartOf=miracle-wm-session.target
|
||||
After=miracle-wm-session.target
|
61
miracle-wm/usr/share/tileos/scripts/wait-sni-ready
Executable file
61
miracle-wm/usr/share/tileos/scripts/wait-sni-ready
Executable file
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/python3
|
||||
"""
|
||||
A simple script for waiting until an org.kde.StatusNotifierItem host implementation
|
||||
is available and ready.
|
||||
|
||||
Dependencies: dbus-next, tenacity
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
|
||||
from dbus_next.aio import MessageBus
|
||||
from tenacity import retry, stop_after_delay, wait_fixed
|
||||
|
||||
LOG = logging.getLogger("wait-sni-host")
|
||||
TIMEOUT = int(os.environ.get("SNI_WAIT_TIMEOUT", default=25))
|
||||
|
||||
|
||||
@retry(reraise=True, stop=stop_after_delay(TIMEOUT), wait=wait_fixed(0.5))
|
||||
async def get_service(bus, name, object_path, interface_name):
|
||||
"""Wait until the service appears on the bus"""
|
||||
introspection = await bus.introspect(name, object_path)
|
||||
proxy = bus.get_proxy_object(name, object_path, introspection)
|
||||
return proxy.get_interface(interface_name)
|
||||
|
||||
|
||||
async def wait_sni_host(bus: MessageBus):
|
||||
"""Wait until a StatusNotifierWatcher service is available and has a
|
||||
StatusNotifierHost instance"""
|
||||
future = asyncio.get_event_loop().create_future()
|
||||
|
||||
async def on_host_registered():
|
||||
value = await sni_watcher.get_is_status_notifier_host_registered()
|
||||
LOG.debug("StatusNotifierHostRegistered: %s", value)
|
||||
if value:
|
||||
future.set_result(value)
|
||||
|
||||
sni_watcher = await get_service(bus, "org.kde.StatusNotifierWatcher",
|
||||
"/StatusNotifierWatcher",
|
||||
"org.kde.StatusNotifierWatcher")
|
||||
sni_watcher.on_status_notifier_host_registered(on_host_registered)
|
||||
# fetch initial value
|
||||
await on_host_registered()
|
||||
return await asyncio.wait_for(future, timeout=TIMEOUT)
|
||||
|
||||
|
||||
async def main():
|
||||
"""asyncio entrypoint"""
|
||||
bus = await MessageBus().connect()
|
||||
try:
|
||||
await wait_sni_host(bus)
|
||||
LOG.info("Successfully waited for org.kde.StatusNotifierHost")
|
||||
# pylint: disable=broad-except
|
||||
except Exception as err:
|
||||
LOG.error("Failed to wait for org.kde.StatusNotifierHost: %s",
|
||||
str(err))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
asyncio.run(main())
|
Loading…
Add table
Reference in a new issue