Merge lp:easybreezy/thunar-actions into lp:easybreezy

Proposed by Robert Ladyman
Status: Merged
Merged at revision: 6
Proposed branch: lp:easybreezy/thunar-actions
Merge into: lp:easybreezy
Diff against target: 193 lines (+125/-5)
6 files modified
.bzrignore (+2/-0)
Notes.txt (+14/-3)
easybreezythunar.xml (+64/-0)
install_to_thunar.sh (+39/-0)
runcheckout.sh (+3/-1)
runnewproject.sh (+3/-1)
To merge this branch: bzr merge lp:easybreezy/thunar-actions
Reviewer Review Type Date Requested Status
Robert Ladyman Pending
Review via email: mp+368476@code.launchpad.net

Commit message

Tested on Nemo system and does not interfere, so can be merged.

Description of the change

Added installer for Thunar (a basic one). Also set the path for the bzrdefaults file to the location a script is run from: Thunar uses ~/.config/Thunar but Nemo uses ~/.local/share/nemo/actions

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2019-06-05 13:16:29 +0000
3+++ .bzrignore 2019-06-06 15:37:14 +0000
4@@ -4,3 +4,5 @@
5 bzrdefaults
6 ./bzradd.nemo_action
7 bzrexplorer.nemo_action
8+accels.scm
9+uca.xml
10
11=== modified file 'Notes.txt'
12--- Notes.txt 2019-06-06 11:04:41 +0000
13+++ Notes.txt 2019-06-06 15:37:14 +0000
14@@ -1,7 +1,9 @@
15 Bzr / Brz actions for non-technical users
16
17-A set of nemo_actions, primarily for Linux Mint (and eventually, Windows actions) giving
18-right-click access to the more common bzr / brz (Bazaar /Breezy) actions.
19+A set of actions, primarily for Linux Mint (and eventually, Windows actions) giving
20+right-click access to the more common bzr / brz (Bazaar /Breezy) actions in Nemo or
21+Thunar (XFCE).
22+
23 Intended for use by *non-techincal staff*.
24
25 It assumes that:-
26@@ -9,7 +11,15 @@
27 * There is a single central repository
28 * It is accessed via bzr+ssh
29
30-The actions are bash scripts.
31+The actions are bash scripts. You might need to mark the *.sh scripts as executable.
32+
33+For Nemo, put the files into ~/.local/share/nemo/actions
34+
35+For Thunar, put the files into ~.config/Thunar
36+For Thunar, courtesy of the uca.xml file, you'll have to run the ./install_to_thunar script.
37+This will copy the contents of the easybreezythunar.xml into the uca.xml file and backup
38+the original file.
39+
40
41 Requirements:
42 * "bzr qcheckout-ala-explorer" is used (so bzr-explorer is required as it supplies it).
43@@ -17,6 +27,7 @@
44 * sshpass is also used.
45 * zenity (usually already installed)
46
47+
48 You should save a copy of bzrdefaults-README.txt as bzrdefaults and put in your own settings.
49
50 The NotUsed folder contains a number of actions that are, surprisingly, not used by default.
51
52=== added file 'easybreezythunar.xml'
53--- easybreezythunar.xml 1970-01-01 00:00:00 +0000
54+++ easybreezythunar.xml 2019-06-06 15:37:14 +0000
55@@ -0,0 +1,64 @@
56+<action>
57+ <icon></icon>
58+ <name>bzr show LOG</name>
59+ <command>~/.config/Thunar/runlog.sh %F</command>
60+ <description>Show the log for this project</description>
61+ <patterns>*</patterns>
62+ <directories/>
63+</action>
64+<action>
65+ <icon></icon>
66+ <name>bzr ADD any new files</name>
67+ <command>~/.config/Thunar/runadd.sh %F</command>
68+ <description>Add any new files to this project</description>
69+ <patterns>*</patterns>
70+ <directories/>
71+</action>
72+<action>
73+ <icon></icon>
74+ <name>bzr ADD and COMMIT</name>
75+ <command>~/.config/Thunar/runaddcommit.sh %F</command>
76+ <description>Add and then commit any new files to this project</description>
77+ <patterns>*</patterns>
78+ <directories/>
79+</action>
80+<action>
81+ <icon></icon>
82+ <name>bzr GET existing distant project</name>
83+ <command>~/.config/Thunar/runcheckout.sh %F</command>
84+ <description>Fetch a copy of a project and put it in here </description>
85+ <patterns>*</patterns>
86+ <directories/>
87+</action>
88+<action>
89+ <icon></icon>
90+ <name>bzr COMMIT (save) any changes</name>
91+ <command>~/.config/Thunar/runcommit.sh %F</command>
92+ <description>Commit (save your changes) for this project</description>
93+ <patterns>*</patterns>
94+ <directories/>
95+</action>
96+<action>
97+ <icon></icon>
98+ <name>bzr STATUS of changes made here</name>
99+ <command>~/.config/Thunar/runstatus.sh %F</command>
100+ <description>Show the status of this project</description>
101+ <patterns>*</patterns>
102+ <directories/>
103+</action>
104+<action>
105+ <icon></icon>
106+ <name>bzr UPDATE here with distant changes</name>
107+ <command>~/.config/Thunar/runupdate.sh %F</command>
108+ <description>Update (fetch new files) for this project</description>
109+ <patterns>*</patterns>
110+ <directories/>
111+</action>
112+<action>
113+ <icon></icon>
114+ <name>bzr CREATE new project</name>
115+ <command>~/.config/Thunar/runnewproject.sh %F %F</command>
116+ <description>Makes a new project out of this folder</description>
117+ <patterns>*</patterns>
118+ <directories/>
119+</action>
120
121=== added file 'install_to_thunar.sh'
122--- install_to_thunar.sh 1970-01-01 00:00:00 +0000
123+++ install_to_thunar.sh 2019-06-06 15:37:14 +0000
124@@ -0,0 +1,39 @@
125+#!/bin/bash
126+
127+# Install the easybreezy actions into the dreadful uca.xml
128+# file for Thunar. Note, we cannot later simply uninstall
129+# because Thunar decides to add an id for each entry.
130+# World stupid day... the joy of XML
131+if [ -d ~/.config/Thunar ]; then
132+ cd ~/.config/Thunar
133+ # Preserve the old one, just in case...
134+ # Only copy the file if the backup does not exist
135+ if [ -f uca_xml.bak; then
136+ echo "Already a backup file (uca_xml.bak) - not overwritten"
137+ else
138+ cp uca.xml uca_xml.bak
139+ fi
140+
141+ # Copy the headers...
142+ grep "<?xml encoding" uca.xml > uca_easy_hdr.tmp
143+
144+ # Get shot of
145+ # <?xml encoding="UTF-8" version="1.0"?>
146+ # and
147+ # <actions>
148+ # and send the current contents as well.
149+ grep -v "<?xml encoding" uca.xml | grep -v "</actions>" > uca_easy.tmp
150+
151+ # Rebuild the file
152+ mv uca_easy_hdr.tmp uca.xml
153+ cat uca_easy.tmp >> uca.xml
154+ # Add the easybreezy actions...
155+ cat easybreezythunar.xml >> uca.xml
156+ echo "</actions>" >> uca.xml
157+ rm uca_easy.tmp
158+ echo "EasyBreezy scripts installed. You will need to restart Thunar to see them."
159+else
160+ echo "The directory ~/.config/Thunar does not exist"
161+fi
162+
163+
164
165=== modified file 'runcheckout.sh'
166--- runcheckout.sh 2019-06-05 10:13:30 +0000
167+++ runcheckout.sh 2019-06-06 15:37:14 +0000
168@@ -3,7 +3,9 @@
169 # THIS NEEDS bzr explorer installed for qcheckout-ala-explorer to work
170
171 # Pull in our default values
172-source ~/.local/share/nemo/actions/bzrdefaults
173+# Make sure they are from the correct directory
174+sourcedir="$( cd "$( dirname "$0" )" && pwd )"
175+source $sourcedir/bzrdefaults
176 # Make sure we are not already controlled...
177 if [ -d "$1"/.bzr ]; then
178 zenity --error --text="This directory ($1) is ALREADY a bzr-controlled project"
179
180=== modified file 'runnewproject.sh'
181--- runnewproject.sh 2019-06-05 10:13:30 +0000
182+++ runnewproject.sh 2019-06-06 15:37:14 +0000
183@@ -1,7 +1,9 @@
184 #!/bin/bash
185
186 # Import the default values...
187-source ~/.local/share/nemo/actions/bzrdefaults
188+# Make sure they are from the correct directory
189+sourcedir="$( cd "$( dirname "$0" )" && pwd )"
190+source $sourcedir/bzrdefaults
191 # Make sure we are not a controlled (top-level) directory
192 if [ -d "$1"/.bzr ]; then
193 zenity --error --text="This directory ($1) is ALREADY a bzr-controlled project"

Subscribers

People subscribed via source and target branches

to all changes: