瀏覽代碼

【修复】重构默认会话命令

- 将复杂的 bash 命令替换为单独的脚本文件
- 创建 pageos-session 脚本以简化会话启动过程
- 保持配置文件的清晰和简洁
PJ568 1 年之前
父節點
當前提交
197d40a823
共有 2 個文件被更改,包括 8 次插入 和 9 次删除
  1. 1 9
      airootfs/etc/greetd/config.toml
  2. 7 0
      airootfs/usr/local/bin/pageos-session

+ 1 - 9
airootfs/etc/greetd/config.toml

@@ -5,15 +5,7 @@ vt = 1
 
 
 # The default session, also known as the greeter.
 # The default session, also known as the greeter.
 [default_session]
 [default_session]
-command = '''
-bash -c "
-  mkdir -p /tmp/pageos-greet
-  export HOME=/tmp/pageos-greet
-  pageos-greet \\
-    --launch-command 'cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12801' \\
-    --session-command 'pageos-core --command \"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800/exec.html?id=pageos-ui\"'
-"
-'''
+command = "/usr/local/bin/pageos-session pageos-ui"
 
 
 # The user to run the command as. The privileges this user must have depends
 # The user to run the command as. The privileges this user must have depends
 # on the greeter. A graphical greeter may for example require the user to be
 # on the greeter. A graphical greeter may for example require the user to be

+ 7 - 0
airootfs/usr/local/bin/pageos-session

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+mkdir -p /tmp/pageos-greet
+export HOME=/tmp/pageos-greet
+pageos-greet \
+  --launch-command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12801" \
+  --session-command "pageos-core --command \"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800/exec.html?id=$1\""