Skip to content

Commit

Permalink
Using freerdp3 instead of 3 and redirecting drives the good way.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanSelen committed Dec 18, 2024
1 parent c98ecb8 commit 7eb63cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
7 changes: 4 additions & 3 deletions ntos/configs/minimal/finish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ xfconf-query -c xfce4-power-manager -np '/xfce4-power-manager/logind-handle-lid-
# Configure the span monitor option.
xfconf-query -c xfce4-panel -np '/panels/panel-1/span-monitors' -t 'bool' -s 'true'

# Enable automounting
xfconf-query -c thunar-volman -np '/automount-drives/enabled' -t 'bool' -s 'true'
xfconf-query -c thunar-volman -np '/automount-media/enabled' -t 'bool' -s 'true'

#########################################
# ROOT #
#########################################
Expand Down Expand Up @@ -102,9 +106,6 @@ mkdir -p /home/$current_user/.config/autostart
cp /etc/xdg/autostart/light-locker.desktop /home/$current_user/.config/autostart
echo 'Hidden=true' >> /home/$current_user/.config/autostart/light-locker.desktop
# Setting USB-bus permissions for redirection
chmod -R 777 /dev/bus/usb/
echo -e '\nPending reboot, press any key to reboot.'
read doReboot
/sbin/reboot now
Expand Down
5 changes: 4 additions & 1 deletion ntos/configs/minimal/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ d-i mirror/http/mirror select deb.debian.org
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/enable-source-repositories boolean false
d-i apt-setup/disable-cdrom-entries boolean true

d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/backports/repository string \
http://ftp.de.debian.org/debian bookworm-backports main
d-i pkgsel/update-policy select full-upgrade
d-i popularity-contest/participate boolean true

Expand All @@ -64,7 +67,7 @@ d-i grub-installer/only_debian boolean true

d-i preseed/late_command string \
in-target /bin/bash -c ' \
apt-get install -y xfce4 xfce4-goodies xfce4-power-manager system-config-printer xfce4-panel-profiles xsane plymouth-themes dbus-x11 network-manager-gnome curl yad freerdp2-x11; \
apt-get install -y xfce4 xfce4-goodies xfce4-power-manager system-config-printer xfce4-panel-profiles xsane plymouth-themes dbus-x11 network-manager-gnome curl yad freerdp3-x11; \
apt-get autoremove -y; \
echo "NTOS-Setup" > /etc/hostname; \
sed -i "s/127.0.1.1.*/127.0.1.1 NTOS-Setup/" /etc/hosts; \
Expand Down
28 changes: 2 additions & 26 deletions ntos/credcon/credcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ show_loading_bar() {
for ((i=1; i<=100; i++)); do
echo $i | tee /dev/null
echo "# $i%" | tee /dev/tty
sleep 0.1
sleep 0.125
done | yad --progress \
--title='Loading' \
--text='Connecting' \
Expand Down Expand Up @@ -53,29 +53,6 @@ show_connection_failure() {
--height=200
}

list_usb_devices() {
declare -A usb_ids_map

while read -r id; do
usb_ids_map["$id"]=1
done < <(lsusb -tv | awk '
/Mass Storage/ {
getline
if ($0 ~ /ID/) {
sub(/.*ID /, "", $0)
print $1
}
}
')

usb_ids=()
for id in "${!usb_ids_map[@]}"; do
usb_ids+=("/usb:id,dev:$id")
done

echo "${usb_ids[*]}"
}

# Main loop, because I am a bit used to that programming structure.
main() {
# Start the script by displaying the credential prompt.
Expand All @@ -90,11 +67,10 @@ main() {

# Show the loading bar in the background, this is made because the FreeRDP session will take over the entire screen.
show_loading_bar &
usb_devices=$(list_usb_devices)

# Start xfreerdp session in the background and get its process ID (PID).
# This does not hinder the process from taking over the (screen/monitor) session.
xfreerdp "$rdpFile" /u:"${username}" /p:"${password}" "${usb_devices}" /cert-ignore | tee /dev/tty &
xfreerdp3 "$rdpFile" /u:"${username}" /p:"${password}" /a:drive:/media/user/* &
xfreerdp_pid=$!

# Wait for the xfreerdp process up to $interval seconds, default 30.
Expand Down

0 comments on commit 7eb63cb

Please sign in to comment.