Xfce

Subdomains
 

GSoC’22 – [Part 3] Tree-View in Thunar

  • October 30, 2022
  • Amrit Borah

About the Feature

This feature aims to enable the user, when in list-view, to expand non-empty folders (as shown in the image above).

Additions & Behaviors,

  • An entry has been added to the preferences dialog under Display > View Settings to define the default behavior when a new tab/window with list-view is opened.
  • When a new tab/window is opened with the list-view as the active view, it will respect the above mentioned setting for the tree-view option and default to that.
  • This feature can be toggled on and off using the Enable Tree View entry under the View menu but this only affects the currently active tab/window.

 MR: https://gitlab.xfce.org/xfce/thunar/-/merge_requests/297 

Note: This feature hasn't yet been merged.

I am working with  Sergios Anestis Kefalidis (@SKefalidis), Yongha Hwang (@MShrimp4) and Alexander Schwinn (@alexxcons) to have this feature out swiftly 😁.

 


GSoC’22 – [Part 2] User Profiles in Xfce-Terminal

  • October 23, 2022
  • Amrit Borah

User-Profiles in Xfce-Terminal

Note: This feature has not yet been merged. The UI/UX have been finalized but there are some internal implementations that are being reviewed.


MRhttps://gitlab.xfce.org/apps/xfce4-terminal/-/merge_requests/57

The Task

The aim of this feature is to enable users to create multiple different profiles. A profile is just a combination of preferences.

This allows the user to quickly switch between predefined profiles when the need arises.
As a use case scenario, let us consider the following example. One might want to have one particular tab transparent. So one can just create a new profile and change the transparency value on that profile. Then proceed to switch the profile by selecting the desired profile form the newly added "Profiles" menu.

Some considerations on the behavior of this feature,
  • There has to exist at-least one profile.
  • Terminal creates a "default" profile if no profiles are found on the system. Old configuration will be migrated to this profile.
  • One of the profiles is set to be "Default", i.e each new tab or window is opened using this profile. So if one wishes to change profile on a particular tab/window then one can just do so by selecting the desired profile from the Profiles menu.

On the implementation

  • Xfce4-terminal will now be using Xfconf as backend for storing and organizing settings.
  • The TerminalPreferencesDialog, which was previously written using glade, has now been re-written in C as an attempt to make it easier to work on it.
  • A new setting has been added that allows users to specify the orientation of the tabs of the preferences dialog. In the picture above I have set it to the "Left".

 

Work Left

  • I am closely working with my Mentor Sergios to fix a synchronization bug: mismatch in background images when multiple windows are open.

GSoC 22 – The Closing Blog Post

  • October 21, 2022
  • Pratyaksh Gautam

In the summer of 2022, I participated in Google’s Summer of Code, contributing to the Thunar file manager at XFCE, with the help of my mentor Alexander Schwinn. It’s been about a month since my GSoC term was officially over, and after a hectic couple weeks, I’ve finally decided to sit down and write down the closing blog post.

New features in Thunar

I’ll start off by introducing the features that I worked on, and a rough idea of how the implementation for the same works. Of these, undo-redo and file counts for folders are already merged on master and have been released with Xfce 4.18. The tour probably does a much better job than I will here, so be sure to go through it as well!

Undo-redo

This is the big one. While adding support for undo and redo, one of the most crucial things for me was doing it in an elegant way that would make it easy to have multi-level undo and redo.

How we decided to do this was to maintain a global linked list, containing information about the last performed operation, including what type of an operation it was, what files were involved in it, etc. This allowed it to be as trivial as moving a few pointers around to keep track of the state of the system once an undo or a redo is performed. The actual undo/redo operation is simply executing either the inverse of the last performed operation, or executing the exact same operation that was last undone.

I’m of course glossing over a lot of the details that made this a fair bit harder than we had initially anticipated. Nonetheless, with some help from Alex, we were able to ship this in time for the 4.18 release! :raised_hands:

File counts for folders

Adding file counts for features was just a little addition to help better utilize the ‘size’ column for folders, which was essentially wasted space earlier.

It was essential to be asynchronous with its implementation, which turned out to be a bit trickier than I had initially expected. It mostly boiled down to a line of conversions between file abstractions that I had taken for granted would have a low overhead (spoiler alert: they did not have a low overhead).

I was less than confident when first approaching Gallery view, since I thought I’d have to create an entire view from scratch. Luckily, that really wasn’t necessary. I was able to make a new view based off the same abstract view class that the existing icon view used. This is probably better for multiple reasons, since building on existing things makes for much simpler design for the new additions, and easier code review as well.

While I initially had envisioned a masonry image gallery, like the kind you would see on sites such as Pinterest, the abstract icon view lent itself much better to a square icon based gallery, similar to what most Android phone galleries have by default these days.

The gallery view PR is not yet merged into master, needing a few minor fixes on the dialog tooltips (which I’ve sadly been a bit too busy to work on yet), before it’s completely ready.

Not all smooth sailing

While I had initially hoped to complete what I had mapped out in my GSoC proposal in my summer vacations itself, that didn’t work out as intended. Once my semester at college started, I started struggling a bit to balance my academics and my GSoC commitments, but I was steadily making progress.

GSoC being flexible with its contributor timelines this year was an absolute life-saver, since I had to extend my deadline multiple times in order to hit the milestones on my proposal.

The lowest point was when in the midst of all this, some personal family issues cropped up and I essentially went incommunicado for almost a week. This would’ve been enough to fail my proposal in some organizations, but Alex still gave me a chance to make up on lost time when I was back, and for that I’m incredibly grateful. I was able to capitalize on this opportunity and get plenty of work done, though it was really quite hard (and probably not very good for my health long term :sweat_smile:).

Advice for others

I recently received an email from someone who was looking to contribute to XFCE in this year’s GSoC, and wanted some advice. I’ll relay part of what I wrote back over here:

I’d say the most important thing is to dive into it while still knowing that you don’t know anything :P

Try at a problem with your intuition for what might work. If you get stuck, push for another 15-20 mins and note down what you try. In this time you should be consulting documentation, StackOverflow, Github issues etc.
If you still aren’t able to figure it out, send a message on the XFCE IRC/Matrix channel, and be descriptive about what you tried, why you think it should work, and why you think it might not have worked. The mentors are incredibly helpful, and you’ll often get an answer that will deepen your understanding of the system and coding in general.

In addition, I’d also like to stress that communication is key!. Your mentors are there to help you, and they want nothing more than a successful and productive summer for the both of you. Raising issues that you’re facing as early as you can allows the both of you to think about and discuss how to tackle them.

Acknowledgements

I’m incredibly grateful to my mentor Alexander Schwinn, who is one of the most helpful people I’ve had the pleasure of working with. He’s been incredibly kind and polite, more than one could reasonably expect out of anyone given the circumstances.

I’m also very thankful for all the help I’ve received from the dedicated XFCE community, including Sergios Kefalidis, Yonghwa Hong, Gaël Bonithon, and many others.

Finally, I’d like to thank Google Summer of Code for the wonderful opportunity, which has definitely been a fantastic hands-on learning experience for me.

Wallpaper Contest for Xfce 4.18 – End of submissions

  • October 20, 2022
  • Alexander Schwinn

Nov 20,2022

Wallpaper Contest for Xfce 4.18 - End of submissions

The submission deadline for the Xfce 4.18 wallpaper contest just ended, and I am happy to see that many submissions!

Starting by now, one week of voting will show which wallpapers are the most popular ones.

In order to cast your vote, login at gitlab.xfce.org and add a ❤️ or 👍 reaction to all wallpapers you want to upvote.

Please keep in mind that you should vote for the best wallpaper, not for the best picture. E.g. it makes sense to leave some free space where desktop items can be placed.

Voting will be closed on 27. November. Like that, the new wallpaper can be utilized for the Xfce4.18 pre2 announce, which is planned for beginning of December.

Happy voting !

Thunar: Image Preview and Hidden Preferences

  • October 10, 2022
  • Sergios - Anestis Kefalidis

  Welcome back, it's been a while!

Where have I been?

I haven't had much time to actively contribute to Xfce in the past few months. Between mentoring Amrit for GSoC and completing my undegraduate thesis, I wasn't able to write patches at my normal pace. Things have started to pick back up, now that I've finished my undegraduate studies. I still won't be able to work on Xfce as much as I used to. In addition to starting my Master's degree, I have joined the AI Research Team of the University of Athens. Nonetheless, I will continue to maintain Xfce Terminal and contribute to Thunar and other core Xfce components. Now that this is out of the way, let's talk Thunar!

Image Preview

  Thunar just got an image preview, hooray! Well, actually, Thunar now has two images previews. The user can select to use a standalone image preview pane, which also shows some details about the files (work in progress), or use an image preview that is embedded in the left sidepane.

Embedded Image Preview

Embedded Image Preview.

Standalone Image Preview

Standalone Image Preview.

Eliminating Hidden Preferences

  In my previous blog post, I wrote about wanting to eliminate hidden preferences, which I consider bad design. I've been working on a solution for both Thunar and Xfce Terminal, that reuses code from the Xfce Settings Editor. Instead of hiding preferences, all preferences that are considered secondary/niche, or don't fit in the existing tabs of the Preferences Dialog, we moved them to a new tab.

Miscelaneous Preferences

Miscelaneous Preferences.


Previous post

GSoC’22: The Final Report

  • September 19, 2022
  • Yogesh Kaushik

My days as a GSoC mentee have ended, and I would like to share everything I have done during these days and what is left. I have posted a few blogs already, so if you have read them, you already know what I have done, and thus you can skip to the last section.

Thunar

(MR #267)

The Bulk Renamer, although very well functional, had a flaw. In case of a new name for a file matches the original name of a file that is yet to be renamed, then the Bulk Renamer used to fail. But now, I have modified it so that it can resolve any such kind of dependencies.

This new enhancement has been successfully added to the Thunar. More details about how this enhancement is added can be found in my blog (GSoC'22: Making Thunar Bulk Renamer More Advanced)

Screenshooter

(MR #37)

Screenshooter had some predefined options that users could choose from once the screenshot was taken. But now, the user can execute a custom action. This new feature has been successfully added to the Screenshooter and tested quite well. More details about this can be found in my blog (GSoC'22: Adding Custom Actions to Screenshooter)

Panel Plug-in

(MR #101) (MR #99)

Panel had an external plug-in Date Time and an internal plug-in Clock. These two plug-ins were somewhat overlapping, and now all the features of these plug-ins are merged into the Clock plug-in. The clock plug-in can now show the date and the time, and the font is also customizable. This merge is almost completed and is just left for the final reviews. Pretty soon, it will be present in Panel 4.17.4.

The Future

An extended goal was proposed to add command line support for the custom actions. Even though my coding period under GSoC is ending, I wish to complete that extended goal to make the custom actions feature more accessible for the users.

GSoC’22: Adding Custom Actions to Screenshooter

  • September 17, 2022
  • Yogesh Kaushik

The Task

Screenshooter (xfce4-screenshooter), as the name suggests, is an application that takes screenshots. Some action is needed once the screenshot is taken on the captured image. Currently, the application provides four well-defined actions: to save the picture, open the image, copy it into the clipboard, and upload it to Imgur. But some users may want to perform other specific actions after taking the screenshot, such as printing them or sending them over an email. So the task was to allow users to add custom actions that can be executed once the screenshot is taken. Similar functionalities are also present in Thunar and AppFinder.

The Solution

The solution was quite simple. We can have a list of user-defined custom actions stored in the system. Each element in the list will denote a custom action and will have attributes "name" and "command". The "name" attribute stores the string that will be displayed to the user when selecting the custom action. And the "command" attribute is the command that will be executed. The command can have a '%f' placeholder that can be used to get the absolute path of the screenshot captured. For storing this list, xfconf was used. Each custom action has a unique id associated with it. So if that unique id for a custom action is 'i' then its attributes are stored as "actions/action-i/name" and "actions/action-i/command". The rest of the solution includes providing a simple user interface to modify this list and executing the command.

Under The Hood

With the help of my mentor, André Miranda (AndreLDM), this solution was successfully implemented in MR #37.

The first part of implementation involves creating a preferences dialog box that can be used to modify the list of custom actions. It must be noted that whenever the dialog box opens, it reads the data from the hard disk, and whenever it closes it stores the data back into the disk. This dialog box allows users to add, delete and modify custom actions.

The next part was to add an option for selecting a custom action to be executed once the screenshot was taken. Here again, the list of custom actions is read from the system, but it is never written back as no modifications are done to it. This option is only shown if there are custom actions in the list. If, instead, the list is empty, then this option is not offered. Once the user selects the custom action, its name and command are stored in the ScreenshotData structure.

Then comes the most crucial part, where the custom action gets executed. Here we don't read the list, just the command and name stored in the ScreenshotData structure. The absolute path of the image first replaces the placeholder text. Then "g_spawn_async" is used to execute the command asynchronously. It's done asynchronously so that the command may not block the application.

This implementation's beauty lies in how we have used the already implemented code. Once the image is captured, it is stored in the /tmp directory using the "Save" option. Then the execution part happens. So under the hood, two actions are occurring from the action selection dialog box.

GSoC’22 – File Highlighting in Thunar

  • August 13, 2022
  • Amrit Borah

 

About the feature

  • The aim of this feature is to enable the user to highlight files/folders across the various different views.
  •  The feature can be toggled on/off through the View Menu.
  •  The highlight color can be selected by navigating to the Highlight tab in the properties dialog of the respective file. The properties dialog can be brought about by selecting the Properties option under the Context Menu  (Right click on the desired file/folder to show the context-menu)

Requirement: GVFS (Gnome Virtual File System)

 Implementation

  • The biggest challenge was figuring out how to paint the highlights on the various different views.
  • The solution was to use a GtkCellLayoutDataFunc that is called on each item of the view. This way we can set the specific background color in the CellRenderer for each of the different items on view.
  • Another challenge that came up was implementing the rounded corners.
  • For this, modifications were made to the IconRenderer & a new custom TextRenderer was introduced. The trick was to use cairo to clip the backgrounds & paint the specific color.

 This feature is possible with the support by Thunar's lead developers - Alexander Schwinn (alexxcons), Sergios - Anestis Kefalidis (SKefalidis) and Yongha Hwang (MShrimp4).



GSoC’22: Making Thunar Bulk Renamer More Advanced.

  • July 10, 2022
  • Yogesh Kaushik

The Task

Most of you would be aware of bulk renamer, a handy plugin in Thunar to rename many files together. The plugin is already very advanced and can perform many complex tasks. But sometimes, performing those tasks required more user interference than expected. Consider a case where you are renaming two files, and the new name for one file matches the old name of the second file. Now, no issue arises if the second file is renamed first, and the bulk renamer works perfectly. But if the first file is renamed, it throws an error message as the filename already exists. In the case of two files, the user can resolve such errors manually, but it can become a very tedious task for a large number of files. So the job was to make the bulk renamer intelligent enough to identify the best order in which the files should be renamed so that all such errors are resolved entirely. A trivial usage case for it

is to be able to rename files named file4, file5 ... file13 to file1, file2 ... file10.

The Solution

Sorting is a critical player in the entire solution. The bulk renamer now tries three runs to rename a file. In the first run, the files are renamed in the user-specified order. If some files are not renamed successfully in this run, then the bulk renamer moves for the second run. Before starting the second run, all the failed files are first sorted in ascending order according to their current name. And then it tries to rename them again. But if still some files fail, it moves to the third run. Here the files are first sorted in reverse order and then renamed. The user is shown an error message if a file is still falling.

Under The Hood

With the support of Thunar's lead developers Alexander Schwinn (alexxcons), Sergios - Anestis Kefalidis and Yongha Hwang (MShrimp4), the solution is implemented successfully. Implementing the three runs and sorting was not much of a big deal. But the real deal was to manage all the other systems that broke down due to the changes. One of the noteworthy was the undo option. But after rigorous manual testing, the entire system is working correctly and ready to be used by general users. I hope this advancement will highly benefit the users.

With this done, it's time for me to move on to my task for Xfce-Screenshooter.

GSoC 22 – The First Blog Post

  • May 28, 2022
  • Pratyaksh Gautam

I’m really looking forward to this summer, since my project proposal for this year’s Google Summer of Code has been selected! I’ll be working on adding features to Thunar file manager, an XFCE application, with the help of my mentor Alexander Schwinn.

My history with XFCE

I’ve been big on open-source ever since my school days, and actually ran Xubuntu (an Ubuntu distribution with XFCE as its desktop environment) on my daily driver, an old netbook back in eleventh grade. It was too slow of a device to run GNOME, so I absolutely had to use a lighter-weight desktop environment, and compared to alternatives like LXDE which I didn’t like the aesthetics of, and pantheon (the default DE for elementaryOS) which still felt lacking in terms of performance, XFCE was the perfect balance of form and functionality.

Since then, I’ve done some distro-hopping before settling on my current setup, hand-rolled with awesome window manager and no DE. While I generally prefer to use the command-line, Thunar has been by GUI file manager of choice ever since I started using this setup a little over 2 years ago. It’s fast, light-weight, and gets the job done without getting in your way, which is exactly what I need.

Planned features

Thunar does however lack a few features that would be really handy to have, which is exactly what I’ll be working on.

Undo-redo

Adding undo and redo is an absolute no-brainer for me, and would probably be the single biggest thing I think Thunar is currently missing. If you’re anything like me, you’ve often selected the wrong file to move into another directory, and you have to manually undo it and move the correct file once you realize your mistake. Implementing this would do away with such frustrating tedium in the case of minor mistakes.

File counts for folders

Currently, the list view in Thunar has a ‘size’ column which shows the size of the corresponding file in the listing. However, this column is blank for folders (or directories). As such, it’s essentially wasted space for directories, but it could be put to good use showing the count of the files in the folder instead.

Picture-specific maximized thumbnail view

Managing pictures is primarily based on the content of the picture itself, rather than metadata like the name, date etc. So it would be very convenient to have a specific view optimized for folders with a large number of pictures, where the thumbnails take up as much space on the screen as possible. Think Pinterest, Google images etc.

If somehow I complete the work enlisted in my proposal ahead of time, I plan on looking at some of the file system synchronisation bugs that some Thunar users have reported.

Conclusion

I’m glad to have the opportunity to be able to work on open-source tools I myself use everyday, and feel really lucky to have the support of Google to be able to work on this over this summer. I’m really grateful for the help I’ve gotten along the way to getting my proposal accepted from Sergios Kefalidis, Alexander Schwinn, and other members of the XFCE community.

I’d like to congratulate my fellow XFCE GSoC contributors Yogesh Kaushik and Amrit Borah as well (who coincidentally are also from different IIITs :grin:).