Skip to content

Instantly share code, notes, and snippets.

@equwal
Last active November 12, 2019 04:40
Show Gist options
  • Select an option

  • Save equwal/c44d88e6f73ecd5fb6dc8831947f79d2 to your computer and use it in GitHub Desktop.

Select an option

Save equwal/c44d88e6f73ecd5fb6dc8831947f79d2 to your computer and use it in GitHub Desktop.
Mount and ask to decrypt home on login, startx from the user persective after.
# Startx only if logged in on the first tty (leave other TTYs open for TTY use.)
# includes custom keymaps and startx
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
human-interface
fi
# If you want fish instead of bash.
if isatty stdin
if test "/dev/tty1" = (tty)
cd ~
human-interface
end
end
#!/bin/sh
cryptsetup luksOpen /dev/sda4 home
mount /dev/mapper/home /home
swapon /home/swapfile
# The following is just in case I logged in as root.
su jose # my username (picked because it is short)
#!/usr/bin/perl
use warnings;
use strict;
`~/bin/keymaps/desired-map`;
my $pid = fork();
if ($pid == 0) {`startx`}
else{`/usr/bin/monitor`}
# Goes at the bottom of your bash's /etc/profile or equivalent
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
/go #Custom script which calls cryptsetup. Change it if you want to
#have a passcode flash drive, etc.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment