first commit

This commit is contained in:
2026-01-31 01:03:40 +01:00
commit 8ffeb37bd4
31 changed files with 1022 additions and 0 deletions

44
bin/desktop-items.in Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/sh
xdg=$(xdg-user-dir DESKTOP)
src='/usr/share/applications'
if [[ -f /usr/bin/calamares ]]; then
install -Dm755 $src/calamares.desktop \
$xdg/calamares.desktop
if $(is_sonar); then
sed -e "s/^.*Name=.*/Name=Install Sonar Linux (Calamares)/" -i $xdg/calamares.desktop
fi
fi
if [[ -f /usr/bin/manjaro-architect ]]; then
install -Dm755 $src/manjaro-architect.desktop \
$xdg/manjaro-architect.desktop
# workaround for mate-terminal; https://github.com/manjaro/desktop-settings/issues/120
if [[ $DESKTOP_SESSION == "mate" ]]; then
sed -i "s/^Exec.*/Exec=mate-terminal -e 'sudo \/usr\/bin\/setup'/; s/Terminal.*/Terminal=false/" $xdg/manjaro-architect.desktop
fi
fi
if [[ -f "$src/manjaro-documentation.desktop" ]]; then
install -Dm755 $src/manjaro-documentation.desktop \
"$xdg/manjaro-documentation.desktop"
fi
if [[ -f "$src/hexchat.desktop" ]]; then
install -Dm755 $src/hexchat.desktop \
"$xdg/hexchat.desktop"
fi
# workaround for glib trash bug (https://bugzilla.gnome.org/show_bug.cgi?id=748248)
userid=$(id -u $USER)
if [ ! -d "/.Trash-$userid" ]; then
sudo mkdir -p /.Trash-$userid/{expunged,files,info}
sudo chown -R $userid /.Trash-$userid
fi
# mark launchers trusted for XFCE 4.18
for f in $(ls $xdg/*desktop); do
gio set -t string $f metadata::xfce-exe-checksum "$(sha256sum $f | awk '{print $1}')"
done;

6
bin/disable-dpms.in Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
## DPMS - Display Power Management Settings
## These are disabled by default to prevent auto-actions when
## the system is idle, such as screen blanking (10 mins) or
## suspending (1 hour).
(sleep 15s && xset -dpms; xset s off) &

66
bin/manjaro-live.in Executable file
View File

@@ -0,0 +1,66 @@
#!/bin/sh
LIBDIR='@libdir@'
DATADIR='@datadir@'
SYSCONFDIR='@sysconfdir@'
export LC_MESSAGES=C
export LANG=C
livetimer=$(date +%s%3N)
[[ -r ${LIBDIR}/util-live.sh ]] && source ${LIBDIR}/util-live.sh
load_live_config "${SYSCONFDIR}/live.conf" || load_live_config "${DATADIR}/live.conf"
livetimer=$(get_timer_ms)
detect_desktop_env
echo "Detected ${default_desktop_executable} ${default_desktop_file}: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
CONSOLEMAP="$(kernel_cmdline vconsole.font.map)"
arch=$(uname -m)
echo "Got consolefont and arch $arch: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
### DECIDE IF WE DON'T NEED IT ###
# see also https://github.com/calamares/calamares/issues/860
# Activate swap
#livetimer=$(get_timer_ms)
#configure_swap
#echo "Activated swap and added to fstab: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_language
echo "Finished localization: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_user
echo "Created user ${username} with password ${password}: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_sudoers_d
echo "Configured sudoers: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_machine_id
echo "Configured machine-id: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_accountsservice "${username}"
echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_displaymanager
echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
livetimer=$(get_timer_ms)
configure_user_root /
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
if [[ -f /usr/bin/samba ]];then
livetimer=$(get_timer_ms)
configure_samba
echo "Configured samba: $(elapsed_time_ms ${livetimer})ms" >> /var/log/manjaro-live.log
fi

10
bin/mhwd-live-net.in Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
[[ -r @libdir@/util-live.sh ]] && source @libdir@/util-live.sh
DRIVER="$(kernel_cmdline driver nonfree)"
MODULES_DIR='/etc/calamares/modules'
echo "Setting MHWD driver: ${DRIVER} ..." >> /var/log/mhwd-live.log
sed -e "s|^.*driver:.*|driver: ${DRIVER}|" -i "${MODULES_DIR}/mhwdcfg.conf"
echo "MHWD DONE" >> /var/log/mhwd-live.log

40
bin/mhwd-live.in Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/sh
[[ -r @libdir@/util-live.sh ]] && source @libdir@/util-live.sh
DRIVER="$(kernel_cmdline driver nonfree)"
VIDEO="$(kernel_cmdline xdriver no)"
REPO_PATH='/opt/mhwd'
PAC_CONF="${REPO_PATH}/pacman-mhwd.conf"
# In a live session we should never have a database lock at boot, this is a bug!
# In the past pamac caused issues about that.
# Fixed here: https://github.com/manjaro/manjaro-tools/commit/57a039088ae4485bc5dc411e36a90c0753e670f1
seconds="0"
while [ -e "/var/lib/pacman/db.lck" ];
do
echo 'Pacman is not ready yet. Will try again in 10 seconds.' >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
ps -ef >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
seconds=$(($seconds + 10))
sleep 10
if [[ "$seconds" == "30" ]]; then
echo 'Warning: removing pacman db.lck!' >> /var/log/mhwd-live.log
rm /var/lib/pacman/db.lck
fi
done
# hwdetect_graphics
if [[ -e "${PAC_CONF}" ]]; then
MODULES_DIR='/etc/calamares/modules'
echo "Running MHWD..." >> /var/log/mhwd-live.log
sed -e "s|^.*driver:.*|driver: ${DRIVER}|" -i "${MODULES_DIR}/mhwdcfg.conf"
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
else
mhwd --auto pci ${DRIVER} 0300 --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
fi
echo "MHWD DONE" >> /var/log/mhwd-live.log
fi

6
bin/pulseaudio-ctl-normal.in Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
# Do we need this at all?
if [ -e /usr/bin/pulseaudio-ctl ];then
(sleep 10s && /usr/bin/pulseaudio-ctl set 70) &
fi