The officially official Devuan Forum!

You are not logged in.

#1176 Re: Other Issues » [SOLVED] Need a lil coding help with an extension (shell script), openbox/pcman » 2021-03-20 19:48:24

Okay so, even stranger....

Last night when I got home and started messing with it, I decided to double-check whether quoting changes would help, and I must never have tried replacing the single-quoted string in the .desktop with double quotes, and lo and behold it fixed it!  but....

1. I don't know why that would fix it and would really like to understand why...no biggie but....

2. I have an almost identical extension that works the same way only it provides a "rotate image" function instead of re-sizing, so after fixing the first one I thought YAY this should fix the other too...but it didn't, still fails on spaces in file/folder names...what the actual heck???

Here's the new re-size .desktop and it works perfectly, zero issues now:

[Desktop Entry]
Type=Action
Name=Resize Image
Comment=Shrink image and convert to jpg
Icon=edit-cut
Profiles=resize;

[X-Action-Profile resize]
Exec=sh -c "cd %d && shrink2 %f"
MimeTypes=image/bmp;image/jpeg;image/png;

And here's the .desktop for the rotater,did the same thing, changed the single quotes to double quotes, again the only change I made:

[Desktop Entry]
Type=Action
Name=Rotate Image
Comment=Make rotated copy of image
Icon=edit-redo
Profiles=rot;

[X-Action-Profile rot]
Exec=sh -c "cd %d && rot %f"
MimeTypes=image/bmp;image/jpeg;image/png;

As you can see, pretty much identical...dunno why it won't work here when it did on the other...here's the script for the rotater:

#!/bin/sh

rotbox=$(yad --fixed --window-icon=edit-redo --form --title="Rotate Image" --field="Rotate:":CB --width=300 --text-align=center --text="Select rotation (clockwise, in degrees)" '90!180!270')

rot=$(echo $rotbox | awk 'BEGIN {FS="|" } { print $1 }')

convert $1 -strip -rotate "$rot" -set filename:copy '%t-rotated.%e' '%[filename:copy]'

# Depends: yad, imagemagick
# (note: later versions of imagemagick may require a different command than 'convert')

# DESCRIPTION:
# This script makes a copy of an image file (JPG, BMP, PNG), rotates the copy to
# selection entered in yad dialog (90, 180 or 270 degrees clockwise), adds "rotated" to 
# the original filename, and outputs the copy into the same directory as the original. 
# It is intended to be used with a .desktop file for activation in PcmanFM to offer a "Rotate Image"
# option when you right-click an image file, but can also be used in terminal: rot [img file]

#1177 Re: Other Issues » [SOLVED] Need a lil coding help with an extension (shell script), openbox/pcman » 2021-03-19 20:30:56

Thanks y'all!

First thing I tried was all kinds of quotes around the %f and %d and didn't work for me, but will go back and try again to be sure, normally that works in terminal but seems like it wouldn't work here because the entire command string is quoted.

@dice: cd is to first change the directory to current one, or it will drop all output into the home folder regardless of what directory you're in.

Okay, just tried the recommended double quotes again, still no joy.

@Golinux: Hi there Lady! Hope all is well down there, FYI we may be moving back home soon, so maybe i'll get to see ya! ;-)

#1178 Other Issues » [SOLVED] Need a lil coding help with an extension (shell script), openbox/pcman » 2021-03-18 21:14:14

greenjeans
Replies: 10

Hey guys, been out of touch for a long time now, big moves, covid, etc. been getting in the way of my linux'ing...anyhoo, had a question about some extensions i've been using and working on again and need some help if anybody has time. I'm still a terrible rookie coder, lol, trying to leanr more though.

Here's the main one, it's a right-click context menu extension for pcmanfm that re-sizes pics using imagemagick for the backend and yad, super-handy and fast, and works perfectly...except...spaces in file or folder names break it, and can't seem to fix it with usual methods. I can finagle it into working with spaces in filenames but then it drops all output into home folder instead of current directory and no amount of cd or mv commands seems to make it work right. I'm pretty good about not putting spaces in file/folder names, but ya know, would be nice if it didn't break script.

Here's the code, a .desktop file that goes into /home/user/.local/share/file-manager/actions and the script I made (usr/bin):

[Desktop Entry]
Type=Action
Name=Resize Image
Comment=Shrink image and convert to jpg
Icon=edit-cut
Profiles=resize;

[X-Action-Profile resize]
Exec=sh -c 'cd %d && shrink2 %f'
MimeTypes=image/bmp;image/jpeg;image/png;
#!/bin/sh

sizebox=$(yad --fixed --window-icon=edit-cut --form --title="Resize Image" --field="Resize to:" --width=400 --text-align=center --text="Enter new size (W x H in pixels, i.e. 800x600, 1024x768 etc.)")

size=$(echo $sizebox | awk 'BEGIN {FS="|" } { print $1 }')

convert "$1" -resize "$size" -set filename:copy '%t-%wx%h' '%[filename:copy].jpg'

# Depends: yad, imagemagick
# (note: later versions of imagemagick may require a different command than 'convert')

# DESCRIPTION:
# This script makes a copy of an image file (JPG, BMP, PNG), resizes the copy to whatever
# dimensions are entered, converts it to a JPEG, adds the new dimensions to the original
# filename, and outputs the copy into the same directory as the original. It is intended to
# be used with a .desktop file for activation in PcmanFM to offer a "Resize Image"
# option when you right-click an image file, but can also be used in terminal: shrink2 [img file]

Thanks!
~greenjeans

#1179 Re: Off-topic » Did anyone else come from crunchbang? » 2019-02-11 20:18:55

I loved me some Crunchbang, favorite distro for several years, it's part of what made me want to make Vuu-do, and it is unabashedly crunchbang-ish. Only thing I didn't like was dealing with the menu, that's why I went with obmenu-generator.

#1180 Re: Devuan Derivatives » Vuu-do Linux! *New Openbox-64 iso's (1.0.7) up 2-02-18*!! » 2019-02-09 22:18:06

Hey guys, long time, you know how life gets in the way of linux sometimes, lol.

Just updating my intentions in case anyone is still interested in Vuu-do, I originally made Vuu-do to be an ultra-stable LTS version, with both parent distro (Devuan) and the kernel being LTS until 2020, and that's what it still is, haven't made any updated isos in a year, but all my machines on it are still running very smoothly, so I haven't seen a need. I usually just roll these mini-distros for myself once about every 3-5 years anyway.

I haven't messed with Devuan 2.0 much, and haven't seen a need to do so as i'm not quite ready to start making a new Vuu-do, so most likely scenario for the next Vuu-do will be Beowulf (Devuan 3) or even the version after that, depends on the support level for both the distro and the kernel, really wanting to stick with building on a stable LTS platform.

So though i'm gonna start playing with the new stuff this year, it will be early 2020 most likely before there is a new Vuu-do version. Takes me a ridiculously long time to do this stuff, lol, so it will probably take all year for me to get it right.

Hope everybody has been doing well! Have missed hanging out with y'all!

Much love,
~greenjeans

#1181 Re: Devuan Derivatives » [MiyoLinux] MiyoLinux Accessories website » 2018-03-13 20:40:00

Hey I zipped up the extensions I use in pcmanfm and they are on my SF section, feel free to add them to your accessories if you feel like anyone could use them.

I need to document a tad better, also need to update a little code to work with newer Imagemagick before I make an ascii version of a couple of them, the current stuff all works 100% with jessie.

#1182 Re: Devuan Derivatives » Refracta Installer needs testers. » 2018-03-12 22:00:33

ON IT!

If you had donate button somewhere, i'd send you beer money wink Thanks for all you do FSR!

#1183 Re: Other Issues » policykit-1, polkit, polkitd authentication problems » 2018-03-09 22:29:38

Re-posting what I just posted from another pertinent thread:

I've never had to do anything extensive the times i've had a permission issue with polkit, edit the files in /usr/share/polkit-1/actions/ directly, you can spot the relative entries, it may not be the correct way, but it's quick and it works perfectly. The bolded part on a couple of entries in the udisks2 policy is all it takes.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/Po … config.dtd">
<policyconfig>
  <vendor>The udisks Project</vendor>
  <vendor_url>http://udisks.freedesktop.org/</vendor_url>
  <icon_name>drive-removable-media</icon_name>

   <action id="org.freedesktop.udisks2.filesystem-mount">
    <description>Mount a filesystem</description>

    <message>Authentication is required to mount the filesystem</message>

    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

#1184 Re: Hardware & System Configuration » AMD Radeon RX 480 On Devuan » 2018-03-09 22:21:57

I've never had to do anything extensive the times i've had a permission issue with polkit, edit the files in /usr/share/polkit-1/actions/ directly, you can spot the relative entries, it may not be the correct way, but it's quick and it works perfectly.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/Po … config.dtd">
<policyconfig>
  <vendor>The udisks Project</vendor>
  <vendor_url>http://udisks.freedesktop.org/</vendor_url>
  <icon_name>drive-removable-media</icon_name>

   <action id="org.freedesktop.udisks2.filesystem-mount">
    <description>Mount a filesystem</description>

    <message>Authentication is required to mount the filesystem</message>

    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

#1185 Re: Other Issues » Intel HD Audio Is Not Working (Ceres) » 2018-03-06 20:46:39

You can do that in alsa as well, I see it fairly often as a lot of machines have an hdmi output in addition to the regular one and alsa defaults to using card 0 which is usually the HDMI output, simple solution is adding an .asoundrc file in your home folder:

pcm.!default {
        type hw
        card 1
 }

ctl.!default {
        type hw
        card 1
 }

(Note: I know you solved your problem, i'm just posting this additional info for other folks who might be looking for solutions and read this thread)

Geoff 42 wrote:

Yes, a lot of people would stop after the apt-get remove pulseaudio ;-)

It seems that many machines these days have an HDMI sound outlet, which is often shared with a normal outlet, using the snd-hda-intel kernel module. This seems to cause problems. If you don't need the HDMI sound then disabling it makes things simpler, using the enable option :-

http://forums.debian.net/viewtopic.php?t=110572#p525601

Geoff

#1186 Re: Other Issues » Intel HD Audio Is Not Working (Ceres) » 2018-03-05 21:59:25

Or delete pulseaudio completely and use ALSA. wink

#1187 Re: Desktop and Multimedia » Help With Sudo and Asking For passwords When necessary » 2018-03-05 21:58:06

Not for nothing, but some livecd's write a sudo-nopassword entry for the duration of the live session so the user can use everything freely, but doesn't delete that entry when you install it, it breaks pkexec, and pkexec being the POS it is, when it breaks it defaults to allowing program to open with no password.

#1188 Re: Devuan » Why are systemd files present in Devuan? » 2018-03-05 21:53:52

Good info Golinux!

Lots of examples of this, I personally try to NOT use Pulseaudio, but installing VLC drags in libpulse, not because VLC won't work on ALSA, but so it can communicate if need be with another machine on a network that does use it. So in practice it's never used expect for the above scenario. I simply deleted most of the pulse files and made it into a dummy package. Not that it wasn't a dummy to start with. wink

#1189 Re: News & Announcements » Devuan 2.0 ASCII Beta is here! » 2018-03-05 21:48:02

yeti wrote:
greenjeans wrote:

(((...))), if you don't trust yourself to be root on your own machine then I don't know what to say to that. wink

I trust me in a shell but not separated from the system by a GUI.
Well... maybe better saying: I don't trust GUIs.

I think some of the people here and everywhere in the 'nix world that possess a lot of technical acumen and skill with computers, tend to forget that not everyone uses their computer that way, and not everyone develops exclusively for geeks like us, lol.

One of the primary reasons I do it, is for friends, family, and people in my community who don't have the money (for the dozenth time) to take their machine to a PC repair place and have it wiped (for the dozenth time) to get rid of all the garbage that has destroyed windoze (again) only to have the tech load freakin load windoze on it (again). The definition of insanity being doing the same thing again and again expecting a different result.

Most of these people don't have the time to learn what we know, they just want a simple GUI interface to everything, drag-n-drop functionality, a system of doing things they are basically familiar with and a small learning curve.

So that is always uppermost in my mind while developing. And so it stands to reason that while developing I should do as much as possible with GUI's myself, so as to constantly be able to test and verify that these systems work as intended, and if they DO get interested in learning more about linux and want to start experimenting themselves, it's very easy with the tools I have provided and is robust and well-tested.

I am already really pushing the envelope trying to convert windoze refugees to linux using Openbox, lol, I don't want to scare them off completely by taking away their GUI's.

#1190 Re: News & Announcements » Devuan 2.0 ASCII Beta is here! » 2018-03-03 23:17:23

cynwulf wrote:

I've just no idea why you'd need to run an X11 file manager as root?  Can't see how it would effect "workflow", can't see the scenario where "work" involves being in a file manager as root...  what are you doing?

Developing. I use this function constantly, it's super-easy to add/delete/modify/destroy-system-cruft when "Open as admin" is right there in the context menu, it absolutely speeds my workflow....I really don't understand why anyone would NOT make this available to themselves, if you don't trust yourself to be root on your own machine then I don't know what to say to that. wink

Trust me on this CW, it helps a LOT. Have had lots of people thank me in fact for making it so accessible in my systems. Possibly you and others use their machine differently, please don't discount this effective tool because you personally do it a different way.

#1191 Re: Devuan Derivatives » Vuu-do Linux! *New Openbox-64 iso's (1.0.7) up 2-02-18*!! » 2018-02-25 23:41:33

Thanks for the kind words Stanz!!

Not sure why it's showing 27.6.2 on yours, is it the latest one? I just checked the build partition to be sure and it's showing me 27.7.2 as is this partition.

#1192 Re: Installation » Palemoon installation from source » 2018-02-25 21:07:36

Or you could just install the .deb package, seems much simpler.

#1193 Re: Desktop and Multimedia » alternative to mate-power-manager for ascii? [SOLVED] » 2018-02-25 20:52:13

The XFCE power manager also works pretty well for me.

The mate power manager is a disgrace, everything is grayed out, none of the functions really work, I recommended it be dumped from the repo months ago.

Mate has really disappointed me in the last year, not only are longstanding bugs still not fixed, there are regressions now that are a big PITA. It's gotten way worse as they have progressed to GTK3, it's almost as bad as Gnome now, and with good reason as they are no longer anything like a fork of gnome 2, they are simply falling into line with the new gnome glitchware. It's embarassing really, windows 7 is more stable.

#1194 Re: News & Announcements » Devuan 2.0 ASCII Beta is here! » 2018-02-25 20:40:33

mckaygerhard wrote:

we cannot fork all that are "eating" by the systemd monster! we must thing in less work due are directed respect the amount of developers/manpowers

What's this "we" stuff? Are you part of the Devuan development team? You certainly don't speak for me, i'm quite capable of forking over systemd. wink

mckaygerhard wrote:

FOR NOW SUDO HANDLE DIRECTLY THE RIGHTS FOR XAUTHORITY.. but runs app as root user are stupid.. there's a userspace for taht, there's the main reason of the dissapear of gksu

Well I don't use sudo in the first place, nor pkexec, giving a user any sort of admin rights is a silly security risk IMO,  it defeats the whole purpose of having separate user/admin accounts, but whatever works for you....personally I use su for everything, but I will always give people who use my project the option of using sudo if they like. Gksu WILL be forked and that's what i'll be using.

That "we can't" crap is for those who blithely accept the status quo even if it's garbageware. In case you hadn't noticed, Devuan is a can-do distro. Might want to take that defeatist attitude elsewhere, Redhats love that stuff, i'm sure they'd welcome your compliance with open arms.

#1195 Re: News & Announcements » Devuan 2.0 ASCII Beta is here! » 2018-02-24 21:05:24

golinux wrote:
greenjeans wrote:
fungus wrote:

gksu gksudo will be removed from debian repositories.

Well good lord, does the stupid never end?

It stops here.  We can fork those those functions.  big_smile

You freakin ROCK Golinux! wink

#1196 Re: News & Announcements » Devuan 2.0 ASCII Beta is here! » 2018-02-22 20:24:19

fungus wrote:

gksu gksudo will be removed from debian repositories.

Well good lord, does the stupid never end?

There's nothing wrong with gksu, it has never failed me, while pkexec has caused multiple issues, I delete that garbage regularly.

It's sad really, I have really liked Debian for a long time and appreciate their efforts usually, but I just did a test install of 9.3 using the Mate desktop on a late model laptop, and it's so buggy I almost did a video about it but didn't figure it would help any....horrible, worst version of Debian i've ever used.

So glad Devuan is here, that experience the other day really underscored how great my results have been with Devuan, working on a new Vuu-do now that will be the first EFI version, and the minimal version at least will be translatable in 2.0.0. Gonna be trying out some of the new options too, eudev, elogind etc. It's awesome how we are all growing and getting better here. smile

Great times, tough for sure, but challenge drives innovation and Devuan is the tip of the spear. wink

#1197 Re: Off-topic » Devuan Ascii - NETINST ISO Size » 2018-02-18 22:13:27

It starts with the kernel, which is 25 mb larger than the 3.16 kernels.

Continues with larger packages for firmware, drivers, X, etc. etc.

Next, it's important to understand that not everything on that iso is going to be installed when you build your system, there's LOTS of things you won't use. Using grub? Then you won't need lilo which is available on the disk, lots of other examples of this.

Want a 100 mb install iso? You can maybe build one if it's a CLI-only builder iso you want, but it will take some work for sure, I would abandon the netinstall idea and just roll up your own using Refracta-Snapshot.

Use the netinstall iso, do not install any DE's or printer support etc, once installed a lot of stuff will go bye-bye on it's own, then purge any other stuff you don't want, install Refractasnapshot and Installer + depends, clear out the cruft and squash you a nice lightweight base iso. wink

#1199 Re: Devuan Derivatives » Vuu-do Linux! *New Openbox-64 iso's (1.0.7) up 2-02-18*!! » 2018-02-13 22:03:54

Working on EFI Vuu-do now...arrgh...lol. But needs to be done I guess.

#1200 Re: Devuan Derivatives » Lightdm background/theme fix for Miyo-XTRA 2018 » 2018-02-13 21:54:18

MiyoLinux wrote:

Whew...I'm thinkin' of locking desktop-base for awhile! LOLOLOL!!! tongue

I threw the whole package outta Vuu-do, lol, just so I wouldn't have to deal with this stuff. wink

Not that I don't like purpy and all....:D

Board footer

Forum Software