Skip to content

Commit

Permalink
v0.0.9: add link creator and big element finder
Browse files Browse the repository at this point in the history
- remove double translations
  • Loading branch information
Yann Büchau committed Jun 8, 2017
1 parent 1521924 commit bc5eb33
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 26 deletions.
6 changes: 5 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ IN_FILES = $(shell find $(local_dirs) -type f -iname '*.in')
IN_FILES_INSTANTIATED = $(IN_FILES:.in=)

CONFIGURE_AC = configure.ac
CONFIGURE = configure

# get information from changelog
DEBIAN_CHANGELOG = debian/changelog
DEBIAN_CHANGELOG_VERSION = $(shell perl -ne 'if(s/^$(PACKAGE_NAME)\s*\((.*?)\).*$$/$$1/g){print;exit}' $(DEBIAN_CHANGELOG))

# default target
.PHONY: all
all: $(IN_FILES_INSTANTIATED) $(UCA_XML_FILES) $(CONFIGURE_AC) $(GFMANPAGES)
all: $(IN_FILES_INSTANTIATED) $(UCA_XML_FILES) $(CONFIGURE) $(CONFIGURE_AC) $(GFMANPAGES)

%: %.m4 $(wildcard $(M4_INCL)/*.m4)
m4 -I $(M4_INCL) $< > $@
Expand Down Expand Up @@ -139,6 +140,9 @@ $(sort $(install_target_dirs)): % :
mkdir -p $@
@echo $@ >> $(installed_files_file)

$(CONFIGURE): $(CONFIGURE_AC)
-autoconf

$(CONFIGURE_AC): $(DEBIAN_CHANGELOG)
perl -pi -e 's#^(\s*AC_INIT\([^,]*,\s*\[)([.0-9_a-zA-Z-]+)(\]\s*,.*\))#$${1}$(DEBIAN_CHANGELOG_VERSION)$${3}#g' $@

Expand Down
141 changes: 132 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for thunar-custom-actions 0.0.8.
# Generated by GNU Autoconf 2.69 for thunar-custom-actions 0.0.9.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='thunar-custom-actions'
PACKAGE_TARNAME='thunar-custom-actions'
PACKAGE_VERSION='0.0.8'
PACKAGE_STRING='thunar-custom-actions 0.0.8'
PACKAGE_VERSION='0.0.9'
PACKAGE_STRING='thunar-custom-actions 0.0.9'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand All @@ -593,7 +593,10 @@ gs_bin
bc_bin
zenity_bin
gpg2_bin
perl_bin
convert_bin
xargs_bin
xdg_open_bin
make_bin
UCAFILE
PASSWDFILE
Expand Down Expand Up @@ -1195,7 +1198,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures thunar-custom-actions 0.0.8 to adapt to many kinds of systems.
\`configure' configures thunar-custom-actions 0.0.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1258,7 +1261,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of thunar-custom-actions 0.0.8:";;
short | recursive ) echo "Configuration of thunar-custom-actions 0.0.9:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1333,7 +1336,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
thunar-custom-actions configure 0.0.8
thunar-custom-actions configure 0.0.9
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand All @@ -1350,7 +1353,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by thunar-custom-actions $as_me 0.0.8, which was
It was created by thunar-custom-actions $as_me 0.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -1794,6 +1797,86 @@ fi
test "$make_bin" != "yes" && as_fn_error $? "no make found" "$LINENO" 5
# Extract the first word of "xdg-open", so it can be a program name with args.
set dummy xdg-open; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_xdg_open_bin+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$xdg_open_bin"; then
ac_cv_prog_xdg_open_bin="$xdg_open_bin" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_xdg_open_bin="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_xdg_open_bin" && ac_cv_prog_xdg_open_bin="no"
fi
fi
xdg_open_bin=$ac_cv_prog_xdg_open_bin
if test -n "$xdg_open_bin"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xdg_open_bin" >&5
$as_echo "$xdg_open_bin" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test "$xdg_open_bin" != "yes" && as_fn_error $? "no xdg-open found" "$LINENO" 5
# Extract the first word of "xargs", so it can be a program name with args.
set dummy xargs; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_xargs_bin+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$xargs_bin"; then
ac_cv_prog_xargs_bin="$xargs_bin" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_xargs_bin="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_xargs_bin" && ac_cv_prog_xargs_bin="no"
fi
fi
xargs_bin=$ac_cv_prog_xargs_bin
if test -n "$xargs_bin"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xargs_bin" >&5
$as_echo "$xargs_bin" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test "$xargs_bin" != "yes" && as_fn_error $? "no xargs found" "$LINENO" 5
# Extract the first word of "convert", so it can be a program name with args.
set dummy convert; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -1834,6 +1917,46 @@ fi
test "$convert_bin" != "yes" && as_fn_error $? "no convert/ImageMagick found" "$LINENO" 5
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_perl_bin+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$perl_bin"; then
ac_cv_prog_perl_bin="$perl_bin" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_perl_bin="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_perl_bin" && ac_cv_prog_perl_bin="no"
fi
fi
perl_bin=$ac_cv_prog_perl_bin
if test -n "$perl_bin"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_bin" >&5
$as_echo "$perl_bin" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test "$perl_bin" != "yes" && as_fn_error $? "no Perl found" "$LINENO" 5
# Extract the first word of "gpg2", so it can be a program name with args.
set dummy gpg2; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -2693,7 +2816,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by thunar-custom-actions $as_me 0.0.8, which was
This file was extended by thunar-custom-actions $as_me 0.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -2746,7 +2869,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
thunar-custom-actions config.status 0.0.8
thunar-custom-actions config.status 0.0.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
11 changes: 10 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([thunar-custom-actions], [0.0.8], [[email protected]])
AC_INIT([thunar-custom-actions], [0.0.9], [[email protected]])

m4_include([m4/ax_python_module.m4])

Expand All @@ -16,9 +16,18 @@ AC_SUBST([UCAFILE])
AC_CHECK_PROG([make_bin],[make],[yes],[no])
test "$make_bin" != "yes" && AC_MSG_ERROR([no make found])

AC_CHECK_PROG([xdg_open_bin],[xdg-open],[yes],[no])
test "$xdg_open_bin" != "yes" && AC_MSG_ERROR([no xdg-open found])

AC_CHECK_PROG([xargs_bin],[xargs],[yes],[no])
test "$xargs_bin" != "yes" && AC_MSG_ERROR([no xargs found])

AC_CHECK_PROG([convert_bin],[convert],[yes],[no])
test "$convert_bin" != "yes" && AC_MSG_ERROR([no convert/ImageMagick found])

AC_CHECK_PROG([perl_bin],[perl],[yes],[no])
test "$perl_bin" != "yes" && AC_MSG_ERROR([no Perl found])

AC_CHECK_PROG([gpg2_bin],[gpg2],[yes],[no])
test "$gpg2_bin" != "yes" && AC_MSG_ERROR([no gpg2 found])

Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
thunar-custom-actions (0.0.9) unstable; urgency=medium

* add symbolic link creation
* remove double translations
* add space-consuming element finder

-- Yann Büchau <[email protected]> Thu, 08 Jun 2017 19:49:22 +0200

thunar-custom-actions (0.0.8) unstable; urgency=medium

* add GPG en/decryption actions
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Vcs-Git: https://github.com/nobodyinperson/thunar-custom-actions.git
Package: thunar-custom-actions
Architecture: all
Depends: ${misc:Depends}, thunar, python3, python3-lxml, make, imagemagick,
zenity, ghostscript, gnupg2, bc
zenity, ghostscript, gnupg2, bc, xdg-utils, perl, findutils (>=4.6),
coreutils (>=8.0)
Conflicts: thunar-custom-actions
Replaces: thunar-custom-actions
Description: system-wide thunar custom actions
Expand Down
4 changes: 1 addition & 3 deletions m4/tuca.m4
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ define(TUCA_FIRST_FILE,%f)dnl
define(TUCA_FIRST_FILE_FOLDER,%d)dnl
define(TUCA_FIRST_FILENAME,%n)dnl
dnl
dnl
define(TUCA_LOOP,dnl
set -e;dnl
AMOUNT=$(for TUCA_FILE_VAR in TUCA_ALL_FILES;do echo TUCA_FILE;done | wc -l);dnl
NR=0;dnl
for TUCA_FILE_VAR in TUCA_ALL_FILES;do dnl
Expand All @@ -35,5 +33,5 @@ dnl
define(TUCA_WAIT,dnl
set -e;dnl
$1 |dnl
zenity --progress --auto-kill --auto-close --pulsate;dnl
zenity --progress --auto-kill --auto-close --pulsate dnl
)dnl
6 changes: 1 addition & 5 deletions share/thunar-custom-actions/system-uca/gpg.xml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ include(tuca.m4)dnl
<actions>
<action>
<icon>gcr-gnupg</icon>
<name>encrypt symmetrically with GPG</name>
<name xml:lang="de">symmetrisch mit GPG verschlüsseln</name>
<name xml:lang="en">encrypt symmetrically with GPG</name>
<command>PASSWORD=$(zenity --password);TUCA_LOOP(TUCA_OUT_VAR=TUCA_FILE.asc;echo $PASSWORD | gpg2 --batch --yes --passphrase-fd 0 --symmetric --armor --cipher-algo AES256 -o TUCA_TEMP TUCA_FILE)</command>
<description>Each selected file is encrypted symmetrically with one given password via GPG.</description>
<command>PASSWORD=$(zenity --password) || exit;TUCA_LOOP(TUCA_OUT_VAR=TUCA_FILE.asc;echo $PASSWORD | gpg2 --batch --yes --passphrase-fd 0 --symmetric --armor --cipher-algo AES256 -o TUCA_TEMP TUCA_FILE)</command>
<description xml:lang="de">Die ausgewählten Dateien werden symmetrisch mit einem Password mit GPG verschlüsselt.</description>
<description xml:lang="en">Each selected file is encrypted symmetrically with one given password with GPG.</description>
<patterns>*</patterns>
Expand All @@ -22,11 +20,9 @@ include(tuca.m4)dnl
</action>
<action>
<icon>gcr-gnupg</icon>
<name>decrypt symmetrically with GPG</name>
<name xml:lang="de">symmetrisch mit GPG entschlüsseln</name>
<name xml:lang="en">decrypt symmetrically with GPG</name>
<command>PASSWORD=$(zenity --password);TUCA_LOOP(TUCA_OUT_VAR=$(dirname TUCA_FILE)/$(basename TUCA_FILE .asc);echo $PASSWORD | gpg2 --batch --yes --passphrase-fd 0 --decrypt --cipher-algo AES256 -o TUCA_TEMP TUCA_FILE || zenity --warning --text "Wrong Password for $(basename TUCA_FILE)?")</command>
<description>Each selected file is decrypted symmetrically with one given password via GPG.</description>
<description xml:lang="de">Die ausgewählten Dateien werden symmetrisch mit einem Password mit GPG entschlüsselt.</description>
<description xml:lang="en">Each selected file is decrypted symmetrically with one given password with GPG.</description>
<patterns>*.asc</patterns>
Expand Down
32 changes: 32 additions & 0 deletions share/thunar-custom-actions/system-uca/misc.xml.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Misc useful custom actions
include(tuca.m4)dnl
-->
<actions>
<action>
<icon>emblem-symbolic-link</icon>
<name xml:lang="de">Verknüpfung erstellen</name>
<name xml:lang="en">create link to this file</name>
<command>TARGET=$(zenity --file-selection --save --filename TUCA_FIRST_FILE) || exit;ln -s TUCA_FIRST_FILE $TARGET || zenity --error;</command>
<description xml:lang="de">Eine symbolische Verknüpfung zu der ausgewählten Datei erstellen.</description>
<description xml:lang="en">Create a symbolic link to the selected file.</description>
<patterns>*</patterns>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
<action>
<icon>edit-find</icon>
<name xml:lang="de">Platzfresser finden</name>
<name xml:lang="en">find space-consuming elements</name>
<command>TMPFILE=$(mktemp);TUCA_WAIT(du -ha --max-depth 1 TUCA_FIRST_FILE | grep -v 'TUCA_FIRST_FILE$' | sort -rh | perl -ne '($s,$n)=m/^(\S+)\s+(\S+.*)$/;$n=~s:.*/([^/]+)$:${1}:g;print "$s\n$n\n"' | tee $TMPFILE);cd TUCA_FIRST_FILE;cat $TMPFILE | zenity --list --column="size" --column="name" --title="" --text="" --print-column 2 | xargs -r --delimiter='\n' xdg-open;rm $TMPFILE</command>
<description xml:lang="de">Die größten Dateien und Ordner hier sortiert auflisten.</description>
<description xml:lang="en">Give a sorted list of the biggest files and folders here.</description>
<patterns>*</patterns>
<directories/>
</action>
</actions>

Loading

0 comments on commit bc5eb33

Please sign in to comment.