lemurs/install.sh
Gijs Burghoorn bd2d82755b
Next version (#76)
* Caching Post-Login Environment (#75)

* Add a configuration option for focus behaviour (#74)

* Add a configuration option for focus behaviour

* Rust fmt

* Add caching for post login environment

* Fmt

* Clippy

* Fix the status message (#77)

* Fix status message
* Handle render unwraps
* Add comment
* FMT and Clippy

* Switch arg parsing to clap-derive (#78)

* Switch arg parsing to clap-derive
* RustFmt

Co-authored-by: Gijs Burghoorn <g.burghoorn@gmail.com>

* Make nightly the default toolchain

* Enable building with stable toolchain (#79)

* Adjust code so that it builds with stable Rust
* Move unsafety to only wrap the 'pre_exec'
* Fix PERMERR by reordering to set{groups, gid, uid}
* Remove +nightly from install script

Co-authored-by: Gijs Burghoorn <g.burghoorn@gmail.com>

* Add command to show possible environments

* Exclude non-executable environments

* Add subcommand to view cached information

* Add --tty CLI flag to override TTY configuration (#81)

* Add TTY Shell environment (#82)

Add TTY shell environment

* Always display TTYSHELL if no wms are found (#83)

* Add AUR installation instructions (#87)

* File overview in README (#88)

Add file overview in README

* [FIX]: Show TTY Shell on dir misconfiguration (#89)

* Wayland support (#84)

* Get started on wayland support

* Add AUR installation instructions (#87)

* File overview in README (#88)

Add file overview in README

* Working Wayland

* Improve the README to reflect changes

* Version Bump and Document Dependencies

* Change power control commands to systemd

* Change cover image

* Crop cover image

* [FEATURE]: Add UTMPX support

* RUSTFMT and add libc dependency

* UTMPX Support (#90)

* [FEATURE]: Add UTMPX support
* RUSTFMT and add libc dependency

* Clippy and include Cargo.lock

Co-authored-by: Marcin Puc <tranzystorek.io@protonmail.com>
2022-11-22 16:30:26 +01:00

76 lines
2 KiB
Bash
Executable file

#! /bin/sh
ROOT_CMD=""
if which "doas" > /dev/null 2>&1
then
ROOT_CMD="doas"
else
if which "sudo" > /dev/null 2>&1
then
ROOT_CMD="sudo";
else
echo '`sudo` or `doas` needs to be installed';
exit 1;
fi
fi
echo 'Lemurs install script'
echo
# Compile lemurs
echo 'Step 1: Compile Lemurs'
cargo build --release
if [ $? -ne 0 ]; then exit 1; fi
# Move lemurs to /usr/bin
echo 'Step 2: Move lemurs into /usr/bin'
$ROOT_CMD cp -f "target/release/lemurs" "/usr/bin/lemurs"
if [ $? -ne 0 ]; then exit 1; fi
# Create lemurs directory
echo 'Step 3: Create lemurs configuration directory'
echo 'NOTE: You still have to move your X or Wayland startup into the proper directories'
$ROOT_CMD mkdir -p "/etc/lemurs/wms"
$ROOT_CMD mkdir -p "/etc/lemurs/wayland"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over configuration file
echo 'Step 4: Copy over default configuration'
$ROOT_CMD cp -f "extra/config.toml" "/etc/lemurs/config.toml"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over xsetup
echo 'Step 5: Copy over more files'
$ROOT_CMD cp -f "extra/xsetup.sh" "/etc/lemurs/xsetup.sh"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over default xinitrc
if [ -f .xinitrc ]
then
echo 'Step 6: Copy over existing xinitrc'
$ROOT_CMD cp -f "~/.xinitrc" "/etc/lemurs/wms/xinitrc"
fi
# Cache the current user
echo 'Step 7: Caching the current user'
$ROOT_CMD /bin/bash -c "echo $USER > /var/cache/lemurs"
# Disable previous Display Manager
echo 'Step 7: Disabling the current display-manager. This might throw an error if no display manager is set up.'
$ROOT_CMD systemctl disable display-manager.service
# Copy over systemd service
echo 'Step 8: Setting up lemurs service'
$ROOT_CMD cp -f extra/lemurs.service /usr/lib/systemd/system/lemurs.service
if [ $? -ne 0 ]; then exit 1; fi
# Enable lemurs
echo 'Step 9: Enable the lemurs service'
$ROOT_CMD systemctl enable lemurs.service
if [ $? -ne 0 ]; then exit 1; fi
# Make sure Xauthority file exists
echo 'Step 10: Ensure the Xauthority file exists'
touch ~/.Xauthority
if [ $? -ne 0 ]; then exit 1; fi