niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching0 forksRustGPL-3.012.1 MiB9d8f4f8Ivan Molodetskikh1 month ago2997 commits
| 1 | #!/bin/sh |
| 2 | |
| 3 | # Detect if being run as a user service, which implies external session management, |
| 4 | # exec compositor directly |
| 5 | if [ && [; then |
| 6 | case "" in |
| 7 | *systemd*--user*) |
| 8 | |
| 9 | ;; |
| 10 | esac |
| 11 | fi |
| 12 | |
| 13 | if [ && |
| 14 | && |
| 15 | | && |
| 16 | | ; then |
| 17 | if [; then |
| 18 | |
| 19 | else |
| 20 | |
| 21 | fi |
| 22 | fi |
| 23 | |
| 24 | # Try to detect the service manager that is being used |
| 25 | if ; then |
| 26 | # Make sure there's no already running session. |
| 27 | if ; then |
| 28 | |
| 29 | |
| 30 | fi |
| 31 | |
| 32 | # Reset failed state of all user units. |
| 33 | |
| 34 | |
| 35 | # Import the login manager environment. |
| 36 | # |
| 37 | # We intentionally import *all* environment variables. |
| 38 | # It's unfortunately commonplace for distros to initialize |
| 39 | # things with shell scripts and set environment variables. |
| 40 | # |
| 41 | # For example, debuginfod is initialized this way, and sets the |
| 42 | # $DEBUGINFOD_URLS environment variable. If we don't export it, |
| 43 | # then programs started from a systemd service (e.g. from xdg-autostart) |
| 44 | # will be unable to use debuginfod. |
| 45 | # |
| 46 | # We cannot possibly know and list all variables like this, so |
| 47 | # we import all of them into the environment. This also covers |
| 48 | # any variables the user may have customized, such as $PATH. |
| 49 | if ; then |
| 50 | # The `--systemd` flag also sets the variables for systemd user services, |
| 51 | # so we don't need a separate `systemctl --user import-environment` call. |
| 52 | # |
| 53 | # (This also avoids the deprecation warning printed by |
| 54 | # a blanket `systemctl --user import-environment` that |
| 55 | # some people find very annoying.) |
| 56 | |
| 57 | else |
| 58 | |
| 59 | fi |
| 60 | |
| 61 | # Start niri and wait for it to terminate. |
| 62 | |
| 63 | |
| 64 | # Force stop of graphical-session.target. |
| 65 | |
| 66 | |
| 67 | # Unset environment that we've set. |
| 68 | |
| 69 | elif ; then |
| 70 | # Check that the user dinit daemon is running |
| 71 | if ! ; then |
| 72 | |
| 73 | |
| 74 | fi |
| 75 | |
| 76 | # Make sure there's no already running session. |
| 77 | if ; then |
| 78 | |
| 79 | |
| 80 | fi |
| 81 | |
| 82 | # Import the login manager environment into dinit |
| 83 | # Might not work correctly for multiline variable names, but |
| 84 | # it is reasonable to assume there are none |
| 85 | | |
| 86 | |
| 87 | # Usually the dbus service would start as niri's dependency and inherit |
| 88 | # environment from dinit, but in case it has already started we need |
| 89 | # to update its environment. |
| 90 | if ; then |
| 91 | |
| 92 | fi |
| 93 | |
| 94 | # Create the directory for the logfile, if doesn't exist |
| 95 | |
| 96 | # Start niri |
| 97 | |
| 98 | |
| 99 | # Wait for termination |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | # Unset environment that we've set. |
| 107 | |
| 108 | else |
| 109 | |
| 110 | fi |