Skip to content

Commit

Permalink
working installation
Browse files Browse the repository at this point in the history
Installation, uninstallation and re-installation work.
Thanks to nautilus -q, postinst and prerm.
Setting the icons seems impossible.
  • Loading branch information
tanjary21 committed Apr 12, 2024
1 parent bd7b3d8 commit effe35e
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,22 @@ Now, when you right-click on a file, you will see your custom command appear in

And that's it!

icons...?
icons...?

Personal stuff:

# to prepare install:
```
rm flash-ffmpeg_0.1-0_amd64.deb
dpkg-deb --build --root-owner-group flash-ffmpeg_0.1-0_amd64
sudo dpkg -i flash-ffmpeg_0.1-0_amd64.deb
```

# to uninstall
```
sudo dpkg -r flash-ffmpeg
sudo mv /var/lib/dpkg/info/flash-ffmpeg.* /tmp/
sudo dpkg --remove --force-remove-reinstreq flash-ffmpeg
sudo dpkg --purge flash-ffmpeg
dpkg -l | grep flash-ffmpeg
```
Binary file added flash-ffmpeg_0.1-0_amd64.deb
Binary file not shown.
5 changes: 5 additions & 0 deletions flash-ffmpeg_0.1-0_amd64/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Package: flash-ffmpeg
Version: 1.0
Architecture: amd64
Maintainer: Taher Anjary <tanjary21@ku.edu.tr>
Description: Quick access to customizable FFMPEG functions directly from the right-click context menu
35 changes: 35 additions & 0 deletions flash-ffmpeg_0.1-0_amd64/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh -e

# get user's home directory
USER_HOME_DIR=$(getent passwd "$SUDO_USER" | cut -d: -f6)

# build a directory structure for the scripts
mkdir "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG"

# set icons for the scripts
# gio set "/usr/share/flash_ffmpeg/scripts/convert_mp4_to_gif.sh" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/gif.png"
# gio set "/usr/share/flash_ffmpeg/scripts/extract_frames.sh" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/image.png"
# gio set "/usr/share/flash_ffmpeg/scripts/frames_to_mp4.sh" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/reel.png"
# gio set "/usr/share/flash_ffmpeg/scripts/mp4_downsampler.sh" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/video.png"


# build symbolic links to the scripts
sudo ln -s "/usr/share/flash_ffmpeg/scripts/convert_mp4_to_gif.sh" "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/MP4 to GIF"
sudo ln -s "/usr/share/flash_ffmpeg/scripts/extract_frames.sh" "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/MP4 to Frames"
sudo ln -s "/usr/share/flash_ffmpeg/scripts/frames_to_mp4.sh" "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/Frames to MP4"
sudo ln -s "/usr/share/flash_ffmpeg/scripts/mp4_downsampler.sh" "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/Downsample MP4"

# give the symbolic links the right permissions
# TODO

# give the symbolic links some icons
# gvfs-set-attribute -t "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/MP4 to GIF" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/gif.png"
# gvfs-set-attribute -t "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/MP4 to Frames" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/image.png"
# gvfs-set-attribute -t "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/Frames to MP4" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/reel.png"
# gvfs-set-attribute -t "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG/Downsample MP4" metadata::custom-icon "file:///usr/share/icons/flash_ffmpeg/video.png"





# It's very immportant to reload nautilus after the installation completes. Use the command: 'nautilus -q'
15 changes: 15 additions & 0 deletions flash-ffmpeg_0.1-0_amd64/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -e

USER_HOME_DIR=$(getent passwd "$SUDO_USER" | cut -d: -f6)

sudo find "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG" -type l -exec rm {} +

sudo rm -r "$USER_HOME_DIR/.local/share/nautilus/scripts/Flash FFMPEG"

# Full uninstall procedures:
# sudo dpkg -r flash-ffmpeg;
# sudo mv /lib/dpkg/info/flash/ffmpeg-tmp.* /var/;
# sudo dpkg --remove --force-remove-reinstreq flash-ffmpeg;
# sudo dpkg --purge flash-ffmpeg


1 change: 1 addition & 0 deletions symlinks_backup/Downsample MP4
1 change: 1 addition & 0 deletions symlinks_backup/Frames to MP4
1 change: 1 addition & 0 deletions symlinks_backup/MP4 to Frames
1 change: 1 addition & 0 deletions symlinks_backup/MP4 to GIF

0 comments on commit effe35e

Please sign in to comment.