Restructure repo layout and document conventions
Move legacy systemscripts into scripts/display and scripts/setup. Rehome stray top-level tools into their domain folders. Archive narrow experiments and outdated codegrab leftovers. Remove empty legacy directories and stale root files. Expand macOS metadata ignores and update the README with the refined repository structure.
This commit is contained in:
4
scripts/display/3_screen_setup.sh
Executable file
4
scripts/display/3_screen_setup.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
xrandr --output DVI-I-1 --mode 1920x1080 --rotate left --pos 0x0
|
||||
xrandr --output DP-1 --primary --mode 2560x1440 --pos 1080x350
|
||||
xrandr --output DP-2 --mode 2560x1440 --pos 3640x350
|
||||
23
scripts/display/notebook_extended.sh
Executable file
23
scripts/display/notebook_extended.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Display configuration script
|
||||
# Run this anytime you want to restore your display settings
|
||||
|
||||
echo "Configuring displays..."
|
||||
|
||||
# Primary display (laptop screen)
|
||||
xrandr --output eDP-1 --mode 3840x2160 --pos 0x0 --primary
|
||||
|
||||
# External display at native resolution with proper positioning
|
||||
if xrandr | grep -q "DP-1-3 connected"; then
|
||||
echo "Configuring external display DP-1-3..."
|
||||
xrandr --output DP-1-3 --mode 2240x1400 --pos 3840x760 --scale 1x1
|
||||
echo "External display configured:"
|
||||
echo " - Native resolution: 2240x1400"
|
||||
echo " - Position: bottom-aligned with laptop screen"
|
||||
echo " - No scaling artifacts"
|
||||
echo " - Mouse can move seamlessly between screens"
|
||||
else
|
||||
echo "External display DP-1-3 not connected"
|
||||
fi
|
||||
|
||||
echo "Display configuration complete!"
|
||||
2
scripts/display/single_fullhd.sh
Executable file
2
scripts/display/single_fullhd.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
xrandr --output eDP-1 --mode 1920x1080
|
||||
33
scripts/setup/disable_ubuntu_telemetry.sh
Executable file
33
scripts/setup/disable_ubuntu_telemetry.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if script is run as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run this script with sudo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Explicitly decline data collection for ubuntu-report (if it was not removed)
|
||||
echo "Declining data collection for ubuntu-report..."
|
||||
if command -v ubuntu-report &> /dev/null; then
|
||||
ubuntu-report -f send no
|
||||
fi
|
||||
|
||||
# Remove telemetry packages
|
||||
echo "Removing telemetry packages..."
|
||||
sudo apt purge -y ubuntu-report popularity-contest apport whoopsie apport-symptoms
|
||||
|
||||
# Prevent packages from being reinstalled
|
||||
echo "Preventing telemetry packages from being reinstalled..."
|
||||
sudo apt-mark hold ubuntu-report popularity-contest apport whoopsie apport-symptoms
|
||||
|
||||
# Block telemetry domains
|
||||
echo "Blocking telemetry domains..."
|
||||
sudo bash -c 'echo "127.0.0.1 www.metrics.ubuntu.com" >> /etc/hosts'
|
||||
sudo bash -c 'echo "127.0.0.1 metrics.ubuntu.com" >> /etc/hosts'
|
||||
sudo bash -c 'echo "127.0.0.1 www.popcon.ubuntu.com" >> /etc/hosts'
|
||||
sudo bash -c 'echo "127.0.0.1 popcon.ubuntu.com" >> /etc/hosts'
|
||||
|
||||
# Disable error reporting in settings (requires GUI interaction)
|
||||
echo "To fully disable telemetry, ensure 'Send error reports to Canonical' is set to 'Never' in Settings → Privacy → Diagnostics."
|
||||
|
||||
echo "Telemetry disabling completed."
|
||||
143
scripts/setup/mount_container
Executable file
143
scripts/setup/mount_container
Executable file
@@ -0,0 +1,143 @@
|
||||
#!/bin/bash
|
||||
## Functions
|
||||
#find containers
|
||||
containers=""
|
||||
commands=""
|
||||
|
||||
function read_containers(){
|
||||
containers=$(
|
||||
[ -e ~/.containers ] && cat ~/.containers 2>/dev/null
|
||||
find /media/${USER} -maxdepth 2 -iname ".containers" | while read line ; do
|
||||
cat $line | awk -F';' -v path="$(dirname $line)" '{OFS=";" ; print $1,path"/"$2}'
|
||||
done)
|
||||
}
|
||||
|
||||
function mount_container(){
|
||||
container_line=$*
|
||||
name=$(echo $container_line | cut -f1 -d';')
|
||||
path=$(echo $container_line | cut -f2 -d';')
|
||||
mount_point="/mnt/${name}"
|
||||
|
||||
#mount only if containerfile is valid
|
||||
if [ -e ${path} ] && cryptsetup isLuks "${path}" ; then
|
||||
#if mountpoint is not there create it
|
||||
[ ! -e ${mount_point} ] && sudo mkdir -p "${mount_point}" && sudo chmod 777 "${mount_point}"
|
||||
#open luks Container
|
||||
sudo cryptsetup luksOpen "${path}" "${name}"
|
||||
#mount Container
|
||||
sudo mount "/dev/mapper/${name}" "${mount_point}"
|
||||
else
|
||||
echo "Container ${path} not found" && continue
|
||||
fi
|
||||
}
|
||||
|
||||
function unmount_container(){
|
||||
container_line=$*
|
||||
name=$(echo $container_line | cut -f1 -d';')
|
||||
path=$(echo $container_line | cut -f2 -d';')
|
||||
mount_point="/mnt/${name}"
|
||||
|
||||
#unmount only if mounted
|
||||
if ( mount | grep -q "${mount_point}" ) ; then
|
||||
#if still in use
|
||||
if [[ $( lsof "${mount_point}" | wc -l ) -gt 0 ]] ; then
|
||||
echo "Mountpoint ${mount_point} is still in use:"
|
||||
lsof "${mount_point}"
|
||||
continue
|
||||
else
|
||||
sudo umount -l "${mount_point}"
|
||||
sudo rmdir "${mount_point}"
|
||||
fi
|
||||
|
||||
sudo cryptsetup luksClose "${name}"
|
||||
fi
|
||||
}
|
||||
|
||||
function is_open(){
|
||||
container_path="${1}"
|
||||
ls -b /dev/mapper/ | xargs -n1 sudo cryptsetup status | grep loop: | grep -q "${container_path}"
|
||||
return $?
|
||||
}
|
||||
|
||||
function is_mounted(){
|
||||
mount_point="${1}"
|
||||
mount | grep -q "${mount_point}"
|
||||
return $?
|
||||
}
|
||||
|
||||
function is_used(){
|
||||
mount_point="${1}"
|
||||
lsof ${mount_point} 2>/dev/null 1>&2
|
||||
return $?
|
||||
}
|
||||
|
||||
function is_mounted_container(){
|
||||
container_line=$*
|
||||
name=$(echo $container_line | cut -f1 -d';')
|
||||
path=$(echo $container_line | cut -f2 -d';')
|
||||
mount_point="/mnt/${name}"
|
||||
result=0
|
||||
mount | grep -q "${mount_point}" && (( result+=1 ))
|
||||
sudo cryptsetup status ${name} | grep -q "${path}" && (( result+=2 ))
|
||||
echo $result
|
||||
return $result
|
||||
}
|
||||
|
||||
#mount all containers
|
||||
function mount_all(){
|
||||
read_containers
|
||||
for line in $containers ; do
|
||||
mount_container $line
|
||||
done
|
||||
}
|
||||
|
||||
#unmount all containers
|
||||
function unmount_all(){
|
||||
read_containers
|
||||
for line in $containers ; do
|
||||
unmount_container $line
|
||||
done
|
||||
}
|
||||
|
||||
#print status
|
||||
function print_status(){
|
||||
container_line=$*
|
||||
name=$(echo $container_line | cut -f1 -d';')
|
||||
path=$(echo $container_line | cut -f2 -d';')
|
||||
mount_point="/mnt/${name}"
|
||||
echo "Stats for $name : $path"
|
||||
is_open ${path} && echo "IS OPENED"
|
||||
is_mounted ${mount_point} && echo "IS MOUNTED"
|
||||
is_used ${mount_point} && echo "IS IN USE"
|
||||
}
|
||||
|
||||
#print status
|
||||
function print_status_all(){
|
||||
read_containers
|
||||
for line in $containers ; do
|
||||
print_status $line
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
##main
|
||||
|
||||
command="show"
|
||||
[[ $# -eq 1 ]] && command="${1}"
|
||||
echo "Command: ${command}"
|
||||
|
||||
case $command in
|
||||
mount)
|
||||
mount_all
|
||||
;;
|
||||
unmount)
|
||||
unmount_all
|
||||
;;
|
||||
list)
|
||||
print_status_all
|
||||
;;
|
||||
*)
|
||||
read_containers
|
||||
echo $containers
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user