Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-02-26 18:18:33

paul1149
Member
Registered: 2016-02-29
Posts: 25

Thunar custom action: Change file name to Title Case

Hi,

I have a custom action that changes the file name to lower case, and it works great:

for file in %N; do mv "$file" "$(echo "$file" | tr '[:upper:]' '[:lower:]')"; done

Is there something similar for Title, or Proper, Case? I tried the obvious substitutions, but they didn't work.

Thanks.

Last edited by paul1149 (2018-02-26 18:19:21)


MX19 Linux (debian buster) x64; Xfce 4.14.1; C2D; 2.8ghz; 6GB RAM; SSD.

Offline

#2 2018-02-26 19:02:49

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,492

Re: Thunar custom action: Change file name to Title Case

Try this:

for file in %N; do mv "$file" "$(echo "$file" | sed 's/.*/\L&/; s/[a-z]*/\u&/g')"; done

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-02-26 20:32:48

paul1149
Member
Registered: 2016-02-29
Posts: 25

Re: Thunar custom action: Change file name to Title Case

Awesome, ToZ. Thank you so much. That really nails it. This will get a lot of use. smile


MX19 Linux (debian buster) x64; Xfce 4.14.1; C2D; 2.8ghz; 6GB RAM; SSD.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 523.2 KiB (Peak: 524.05 KiB) ]