Run rclone
user config script in Plasma
This commit is contained in:
parent
ea533b20a5
commit
00076e2abb
2 changed files with 51 additions and 6 deletions
|
@ -1,16 +1,20 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/rclone/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
source "$dir/../../../Common/Software/rclone/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
rclone
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/rclone/main.fish" configure
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base -a name
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -14,9 +14,32 @@ begin
|
|||
|
||||
if [ (echo "$configs" | jq "length") -gt 0 ]
|
||||
if [ "$XDG_SESSION_TYPE" = "tty" ]
|
||||
set -l sessionPid
|
||||
set -l freeTty
|
||||
set -l service
|
||||
set -l sessionConfig
|
||||
set -l welcomeConfig ~"$name"/.config/plasma-welcomerc
|
||||
set -l entryPoint ~"$name"/.config/autostart/PortValhallaProfile.desktop
|
||||
sudo -u "$name" mkdir -p "$(dirname "$entryPoint")"
|
||||
|
||||
begin
|
||||
set -l file (sudo mktemp)
|
||||
sudo openvt -sw -- bash -c "tty > $(string escape $file)"
|
||||
set freeTty (basename (sudo cat $file))
|
||||
sudo rm $file
|
||||
end
|
||||
|
||||
set service "getty@$freeTty"
|
||||
set sessionConfig "/etc/systemd/system/$service.service.d/autologin.conf"
|
||||
sudo mkdir -p (dirname $sessionConfig)
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"[General]" \
|
||||
"LastSeenVersion=1.0.0" \
|
||||
"ShowUpdatePage=false"
|
||||
end | sudo -u "$name" tee "$welcomeConfig" > /dev/null
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"#!/user/bin/env xdg-open" \
|
||||
|
@ -32,9 +55,27 @@ begin
|
|||
end | sudo -u "$name" tee "$entryPoint" > /dev/null
|
||||
|
||||
sudo chmod +x "$entryPoint"
|
||||
sudo -Eu "$name" dbus-launch --exit-with-session startplasma-wayland &> /dev/null
|
||||
rm "$entryPoint"
|
||||
rm ~"$name"/.config/plasma-welcomerc
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"[Service]" \
|
||||
"ExecStart=" \
|
||||
"ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin $name %I \$TERM"
|
||||
end | sudo tee "$sessionConfig" > /dev/null
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart $service
|
||||
|
||||
while [ -z "$sessionPid" ]
|
||||
set sessionPid (sudo pgrep -t $freeTty -u "$name")
|
||||
end
|
||||
|
||||
sudo openvt -sw -- sudo -u "$name" env (sudo cat /proc/$sessionPid/environ | string split0) /usr/lib/plasma-dbus-run-session-if-needed startplasma-wayland
|
||||
sudo rm "$entryPoint"
|
||||
sudo rm "$welcomeConfig"
|
||||
sudo rm "$sessionConfig"
|
||||
sudo rmdir (dirname "$sessionConfig")
|
||||
sudo systemctl daemon-reload
|
||||
else if [ -n "$name" ] && [ "$name" != "$USER" ]
|
||||
sudo -Eu "$name" CONFIG_NAME="$CONFIG_NAME" fish "$(status filename)" userConfig
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue