Skip to content

Commit d8b108d

Browse files
committed
Rework terminal tab logic; Add xfce4-terminal
1 parent 41ff93c commit d8b108d

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

src/budgie_desktop_view.vala

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public const string[] SUPPORTED_TERMINALS = {
4242
"konsole",
4343
"mate-terminal",
4444
"terminator",
45-
"tilix"
45+
"tilix",
46+
"xfce4-terminal"
4647
};
4748

4849
public class DesktopView : Gtk.ApplicationWindow {
@@ -475,7 +476,7 @@ public class DesktopView : Gtk.ApplicationWindow {
475476
// get_all_desktop_files will get all the files in our Desktop folder and generate items for them
476477
private void get_all_desktop_files() {
477478
var c = new Cancellable(); // Create a new cancellable stack
478-
FileEnumerator? desktop_file_enumerator = null;
479+
FileEnumerator? desktop_file_enumerator = null;
479480

480481
try {
481482
desktop_file_enumerator = desktop_file.enumerate_children("standard::*,standard::display-name", FileQueryInfoFlags.NONE, c);

src/file_item.vala

+19-10
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,25 @@ public class FileItem : DesktopItem {
233233
// konsole supports --new-tab and -e, --workdir WITHOUT equal
234234
// kitty supports --directory WITH equal
235235
// terminator supports --new-tab and -e, --working-directory (no -w) WITH equal
236-
// tilix uses just -e, supports both --working-directory and -w WITH equal
237-
if (
238-
(preferred_terminal != "alacritty") && // Not Alacritty, no tab CLI flag
239-
(preferred_terminal != "gnome-terminal") && // Not GNOME Terminal which uses --tab instead of --new-tab
240-
(preferred_terminal != "tilix") && // No new tab CLI flag (that I saw anyways)
241-
(preferred_terminal != "kitty") // No new tab CLI flag for Kitty, either
242-
) {
243-
args += "--new-tab"; // Add --new-tab
244-
} else if ((preferred_terminal == "gnome-terminal") && (_type == "file")) { // GNOME Terminal, self explanatory really
245-
args += "--tab"; // Create a new tab in an existing window or creates a new window
236+
// xfce4-terminal supports -e, --tab, --window, and --working-directory (no -w) WITH equal
237+
238+
switch (preferred_terminal) {
239+
// Terminals that use --tab
240+
case "gnome-terminal":
241+
case "mate-terminal":
242+
case "xfce4-terminal":
243+
args += "--tab";
244+
break;
245+
246+
// Terminals that use --new-tab
247+
case "konsole":
248+
case "terminator":
249+
args += "--new-tab";
250+
break;
251+
252+
// Terminals that don't support tabs
253+
default:
254+
break;
246255
}
247256

248257
string path = file.get_path();

0 commit comments

Comments
 (0)