Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: gnome-shell-extension-tailscale-status #2961

Draft
wants to merge 1 commit into
base: frawhide
Choose a base branch
from

Conversation

Owen-sz
Copy link
Member

@Owen-sz Owen-sz commented Jan 15, 2025

Needed for Taidan

Comment on lines +72 to +78
mv %{_localstatedir}/lib/rpm-state/%{uuid}/metadata.json /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/metadata.json
mv %{_localstatedir}/lib/rpm-state/%{uuid}/extension.js /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/extension.js
mv %{_localstatedir}/lib/rpm-state/%{uuid}/prefs.js /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/prefs.js
mv %{_localstatedir}/lib/rpm-state/%{uuid}/icon-down.svg /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/icon-down.svg
mv %{_localstatedir}/lib/rpm-state/%{uuid}/icon-exit-node.svg /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/icon-exit-node.svg
mv %{_localstatedir}/lib/rpm-state/%{uuid}/icon-up.svg /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/icon-up.svg
mv %{_localstatedir}/lib/rpm-state/%{uuid}/schemas/* /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/schemas/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not doable, you should not do this itfp

This extension is in no way affiliated with Tailscale Inc.

%prep
wget https://extensions.gnome.org/review/download/58475.shell-extension.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you grab this from %SOURCE0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but it didn't like it, I'll try again.

Comment on lines +63 to +69
#Since this is a User Extension, we muct only install for the current user
current_user=$(logname)
echo "Running post-transaction scripts as user ${current_user}..."

# Create the User Extensions directories in the user's home directory
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/schemas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if this is a user extension you can't just interfere with the user home directory.

dnf is a system package manager by nature and you can't just do this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so it pretty much needs to be a system extension or can't be packaged?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well you need to figure out a way to install user extensions in a system-wide way (a bit like user services for systemd)

Comment on lines +39 to +69
%install
mkdir -p %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}
mkdir -p %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/schemas

install -Dm644 metadata.json %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/metadata.json
install -Dm644 extension.js %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/extension.js
install -Dm644 prefs.js %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/prefs.js
install -Dm644 icon-down.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-down.svg
install -Dm644 icon-exit-node.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-exit-node.svg
install -Dm644 icon-up.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-up.svg
install -Dm644 schemas/* %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/schemas/

%files
%dir %{_localstatedir}/lib/rpm-state/%{uuid}
%dir %{_localstatedir}/lib/rpm-state/%{uuid}/schemas
%{_localstatedir}/lib/rpm-state/%{uuid}/metadata.json
%{_localstatedir}/lib/rpm-state/%{uuid}/extension.js
%{_localstatedir}/lib/rpm-state/%{uuid}/prefs.js
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-down.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-exit-node.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-up.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/schemas/*

%post
#Since this is a User Extension, we muct only install for the current user
current_user=$(logname)
echo "Running post-transaction scripts as user ${current_user}..."

# Create the User Extensions directories in the user's home directory
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/schemas
Copy link
Member

@korewaChino korewaChino Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just do this bro

Suggested change
%install
mkdir -p %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}
mkdir -p %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/schemas
install -Dm644 metadata.json %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/metadata.json
install -Dm644 extension.js %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/extension.js
install -Dm644 prefs.js %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/prefs.js
install -Dm644 icon-down.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-down.svg
install -Dm644 icon-exit-node.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-exit-node.svg
install -Dm644 icon-up.svg %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/icon-up.svg
install -Dm644 schemas/* %{buildroot}%{_localstatedir}/lib/rpm-state/%{uuid}/schemas/
%files
%dir %{_localstatedir}/lib/rpm-state/%{uuid}
%dir %{_localstatedir}/lib/rpm-state/%{uuid}/schemas
%{_localstatedir}/lib/rpm-state/%{uuid}/metadata.json
%{_localstatedir}/lib/rpm-state/%{uuid}/extension.js
%{_localstatedir}/lib/rpm-state/%{uuid}/prefs.js
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-down.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-exit-node.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/icon-up.svg
%{_localstatedir}/lib/rpm-state/%{uuid}/schemas/*
%post
#Since this is a User Extension, we muct only install for the current user
current_user=$(logname)
echo "Running post-transaction scripts as user ${current_user}..."
# Create the User Extensions directories in the user's home directory
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}
mkdir -p /home/${current_user}/.local/share/gnome-shell/extensions/%{uuid}/schemas
%install
mkdir -p %%{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/schemas
install -Dm644 metadata.json %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/metadata.json
install -Dm644 extension.js %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/extension.js
install -Dm644 prefs.js %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/prefs.js
install -Dm644 icon-down.svg %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/icon-down.svg
install -Dm644 icon-exit-node.svg %{buildroot}%{_datadir}/gnome-shell/extensions/icon-exit-node.svg
install -Dm644 icon-up.svg %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/icon-up.svg
install -Dm644 schemas/* %{buildroot}%{_datadir}/gnome-shell/extensions/%{uuid}/schemas/
%files
%dir %{_datadir}/gnome-shell/extensions/%{uuid}
%dir %{_datadir}/gnome-shell/extensions/%{uuid}/schemas/

@madonuko madonuko changed the title Add: gnome-shell-extension-tailscale-status add: gnome-shell-extension-tailscale-status Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants