Skip to content

Commit

Permalink
feat(vine): add basic printer support
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Dec 23, 2024
1 parent 2eee36f commit e6fef6a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 10 additions & 2 deletions templates/vine/desktop/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ RUN apt-get update && apt-get install -y \
"${USER_SHELL}" \
wget \
zip \
# Core (BMC)
ipmitool \
# Core (CLI)
jq \
yq \
Expand Down Expand Up @@ -488,6 +490,10 @@ RUN apt-get update && apt-get install -y \
# Link default system-wide font config
&& ln -sf "/home/${USER_NAME}/.config/fontconfig/conf.d/99-openark.conf" /etc/fonts/conf.d/99-openark.conf \
&& rm -f /etc/fonts/conf.d/65-nonlatin.conf \
# Printer Configuration
&& echo 'a4' >/etc/papersize \
&& mkdir -p /etc/cups /etc/cupshelpers /var/log/cups /usr/lib/cups /var/cache/cups /run/cups /var/spool/cups \
&& chown -R user:lpadmin /etc/cups /etc/cupshelpers /var/log/cups /usr/lib/cups /var/cache/cups /run/cups /var/spool/cups \
# Remove conflicted repositories
&& rm -f /etc/apt/sources.list.d/vscode.list \
# X11 Configuration
Expand Down Expand Up @@ -747,13 +753,15 @@ RUN mkdir -p /opt/public/ \

# Add scripts
ADD ./config/weston.ini /etc/xdg/weston/weston.ini
ADD ./polkit/rules.d/* /etc/polkit-1/rules.d/
ADD ./scripts /opt/scripts/
RUN chmod 0555 /opt/scripts/*
RUN chmod 0400 /etc/polkit-1/rules.d/* \
&& chmod 0555 /opt/scripts/*

# Add a user
RUN /sbin/ldconfig.real \
&& groupadd -g "${USER_GID}" -o "${USER_NAME}" \
&& useradd -u "${USER_UID}" -g "${USER_GID}" -G "audio,cdrom,input,render,video" \
&& useradd -u "${USER_UID}" -g "${USER_GID}" -G "audio,cdrom,input,lpadmin,render,video" \
-s "/bin/${USER_SHELL}" -m -o "${USER_NAME}" \
&& printf "${USER_UID}:2001:65535" > /etc/subuid \
&& printf "${USER_GID}:2001:65535" > /etc/subgid \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
polkit.addRule(function(action, subject) {
if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" &&
subject.isInGroup("wheel")){
return polkit.Result.YES;
}
});
3 changes: 3 additions & 0 deletions templates/vine/desktop/scripts/init-desktop-session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set -e -o pipefail
# Verbose
set -x

# Run Printer (CUPS) daemon
cupsd || true

# Remove Google Chrome singletons
rm -rf \
"${HOME}/.config/google-chrome/SingletonCookie" \
Expand Down

0 comments on commit e6fef6a

Please sign in to comment.