date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,329,822,011,000 |
What is the effect of setting immutable bit on /boot partition with perspective of security.
is it advisable to set the immutable bit (-i) to everything under /boot? Will it enhance or degrade the system security?
I would like to go further and do the same for other "precious" files like /etc/bind/named.conf, etc.
|
TL;DR
Don't do this unless you have peculiar auditing requirements. It's generally more trouble than it's worth.
Explanation
The only account that should have write access to /boot is root. If you have root, you can unset immutable bits and pretty much do what you want anyway.
The major downside of mounting /boot read... | What is the effect of setting immutable bit on /boot partition [closed] |
1,329,822,011,000 |
what does the a in chattr +ia <filename> do? and why would you add the a in combination with the i? note: I know the i is for immutable
|
The letters `acdeijstuADST' select the new attributes for the files:
append only (a), compressed (c), no dump (d), extent format (e),
immutable (i), data journalling (j), secure deletion (s), no tail-merg‐
ing (t), undeletable (u), no atime updates (A), synchronous directory
updates (D), synch... | what does the "a" in chattr +ia do? |
1,329,822,011,000 |
I am trying to get extended attributes working on Fedora 22. I can't seem to be able to set the attributes even on my files, but I can read them. Here's how it looks:
[jarek@localhost ~]$ cd /tmp/
[jarek@localhost tmp]$ touch a
[jarek@localhost tmp]$ setfattr -n "user.abc" -v "blah" a
setfattr: a: Operation not supp... |
You don’t mention it in your text,
but your code block shows that you are doing your test in /tmp.
Even if your root filesystem (HDD or SSD) is ext4,
you might have /tmp mounted as a separate filesystem,
probably of type tmpfs, and that does not support extended attributes.
You can check whether this is the case
by ... | Can't set extended attributes on ext4 on fedora 22 - operation not supported |
1,329,822,011,000 |
Is it possible to change the location for .Xauthority, to something other than $HOME/.Xauthority ? AFAIU, this file is being created every time I log into LXDE, by my login manager slim.
The problem I am having is following:
I want to set my home to "immutable" using extended attributes:
chattr +i /home/martin/
This ... |
The location of the X cookie file can be configured with the XAUTHORITY environment variable. The default is ~/.Xauthority.
Of course, the location that you pass to applications has to match the location where the cookie is stored. SLiM doesn't offer a way to add the cookie to a different file: it has ~/.Xauthority ha... | change location of $HOME/.Xauthority |
1,329,822,011,000 |
I think I'm close here but I'm missing something stupid. I'm trying to make awk print out the filenames for files that are missing extended attributes or are missing an attribute value.
So a file will have something like:
getfattr -d /path/to/file/testfile.1
# file: /path/to/file/testfile.1
user.test="1"
awk shou... |
Use attr instead of getfattr to retrieve the attribute. This utility will, by default, handle attributes in the user namespace. It is easier to pull out only the attribute's value too, so there's no need for parsing:
find /files/to/audit -type f -exec sh -c '
for pathname do
attrval=$( attr -q -g test "$p... | AWK return path for files with NF <= 2 |
1,329,822,011,000 |
On OSX you can have tags which allows you to identify different categories of files. Here are two text files with different tags when viewed in Finder:
I have a large number of these files and have written a bash script to make several edits on these files. So, for instance I do:
$ sed 's/old text/new text/' file1.tx... |
When you run > /tmp/foo.txt, you are overwriting the contents of /tmp/foo.txt with the output of sed 's/old text/new text/' file1.txt. Since /tmp/foo.txt doesn't exist when you run this command, bash will create that file for you and then write it.
Then, when you use the -p flag to cp, you are copying the permissions ... | Edit a file via a script yet maintain the osx tags |
1,329,822,011,000 |
I am just learning about Rich Access Control Lists on Linux. My immediate objective is to give members of the group the same rights as the owner for a subdirectory tree (all files and directories within).
I have reviewed the man pages for setfattr and getfattr. Neither of those man pages provide a list of the availabl... |
It turns out that Rich ACL's are not supported by the mainline Linux kernel.
Source: https://wiki.samba.org/index.php/NFS4_ACL_overview#Linux
Further, as of 2 May 2019:
Re: PATCH overlayfs: ignore empty NFSv4 ACLs in ext4 upperdir - Andreas Gruenbacher
The patches for implementing that have been rejected over and ove... | How to apply and use Rich Access Control Lists with BTRFS |
1,329,822,011,000 |
Let's say I want to set one or more attributes (in the chattr sense) on every file created in a given directory.
Is there a way to achieve this automatically, like umask does for file permissions ?
In other words, is there a way to omit the chattr step in :
$ copy file /path/to/backup/
$ chattr +i /path/to/backup/fil... |
You can run inoticoming to watch for files placed in the directory and automatically run any command, in this case chattr. (note linux specific)
| Automatically set file attributes in a given directory |
1,329,822,011,000 |
I have added user_xattr in ext4 but when I remount it doesn't show xattr & I installed attr & attr_dev
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/Anonymous--vg-root / ext4\040remount,user_xattr errors=remount-ro 0 1`
|
User extended attributes are supported by default on Ext4, you don’t need to do anything to enable them. To verify this, run
cd
touch xattr-test
setfattr -n user.test -v "hello" xattr-test
getfattr xattr-test
This should show that the extended attribute was successfully stored.
| how to enable xattr support in Debian 9 (Stretch) |
1,329,822,011,000 |
What is actual max allowed size of btrfs xattr? I tried to test this on few systems and got entirely different results (between 11kB and 15kB) so I'm not sure what actually determines this size and whether I'm able to verify it before assignment? (other than brute force binary search)
|
From man xattr both kernel and filesystem can limit the maximum number/size xattr
grep XATTR /usr/include/linux/limits.h
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size o... | Btrfs - max xattr size? |
1,329,822,011,000 |
I'm trying to use setfattr, but always get Operation not supported
In my home directory, I'm doing the following:
touch delete.me
setfattr -n naomi -v washere delete.me
This returns setfattr: delete.me: Operation not supported.
My home directory is ext4 and delete.me definitely exists. I'm on Fedora 25. Any idea why ... |
You can't just use any name. You need to select a namespace. For arbitrary attribute name, you'd need to use the user namespace:
setfattr -n user.naomi -v washere delete.me
(see man 5 attr for details).
For ext4, the ext_attr feature must be enabled (on by default). Check with:
sudo debugfs -R stats /dev/block/device... | Cannot set file attribute |
1,381,246,636,000 |
I am logged into my remote VM (running out of ESXi) as user xyz. I wanted to change my /etc/hosts to add some network names that were not visible by default.
I first tried to run
sudo vi /etc/hosts
but when I got into vi, it was still telling me the file was read-only. Here are the privileges:
>ls -l /etc/hosts
-rw... |
The specific attribute in this issue is i, the immutable attribute.
The file was marked immutable.
This means it is unchangeable at all by any user including root. Root can still change the attributes and remove the immutable attribute, but must to so first before making changes to the file, unlike standard no-write... | Unable to run 'sudo chmod +w /etc/hosts' |
1,381,246,636,000 |
I had set the immutable attribute for a file that shouldn't be changed until it is deleted
(The file was a backup image of a virtual machine).
As it seems the file also cannot be hard-linked, i.e. it cannot be renamed.
Is that the way it should be?
Compared to a file lacking write permission, this behaves quite differ... |
This is a feature. See man chattr:
A file with the 'i' attribute cannot be modified: it
cannot be deleted or renamed, no link can be created to
this file, most of the file's metadata can not be
modified, and the file can not be opened in write mode.
Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLE c... | Bug or feature: Cannot link immutable file |
1,381,246,636,000 |
Is there any file browsers for Linux that cache image previews, just like Windows Explorer cache them to a file named Thumbs.db?
As in the latest ext3/4 filesystems, an inode can hold extended attributes, is it utilizied by any file browser? Well, the default 256B inode size may be too small to hold the preview, I can... |
Nautilus uses ~/.thumbnails normally. Lots of image viewers do generate thumbs there as well. In the normal sub-dir of my system most of the preview files are about 20 KiB in size. It's kinda disturbing that there're no either sqlite database in single file or cache hierarchy (like f/ff/ffdcd558a…1e5200.png) so some F... | How to utilize extended attributes for image preview? |
1,381,246,636,000 |
Ubuntu Server can't be upgraded because it says that openssh-sftp-server package have unmet dependencies
The following packages have unmet dependencies:
openssh-sftp-server : Depends: openssh-client (= 1:8.2p1-4ubuntu0.2) but 1:8.2p1-4ubuntu0.1 is installed
When I try to use apt --fix-broken install to install what ... |
There’s no reason to have libraries in /usr/share/doc, and as you point out, the “libraries” (which probably aren’t libraries, given the command shown in your htop screenshot) aren’t referenced anywhere. This is extremely likely to be an attack.
See this answer and the links therein for details of what you should do n... | /usr/bin/ssh and /usr/sbin/sshd can't be moved to update openssh-server and openssh-client because of immutable attribute |
1,381,246,636,000 |
I was experimenting with encryption on an ext4 filesystem and I encrypted a file (using fscrypt) which was set to be immutable (via chattr +i). I have now lost the encryption key and uninstalled fscrypt.
I would like to delete the file, but when I try to delete it, I get the following error:
# rm foo
rm: cannot remove... |
With the filesystem unmounted, you should be able to use debugfs -w -R "rm path_to_file" /dev/sda1 to delete the file.
| How do I delete an immutable encrypted file? |
1,381,246,636,000 |
Is there any chattr flag that would allow me to lock a file's unix permissons, and not change them without resetting the flag? The file itself should still be modifiable, I just want to prevent ... ignorant people ... from changing the permissions to something wrong accidentally.
|
There is no such flag with Linux chattr. You can either make the file immutable or append-only (in either case, the file's permissions and ownership will be locked), or allow the owner of the file and root to change the permissions. (The immutable attribute on a directory prevents creating or removing files from it bu... | immutable-like flag for perms |
1,381,246,636,000 |
I want to create a directory which is undeletable, and that you can only add files, not delete any file therein.
I was reading the man chattr page and I came across attribute a
A file with the 'a' attribute set can only be opened in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMM... |
This works
sudo chattr +a +u /path/to/dir
| Append only attribute for directories |
1,381,246,636,000 |
I would like to be able to compress certain files (that I need to keep, but use rarely) on disk. I noticed that chattr +c flags a file for compression, but it doesn't seem to actually compress files.
What is the simplest way to implement file compression on a per-file or per-directory basis?
|
Ext2 and family (including ext4) reserve an attribute for compression but don't implement it. This feature was originally put off because there were more urgent things to do, and then it became obsolescent as the size of storage media increased a lot faster than the size of data that isn't already compressed. Most lar... | File compression - how to implement in Linux |
1,381,246,636,000 |
How to prevent a directory (including all of its contents), from being edited?
Using command chattr, you can prevent a directory from being deleted:
chattr +i folder
But, you can edit this directory(folder).
So how can i prevent it from being edited (I.e: deleted, writing, creating a file and...) ?
Also, i want to kn... |
After chattr +i, you can't edit the directory. You'll find that adding, renaming, and removing files does not work—that's all that is actually in a directory. In order to prevent editing the files, you need to chattr +i them, too. (Remember: Unix has hardlinks; a single file can exist in multiple directories.)
Dependi... | How to prevent a directory from being edited |
1,381,246,636,000 |
I have run exa --long --extended on a folder containing some wallpapers and I noticed that it returns a strange security.selinux (len 37) tag on several of my files. I'd like to know what it is and how to get rid of it. I assume it's something that got passed when I backed up my files from my old Fedora install, but I... |
I found out how to do it. If anyone experiences the same, you can run
find /path/to/dir/ -type d,f -exec setfattr -x security.selinux {} \;
| What is this strange SELinux attribute on several of my files? |
1,381,246,636,000 |
I have a directory containing a root filesystem that I SquashFS and then mount as r/o on other boxes.
However, before SquashFS'ing, i want to clear all the user-namespace xattrs from the filesystem. This is trivial to do with a small getfattr and setfattr loop script, but I want to avoid introducing those as a depende... |
GNU tar can read xattrs and do filtering on them, see https://www.gnu.org/software/tar/manual/html_node/Extended-File-Attributes.html.
A Squashfs filesystem can now be created from a tar archive using sqfstar (in version 4.5 and later).
So something like
tar --xattrs --xattrs-exclude='user.*' -c your-directory | sqfst... | Ideas to clear user xattrs from files without get/setfattr |
1,381,246,636,000 |
I'm using stat like this:
stat -f "%Sp %p %l %Su %u %Sg %g %z %a %N %Y" /*
I need also to tell if the file is hidden or not (MacOS).
The . notation is not enough. MacOS hides more files.
For example, this is what I need:
ls -lO
total 9
drwxrwxr-x 32 ro... |
If macos stat is like FreeBSD's, the flags can be expressed in the format specification with %f for the numeric form or %Sf for the decoded text form like in ls -lo.
See man stat, man chflags and man ls on your system for details.
| Can stat show if file is hidden? |
1,381,246,636,000 |
Setting up Samba-4.3.5 as AD domain fileserver in OpenVZ container, running in ProxMox (pve-manager/3.4-6/102d4547 running kernel: 2.6.32-39-pve). Hardware node has enabled acl support for /var/lib/vz. Nevertheless, container has no acl support. So, any setfacl command does nothing.
How enable acl and xattr support in... |
Added to /etc/pve/openvz/VMID.conf
MOUNT_OPTS="rw,realtime,acl,user_xattr"
Did the thing. Now (for example)
setfacl -m u:sshd:rwx ~/tmp
setfacl -m g:ssh:rwx ~/tmp
and then
getfacl ~/tmp
shows
# file: root/tmp
# owner: root
# group: root
user::rwx
user:sshd:rwx
group::r-x
group:ssh:rwx
mask::rwx
other::r-x
So,... | OpenVZ acl support for Samba |
1,381,246,636,000 |
It's possible to set immutable bit for a specified range of days?
I was trying to understand how Veeam11 can change the attribute after a few days for immutable backup
|
Perhaps
echo 'chattr +i filename' | at beginning_timestamp
echo 'chattr -i filename' | at ending_timestamp
Would this work for you?
| Set immutable bit for specified time |
1,381,246,636,000 |
Rsync describes the -a or --archive mode as being equivalent to the options.-rlptgoD (no -H,-A,-X).
The -A and -X options are ambiguous and iit is not clear whether they are included or excluded.
-A stands for --acls and -X stands for --xattrs and I wonder whether they are excluded because they are features added on t... |
The -A and -X options are ambiguous and iit is not clear whether they are included or excluded.
It should be relatively simple to test how the options behave.
Create a test file with an ACL, copy it with the various options and combinations of them, and see if the copied file has the ACL. (Remove the target file aft... | Does the rsync "-a" option exclude the "-A" and "-X" option? |
1,381,246,636,000 |
Is it possible to create a directory that its owner can't delete? Let's say I have directory bar owned by user foo, and I'd like to create a subdirectory bar/baz, also owned by foo, such that:
foo can create and remove files and directories in bar/baz as normal
foo can create and remove files in bar as normal
foo can... |
I can think of at least two ways to prevent an owner from deleting a directory.
A directory can't be deleted if it isn't empty. So put something in it the owner can't delete.
A directory they don't own
a file (owner doesn't matter) that is immutable
Mount something on the directory
In the first case, they'd stil... | A directory that is owned by some non-superuser, but can't be deleted by them |
1,381,246,636,000 |
I have a directory called pub on a Ubuntu 20.04 server, that I wish to protect from deletion, and I found https://askubuntu.com/questions/504151/how-to-prevent-directory-from-being-deleted-by-user so I tried:
$ sudo chattr +i pub
Good enough, now I want to check if that attribute has been set:
$ lsattr pub
----------... |
Use -d, which lists directories like other files instead of listing their contents:
lsattr -d pub
| How to lsattr directory only? |
1,381,246,636,000 |
I am managing some folders on our server. The server runs:
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
I have created a directory in "/srv/" and named it "test". I have added another directory called "archived" inside "test".
I have created project_managers user group and add... |
To answer you question: a move and a delete are pretty similar, I think you need a different strategy.
I would put the directory under version control, not only because it appears to be code.
The advantage of a version control system is that you have file history. you could simply run a scheduled task, say every hour ... | How to make files undeletable but moveable in linux server? |
1,381,246,636,000 |
I would like to delete chattr, as in /usr/bin/chattr, I am using Linux Mint, do you think other parts of the system would be affected?
|
If for some reason you just want to prevent it from being used, you can just render it inoperable:
chmod a-x /usr/bin/chattr
I agree it's not a smart thing to remove the file.
| if I delete usr/bin/chattr would other components of the system be affected? |
1,381,246,636,000 |
I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(tilde) to the end
EG:
myfile (not hidden)
myfile~ (hidden)
Now, I can tell that a file is "hidden" if it's a dot file, but what is goin... |
A tilde suffix marks a backup file for a few text editors, such as Emacs ('~') and Vim ('.ext~').
Some programs hide these files, as most people don't care about them.
The only universal convention for a 'hidden' file is a file with a leading '.', due to a feature-like bug which was widely adopted.
| Cent OS 6.3 Hidden files in shell |
1,381,246,636,000 |
For example, I have a file with three extended attributes:
com.apple.FinderInfo
com.apple.metadata:_kMDItemUserTags
com.apple.metadata:kMDItemFinderComment
I can delete the first two using
xattr -d com.apple.FinderInfo file.txt
xattr -d com.apple.metadata:_kMDItemUserTags file.txt
But I would prefer to not invoke xa... |
Hm, maybe you could run xattr -d attribute1 -d attribute2 filename, if xattr supports that? That would mean the documentation is a bit wrong, but getopt-based programs often have that problem.
Let's test that:
I don't have MacOS to test, but I got the original source code of the xattr tool, and removed all functionali... | Delete multiple extended attributes (but not all of them) in one step |
1,381,246,636,000 |
I have concealed some folders on my laptop using chflags:
chflags hidden hide-me
And I don't remember where exaclty these folders are located.
How is it possible to find all of them? (Probably by using find and/or grep.)
|
Something like that:
find . -flags -hidden \! -name ".DS_Store"
| Find all the folders that are concealed using 'chflags' |
1,381,246,636,000 |
Background : in ima-evm-utils I found lgetxattr() can't return expected value.I wrote a simple c program to verify it.
#include <sys/types.h>
#include <sys/xattr.h>
#include <stdio.h>
int main(){
char xattr_value[1024];
int size;
size=lgetxattr("/bin/tcpm", "security.capability", xattr_value, s... |
getxattr or lgetxattr get the binary capability value in fact.
[root@localhost ~]# strace -e getxattr getfattr -d -m - /bin/tcpm
getxattr("/bin/tcpm", "security.capability", NULL, 0) = 20
getxattr("/bin/tcpm", "security.capability", "\0\0\0\2\0 \0\0\0\0\0\0\0\0\0\0\0\0\0", 256) = 20
| lgetxattr can't get security.capability |
1,381,246,636,000 |
I am unable to set or view file attributes using lsattr and chattr commands on Reiser File System. Following result is observed:
chattr +i Temp.txt
chattr: Inappropriate ioctl for device while reading flags on Temp.txt
lsattr Temp.txt
lsattr: Inappropriate ioctl for device While reading flags on Temp.txt
Is there a ... |
According to a mailing list question from 2003, Reiserfs doesn't support chattr. Granted that was a long time ago, but given your error above, it seems likely that it still doesn't.
| Inappropriate ioctl for device while reading flags on <file> |
1,450,838,669,000 |
I would expect xdg-open command to use the same application that opens when I double-click the file in the default file manager, but this is not always true.
For example my DE is XFCE, my file manager is Thunar and my default picture viewer is Ristretto. However, xdg-open example.png opens the example PNG file in Pint... |
xdg-open is a desktop-independent tool for configuring the default
applications of a user. Many applications invoke the xdg-open command
internally. Inside a desktop environment (like GNOME, KDE, or Xfce),
xdg-open simply passes the arguments to those desktop environment's
file-opener application (eg. gvfs-op... | How does the xdg-open command know which application to use to open a file? |
1,450,838,669,000 |
I would like to register a URL scheme (or protocol) handler for my own custom URL protocol, so that clicking on a link with this custom protocol will execute a command on that URL. Which steps do I need to take to add this handler?
Example: I want to open URLs like ddg://query%20terms in a new DuckDuckGo browser searc... |
To register a new URL scheme handler with XDG, first create a Desktop Entry which specifies the x-scheme-handler/... MIME type:
[Desktop Entry]
Type=Application
Name=DDG Scheme Handler
Exec=open-ddg.sh %u
StartupNotify=false
MimeType=x-scheme-handler/ddg;
Note that %u passes the URL (e.g. ddg://query%20terms) as a si... | Create a custom URL Protocol Handler |
1,450,838,669,000 |
According to the man page, xdg-open will open a file using the application the user has configured. But how is that application actually determined? I can see no config files associated with xdg-utils, so where are my settings stored and how can I modify them? Seeing how a simple PNG file opens Internet Explorer using... |
Look at the content of the xdg-open file, and you will notice that it is a simple shell script. Its main task is identifying the desktop environment in use, which will then be used to delegate the task to a specific tool:
KDE delegates to kde-open or kfmclient
Gnome delegates to gvfs-open or gnome-open
Mate delegates... | How does xdg-open do its work |
1,450,838,669,000 |
Given xdg-open and an extension, is there a way to get the application which xdg-open is set to for that particular extension?
For example given xdg-open and .jpg the result is eog.
|
AFAIK the choice of action is based on the file's mimetype rather than its extension.
At least on Ubuntu, you should be able to use the query action of xdg-mime to show the default application for a specific mimetype
$ xdg-mime query default image/jpeg
eog.desktop
You can check the mimetype for a particular file usin... | Find the default application for a certain extension |
1,450,838,669,000 |
My problem is that many programs call xdg-open to open websites but on my Manjaro system (based on Arch Linux) this is somehow bound to cups :)
When such a call to xdg-open happens, the CPU usage goes up a lot, without anything happens. I restart because the laptop gets hot very quickly.
~ $ xdg-settings get default-w... |
Check the BROWSER variable in /etc/profile and /etc/environment and eventually in your ~/.bashrc. It is probably set to /usr/bin/xdg-open so you should consider to change it to avoid the recursive call.
| Can't change the xdg-open url-handler to Firefox |
1,450,838,669,000 |
I just can't find the command to display a *.png image! I tried xdg-open command but it failed:
[student@seqpapl1 Images]$ xdg-open adapter_content.png
xdg-open: no method available for opening 'adapter_content.png'
I am currently running ubuntu linux on the server.
|
Use mimeopen -d to set the default application:
mimeopen -d image.png
sample output:
Please choose a default application for files of type image/png
1) ImageMagick (color depth=q16) (display-im6.q16)
2) GNU Image Manipulation Program (gimp)
3) Feh (feh)
Select your default application , next time you will be able ... | How to open an .png type image in Linux terminal? |
1,450,838,669,000 |
$ xdg-open
The program 'xdg-open' is currently not installed. You can install it by typing:
sudo apt-get install xdg-utils
$ sudo apt-get install xdg-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
xdg-utils is already the newest version.
0 upgraded, 0 newly insta... |
This sounds like your package database is screwed up. First I'd identify all the versions of xdg-open that you have on your system. The type should always be used for doing this task, never rely on which or whereis.
Example
Identify all xdg-open's.
$ type -a xdg-open
xdg-open is /usr/bin/xdg-open
Find out which packa... | xdg-open is installed yet also is not installed |
1,450,838,669,000 |
I'm trying to write a script that launches the default application for a given mime type. For example, I would like to say my-script text/plain and have it open KWrite for me.
What I know is that you can use xdg-mime to query what is the default application for a given mime type
$ xdg-mime query default text/plain
org... |
This answer over on askubuntu.com covers many different ways to solve the problem. The one that was the closes to doing what I wanted was the gtk-launch command:
gtk-launch org.kde.kwrite.desktop
One thing I like about gtk-launch is that it can find the appropriate desktop file even if you only give it the name.
| How can I run a .desktop file? |
1,450,838,669,000 |
I run Debian Jessie without a desktop environment (I use the tiling window manager i3) and like to use xdg-open to quickly open files using a preferred application. I have an ongoing problem setting the preferred app for PDF files though. This is my problem in a nutshell:
$ xdg-mime query filetype ~/Downloads/documen... |
You could attempt to manually set it via the command line using mimeopen.
Example
$ mimeopen -d ~/test.pdf
Please choose a default application for files of type application/pdf
1) E-book Viewer (calibre-ebook-viewer)
2) Document Viewer (evince)
3) Xournal (xournal)
4) GNU Image Manipulation Progra... | xdg-open opens a different application to the one specified by xdg-mime query |
1,450,838,669,000 |
I have tried to set my default browser for opening URLs to Chromium using:
xdg-settings set default-web-browser chromium.desktop
(yes I checked out whether /usr/share/applications/chromium.desktop existed first before running this command and it does exist) and it returns:
xdg-settings: unknown desktop environment
i... |
Install perl-file-mimeinfo and configure it that way. See the Arch Wiki article on xdg-utils:
If no desktop environment is detected, MIME type detection falls back
to using file which—ironically—does not implement the XDG standard. If
you want xdg-open to use XDG MIME Applications without a desktop
environment,... | How to set the default web browser used to open URLs under i3? |
1,450,838,669,000 |
I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
Quite strange as you can see, it's prepending the user directory to the url.
The example here is from telegram, but it happens in discord, as well as when executing fro... |
@user310685 got it close - but DEFINITELY WRONG. That fix "works" only when xdg-open is NOT given "naked" file paths (i.e. with no leading "file://" URI scheme and double-slash) or file-schemed URI's (i.e. with the leading "file://"). Those two types of argument should have xdg-open defer to pcmanfm, but they won't.
T... | xdg-open on debian 9 fails to open browser |
1,450,838,669,000 |
On my Lubuntu (18.10), xdg-open launches VLC Player when the file is not associated to any applications.
$ xdg-mime query filetype jquery.js
application/javascript
$ xdg-mime query default application/javascript # no output
$ xdg-open jquery.js
Error: no "view" mailcap rules found for type "application/javascript"
Ope... |
mimeopen treats unknown files as text/plain or application/octet-stream.
To set default application, run mimeopen with -d option. Since I could not find option to specify mimetype, you need to create dummy files at first.
touch text.txt # for text/plain
mimeopen -d text.txt # and choose your favorite app
echo -e \\0... | How can I set default application for unknown file on xdg-open / mimeopen? |
1,450,838,669,000 |
I have a Java program that runs on Linux, and from within the program, I want to open files (e.g. PDF files) with the system's native viewer. There are various programs available for this purpose: gnome-open, gvfs-open, xdg-open, ...
Which one(s) should I use to cover as many Linux distributions as possible?
|
xdg-open is the safest bet. Not everyone will necessarily have gnome or gvfs installed. xdg-open, on the other hand, is not tied to any desktop environment or toolkit.
| What program to use to open files? (gnome-open, gvfs-open, xdg-open, etc.) |
1,450,838,669,000 |
Older versions of Netscape and Mozilla (for X11) supported the so-called remote protocol: it was possible to open a URL or start composing an e-mail whenever a Netscape/Mozilla window (not necessarily from a local process) was open on the current DISPLAY.
The "remote" feature worked either way: either from a remote cl... |
I cannot say anything about the specification but as far as just the result matters I (not being familiar with the quoting in such files, though) would expect this to work:
Exec=bash -c 'echo seamonkey openURL"($1)"' seamonkey-wrapper %u%
| Opening a URL with xdg-open using Mozilla Remote Protocol |
1,450,838,669,000 |
Whenever I open something with xdg-open in my new OpenSUSE 13.2 install, I am spammed by a sequence of warnings like
$ xdg-open ./flask.wsgi
kioclient(10634) KMimeTypeRepository::parents: "/usr/share/mime/subclasses" refers to unknown mimetype "application/vnd.ms-excel.sheet.binary.macroEnabled.12"
kioclient(10634... |
This is a known bug: https://bugs.kde.org/show_bug.cgi?id=343468
You can use a workaround as described in the #3
sudo sed -i 's:macroEnabled:macroenabled:g' /usr/share/mime/subclasses
| kioclient KMimeTypeRepository::parents: "/usr/share/mime/subclasses" refers to unknown mimetype "application/vnd.ms-excel..." |
1,450,838,669,000 |
I am using Arch Linux. Each time I download a TeX file, Firefox suggest me to open it with notepad (which is installed through wine). Why?
$ xdg-mime query filetype Random-file.tex
text/x-tex
$ xdg-mime query default text/x-tex
(nothing appears with the second command)
$ xdg-open Random-file.tex
Opening "Random-fi... |
grep -ri notepad ~/.local/share/applications
Are you sure that this gives 0 results? Here on my ArchLinux I have few files with names starting with wine-extension that register Notepad. I suggest You removing them.
Also, for future, to disable registering wine apps You can run winecfg and perform this:
Go to the Lib... | Firefox tries to open TeX files with wined notepad |
1,450,838,669,000 |
Similar to this question, I have some applications (Calibre, texdoc) open PDFs with Mendeley. Opening PDFs from Thunar, Thunderbird, Firefox etc. opens evince, the expected default.
It seems that those applications use xdg-open since:
$ xdg-mime query default application/pdf
mendeleydesktop.desktop
I tried to find wh... |
The question remains: where did xdg-open get the idea that Mendeley should
be the default PDF viewer from?
This is an eminently reasonable question.
Here's a somewhat long answer in three parts.
Option 1: read the documentation
For example, the FreeDesktop standard
on mimetype associations has this to say:
Associat... | Why does xdg-open use Mendeley as default for PDFs? |
1,450,838,669,000 |
I've set an alias to xdg-open adding alias op="xdg-open" to my ~/.bashrc file.
The command op file.pdf works, but I'm not able to autocomplete when typing, for example, op fi and hitting TAB.
This is kind of annoying as the point of setting the alias is to save time. How can I fix this?
|
I guess you have bash-completion installed, which automatically loads the completion it ships for the op command when you try to complete a command line starting with your op alias.
You can avoid this by:
Choosing a different alias (and looking at the files in /usr/share/bash-completion/completions/ to make sure you ... | xdg-open autocomplete not working when calling it with alias |
1,450,838,669,000 |
I noticed that xdg-open doesn't handle percent encoded urls. For example, these lines will succeed (provided the files exist):
xdg-open "/home/sashoalm/Has Spaces.txt"
xdg-open file:///home/sashoalm/NoSpaces.txt
But this one will fail:
xdg-open file:///home/sashoalm/Has%20Spaces.txt
Edit: This is my version of xdg-u... |
If you are using an LXDE desktop environment, xdg-open opens file:// URLS with the pcmanfm program. It strips the file:// part of the URL and calls pcmanfm with the remaining part, since pcmanfm supports only normal paths as arguments, not URLs.
xdg-open does not do any other replacements, so %20 is not translated int... | xdg-open doesn't handle percent encoded "file:///" urls with LXDE |
1,450,838,669,000 |
This is part 2 of How to install a new (custom) mime type on my Linux system using CLI tools?
Using the steps in the accepted answer at the above question, I created the following mime-type mx-publickey.xml
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>... |
The shared-mime-info repository
already specifies the application/pgp-keys mimetype.
You can see it here:
<mime-type type="application/pgp-keys">
<comment>PGP keys</comment>
<acronym>PGP</acronym>
<expanded-acronym>Pretty Good Privacy</expanded-acronym>
<sub-class-of type="text/plain"/>
<generic-icon name="t... | How to associate a new (custom) mime type with files (based on file extension)? |
1,450,838,669,000 |
I'm trying to set the default application for R noweb files but fail to find the place where this is specified. The reason for this is that my file managers seem to determine the file type by filename extension (.Rnw) rather than or in addition to the scheme specified by freedesktop.org (that is: mimeapps.list, mimein... |
Make the mime-info file
$ vi ~/.local/share/mime/packages/x-r-noweb.xml
$ cat ~/.local/share/mime/packages/x-r-noweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-r-noweb">
<comment>R noweb</comment>
<g... | How does filetype determination by filename extension in addition to XDG spec (mimeapps.list) work |
1,450,838,669,000 |
I'm trying to get xdg-open to properly handle URIs with the pattern of ob://@username but it seems that xdg-open is stripping the @ symbol. Is there someway to prevent this without modifying xdg-open itself?
My openbazaar.desktop file consists of the following:
[Desktop Entry]
Name=OpenBazaar Client
Exec=openbazaar "... |
xdg-open is attempting to comply with the standards...
An @ mark is a delimiter between user- and host-names, and without the user-name it is unexpected (and not standard). If you want to use it in a different way, you will have to encode it.
Further reading:
Clarification of Proper Use of "@" (at sign) in URI-style... | Why does xdg-open remove @ from a URI if it's the first character in the path? |
1,450,838,669,000 |
Related to this answer on my previous question.
So, XDG can handle it on its own:
It can manage default applications - xdg-mime
It can open file with associated application - xdg-open.
Why do desktop environments make their own replacements for xdg-open? Like gvfs-open, kde-open, or exo-open,...
Isn't xdg-open enoug... |
The Arch Wiki says:
Inside a desktop environment (e.g. GNOME, KDE, or Xfce), xdg-open simply passes the arguments to that desktop environment's file-opener application (gvfs-open, kde-open, or exo-open, respectively), which means that the associations are left up to the desktop environment. When no desktop environmen... | Why do desktop environments make custom xdg-open replacements? |
1,450,838,669,000 |
I want to add comments in my ~/.config/mimeapps.list file.
How do I do this?
Chapter and verse preferred as errors seem to be silently ignored.
|
Association between MIME types and applications defers to the Desktop Entry Specification, which states that
Lines beginning with a # and blank lines are considered comments and will be ignored, however they should be preserved across reads and writes of the desktop entry file.
Comment lines are uninterpreted and may... | Comments in ~/.config/mimeapps.list |
1,450,838,669,000 |
Hi I want to open specific link with specific application. To be more specific, I want to open zoom links https://us02web.zoom.us/j/something?pwd=somethingsomething with desktop-ish zoom application (someting like pwa browser app, but not a native pwa app. Created with: -> three dots -> more tools -> create shortcut).... |
Open https://us02web.zoom.us/j/77479044122pwd=Nik0ajNiAWRkbXhkbWVJTXJtcklrQT09
translates to:
xdg-open zoommtg://us02web.zoom.us/join?action=join&confno=77479044122&pwd=Nik0ajNiAWRkbXhkbWVJTXJtcklrQT09
There's a bunch of other shite on the final URL, but I reckon that's all you need.
I divined this from moving /usr/bi... | How to xdg-open specific links with different apps |
1,450,838,669,000 |
I can open a Python source file using xdg-open, e.g.,
$ xdg-open Documents/tmp/paramk.py
Waiting for Emacs...
$
what happens is that emacsclient is invoked and xdg-open returns when I close the Emacs' frame.
Out of curiosity I tried
$ xdg-mime query filetype Documents/tmp/paramk.py
text/x-python
$ xdg-mime query defa... |
You should be able to find the file in one of these folders:
/usr/share/applications
/usr/local/share/applications
~/.local/share/applications
See https://wiki.archlinux.org/index.php/Desktop_entries for reference.
| Where is the relevant .desktop file? |
1,450,838,669,000 |
I am trying to register new mimetypes under XFCE4. In particular, I would like to register the protocol zoommtg so I can launch Zoom meetings from links in the webbrowser Chrome. Chrome will launch xdg-open here, which in turn launches exo-open. exo-open seems to ignore mimetype registrations of the type
xdg-mime defa... |
A solution is almost indicated in the question: hinder xdg-open from choosing exo-open. A brute-force approach is to copy /usr/bin/xdg-open to /usr/local/bin (/usr/local/bin is earlier in PATH unless PATH has been modified) and to patch it to use open_generic instead of exo_open (unlike the XFCE4-specific exo-open, op... | How to register new mimetypes not available in xfce4-mime-settings so that they are recognized with xdg-open under XFCE4? |
1,450,838,669,000 |
I am trying to write a function launchSystemFile which works like windows ShellExecuteEx from the command line or from C++.
If I ShellExecuteEx a blah.txt it opens it in the default editor.
If I ShellExecuteEx a firefox.exe it launches the executable.
I have been doing from C++ popen "xdg-open blah" and it works great... |
xdg-open is just a shell script that detects Desktop Environment and call the corresponding program (gvfs-open for gnome , exo-open for XFCE, mate-open, etc.)
So the limitations for launching an executable are derived from the corresponding launcher of each DE, which is gvfs-open in your case.
Looking at gvfs-open man... | Launch executable with xdg-open |
1,450,838,669,000 |
xdg-open opens normal web pages in Firefox, such as xdg-open http://google.com. However, images do not. For example, xdg-open https://i.imgur.com/JfKwovX.jpg opens the image in Gwenview. I tried setting Firefox as default for (all?) urls with
xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default fire... |
I've managed to fix this by going to System Settings -> Applications -> Web Browser and setting parameter Open http and https URLs to in the following browser -> firefox
This works with KDE 5, but should work similar in previous versions.
| How can I open all urls in my browser with xdg-open? |
1,450,838,669,000 |
I use WSL2 (Ubuntu 22.04.1 LTS) and need to refer to edge-browser for xdg-open. Due to the space in the path I get an error. How can I escape the space? The path is shown corrrectly in exported variable BROWSER.
oliverk@KPW00WP3Q:/mnt/c/Users/E547766/Documents$ export BROWSER="/mnt/c/Program Files (x86)/Microsoft/Edge... |
$ export BROWSER="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
$ xdg-open https://stackoverflow.com/questions/24683221
/usr/bin/xdg-open: 882: /mnt/c/Program: not found
That error message hints a lot at word splitting in action.
And that's what it is. xdg-open is a shell script that treats $BRO... | Escape spaces in path in export variable (Ubuntu 22.04.1 LTS) |
1,450,838,669,000 |
Is there a way of checking for syntax errors in ~/.config/mimeapps.list?
Errors seem to be silently ignored:
I added fdsobojaba to the bottom of the file
I ran xdg-open on an existing file
There was no error in .xsession-errors
How do I verify mimeapps.list? Or at worst, where is the definition of the file's format... |
As you say, Association between MIME types and applications specification is the relevant specification, but it doesn’t describe the file format in much detail. However, it defers to the Desktop Entry Specification for the file format; it’s not particularly explicit, but I think the
The value is a semicolon-separated... | Syntax check ~/.config/mimeapps.list |
1,655,657,992,000 |
I'm in a Windows Subsystem for Linux (WSL) Ubuntu 20.04 LTS.
My ~/.zshrc file currently has the following appended to the end of the file.
export BROWSER='/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe
When I try to run
xdg-open .
It fails to open the current working directory because the cur... |
xdg-open is typically for X applications. As far as I know, there's not going to be a way to get it to understand and launch a Windows executable such as Brave.
Many WSL distributions, including Ubuntu 20.04 when installed from the Store, include the wslview command as an alternative for opening the default Windows a... | Windows browser specific to program within WSL |
1,655,657,992,000 |
I have a lot of documents to view, and I'd like to view them one by one, so the next opens when I close the previous.
I've done this with evince before, with
for i in `ls | grep .pdf`; do evince $i; done
However doing the same with xdg-open fails because xdg-open does not block like evince does.
Is there a way to run... |
I couldn't find a clean way, so this is a work-around; open each file then run a busy-loop waiting for "the" matching process to exit. I've also updated your for loop so that you're not parsing ls and are quoting the filename parameter:
#!/bin/bash
for i in *.pdf
do
xdg-open "$i"
t=$(tty)
t=${t##/dev/}
s=$(ps... | xdg-open block until spawned process is killed |
1,655,657,992,000 |
Android has a convenient feature: certain https links that have associated local apps installed are opened directly in these apps, skipping the browser page. How do I achieve this in Linux?
I have Zoom installed on my computer. When someone shares a https://zoom.us/j/NNNN link with me and I click it in e.g. Thunderbir... |
In the end, I have rolled my own: open-uri-in-native-app. A short bash script and a desktop file.
Here’s an excerpt of the script to be set as the handler for https links:
#!/usr/bin/env bash
URI=$1
if [[ $URI =~ ^https://zoom.us/j/ ]]; then
ZOOM=$(xdg-mime query default x-scheme-handler/zoommtg)
if [[ -n $ZOOM ]]... | Skip the browser page when opening https URIs for Zoom, Teams, and other native apps |
1,655,657,992,000 |
I have a function in a bash script (openWebPage) which I want to open a web page and navigate to an id tag within the page.
The url components are held in variables
PIXPAGE="/home/bu5hman/pix/pixpages/media.bu5hman.2005-.video.htm"
TT="tt0078435"
The call to the function composes the variables
openWebPage "$PIXPAGE#$... |
Solution found thanks to pointers from @Ignacio Vazquez-Abrams.
The issue was actually in the way xdg-open passes an argument to the default application.
If the default application is registered in kde desktop so as to expect a url (%u)
/home/bu5hman/Installs/seamonkey/seamonkey %u
then the whole argument passed to x... | xdg-open opens a specified htm file but ignores the tag (#) location within the page |
1,655,657,992,000 |
I'm creating a desktop for Linux. As a result, I'm creating a utility called ts-open. However, when xdg-open is run, I want it to open ts-open when it detects that my desktop is running (just like it opens kde-open in KDE.) Is there a way to do this? If it has to be coded into xdg-open is there someone that I can spea... |
You'd need to patch xdg-open to detect your desktop environment in detectDE(), and add an open_...() function that delegates to ts-open.
Once your DE is ready, you should contact the xdg-utils maintainers with a patch, either via a bug, or the mailing list.
| xdg-open backend |
1,655,657,992,000 |
I'm trying to change the default application for the filetype .xopp, which is a file for the xournalpp application. I currently ran the following commands:
xdg-mime query filetype 2022-06-09/note.xopp
which gave me: application/gzip. How can I make only the files that end in .xopp open in xournalpp? It works when I u... |
What worked for me on KDE (but on Ubuntu) was to open "File Associations" window from the application launcher (or alternatively open "System Settings" and go to "File Associations" there), then:
Create a new MIME type (the "+ Add..." button, bottom left)
Choose "application" in the menu and give "xopp" as type name
... | Xdg-Mime won't change default application for .xopp (Xournalpp) files |
1,655,657,992,000 |
I have a MIME definition file which is installed as part of a package:
$ rpm -ql virt-viewer | grep mime
/usr/share/mime/packages/virt-viewer-mime.xml
$ cat /usr/share/mime/packages/virt-viewer-mime.xml
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<... |
Installing perl-File-MimeInfo package resolved the issue!
More info at Why does `xdg-mime query filetype ...` fail to find a new added file type?
| XDG resolves filename as text/plain |
1,655,657,992,000 |
How can I tell xdg-open to open, say, YouTube URLs in a specific app, but use my default browser for all other URLs?
|
The closest you can get with xdg is using url-scheme-handlers, i.e. mailto, http, ftp... and so on.
xdg-settings list default-url-scheme-handlers
This will make Google Chrome the default handler for all https links.
xdg-settings set default-url-scheme-handler https google-chrome.desktop
You can't achieve domain spec... | Open specific URLs in certain app? |
1,655,657,992,000 |
Suppose I launch Firefox from my apps. Is the stdout and stderr redirected to a specific file or is it redirected to /dev/null? If it is indeed redirected to a specific file, I'd also like to know how to how to run applications from the terminal (e.g. nohup, & disown) without knowing where to redirect stdout and stdin... |
Typically the standard output & error from desktop environment components is redirected to ~/.xsession-errors or a similar file by default (may vary between distributions), and when you start an application like Firefox via GUI, it would inherit that redirection.
The standard input of a GUI application would typically... | Is it Possible to Read stdout and stderr of Apps Launched From the Desktop? |
1,655,657,992,000 |
Usually, a double dash separates options from filenames, but xdg-open does not care:
❯ xdg-open -headlinesAfter.epub
xdg-open: unexpected option '-headlinesAfter.epub'
Try 'xdg-open --help' for more information.
❯ xdg-open -- -headlinesAfter.epub
xdg-open: unexpected option '--'
Try 'xdg-open --help' for more informat... |
You can open the file by adding ./:
xdg-open ./-headlinesAfter.epub
| How to open a file starting with dash via xdg-open |
1,655,657,992,000 |
I am using a web cam in Zoom, which opens xdg-open to provide the video feed.
Unfortunately the feed is mirror image, so if I have text in the image then it is reversed and unreadable.
How can I modify the xdg-open settings to have a right facing image?
|
xdg-open has nothing to do with the presentation, and has no user options. It is just a wrapper that launches another application from the command line.
What application does the image come up in (it should have an about or help menu)? That's what needs configuration. xdg-open just uses a file association to determine... | Mirror image video using xdg-open |
1,655,657,992,000 |
I have set default file manager to ranger (xdg-mime query default inode/directory = ranger.desktop). Yet, when I am not in the terminal already, xdg-open / opens in the browser.
I have checked in /usr/share/applications/ranger.desktop is Terminal=true. Setting TERM=foot (my terminal) in /etc/environment did not help, ... |
xdg-open will use the default handler open_generic() function if your desktop environment cannot be detected or is not supported. The default handler does not support the terminal well and would resort to using your default browser to open the url.
The gio open command from glib2 can be used instead, as it has better ... | `xdg-open /` opens in browser when not already in terminal |
1,655,657,992,000 |
As a bit of background, I'm using Arch Linux with i3 as my window manager and I recently stopped using Nautilus as my default file manager and started using Thunar. The browser I'm using is Brave and I have it configured to ask where a downloaded file should be saved prior to downloading, the problem I'm having is tha... |
Programs use XDG mimetype associations when they want to open just the folder. In that case, D-Bus configuration would not matter – xdg-open would just spawn nautilus <url> or similar. (Nautilus itself might use D-Bus internally, but that is not a factor here.)
On the other hand, if your browser wants to open the fold... | Browser download location file manager is not using system default file manager |
1,429,002,573,000 |
I use xubuntu 14.04, 64 bit. Every now and then, when I try to paste some text in xfce4-terminal, instead of the expected text to be pasted, it is surrounded by 0~ and 1~, such as:
0~mvn clean install1~
The text is supposed to be mvn clean install -- I verified this by pasting the content in various other application... |
The issue is that your terminal is in bracketed paste mode, but doesn’t seem to support it properly. The issue was fixed in VTE, but xfce4-terminal is still using an old and unmaintained version of it.
You can try temporarily turning bracketed paste mode off by using:
printf "\e[?2004l"
| Copy-Paste in xfce4-terminal adds 0~ and 1~ |
1,429,002,573,000 |
To keep the overview I like to place multiple commands always in the same order and start them automatically together (gradle, git, database, scala-REPL, jboss...)
-H (hold) seems to mean that the terminal isn't closed after termination, but how do I terminate such a process willfully? Not at all? In such a way that ... |
The -H/-hold option is to keep the terminal emulator Window open once the applications started in it (shell or other) has exited. In that state, nothing more can happen.
If you want to start a command as a job of an interactive shell in the xfce4-terminal terminal emulator and keep the shell running and use it interac... | How to run xfce-terminal with different commands per tab and keep using the tabs after the commands have returned? |
1,429,002,573,000 |
I'm asking this question while using xfce4-terminal, but I'm interested in a general solution: is there a way to stop a terminal emulator announcing mouse support in consoles? I need mouse-select and copy-paste much more frequent that I need mouse support in vim or wherever.
|
You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).
In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somew... | How to disable mouse support in terminal? |
1,429,002,573,000 |
Hello I can't find the option to reassign shortcuts in xfce4-terminal 0.6.3. I'd like to reassign ctrl+c to copy, ctrl+v to paste and ctrl+shift+c to kill process. I know I can do that easily under gnome-terminal but since I'm using xfce I would like to avoid installing all the dependencies for gnome-terminal. Any ide... |
In xfce terminal go to Edit, hover your mouse over Copyand press ctrl+c.
Same goes for paste.
Kill process gets automatically reassigned to ctrl+c+shift.
| How to set ctrl+c to copy, ctrl+v to paste and ctrl+shift+c to kill process in xfce4-terminal? |
1,429,002,573,000 |
I'd like to start the Xfce Terminal in Xfce always maximized. (Usually, I do that through the launcher in the panel.)
I've already done that for Emacs by means of X resources; however, xfce4-terminal doesn't read X resources.
How to make it be always started maximized?
|
Unfortunately, xfce4-terminal doesn't read X resources, so that there is no unified way to make such configuration for all X clients which are xfce4-terminals (even remote ones.)
Start terminal maximized? has already been asked at reddit and answered; that's only a part of the complete correct answer:
Change the Exec... | How to start the Xfce Terminal always maximized in Xfce? |
1,429,002,573,000 |
I am using Manjaro Linux 18 (Arch Linux based Linux distro). I am using XFCE desktop environment. I have 8 workspaces on my computer. How do I move to the next and previous workspace using the command line?
I have Googled and found multiple apps on Github that are said to do that, but none seem to work.
|
You will need xdotool.
Installation
sudo pacman -S xdotool
Usage
Going to the next workspace
xdotool set_desktop --relative 1
Going to the previous workspace
xdotool set_desktop --relative -1
NOTE: Negative numbers are said to be allowed, but some versions of xdotool do not allow negative numbers or at least give an e... | How do I move move to the next workspace using command line? |
1,429,002,573,000 |
I'm using a bash script script.sh containing a command cmd, launched in background:
#!/bin/bash
…
cmd &
…
If I open a terminal emulator and run script.sh, cmd is properly executed in background, as expected. That is, while script.sh has ended, cmd continues to run in background, with PPID 1.
But, if I open another te... |
The process your cmd is supposed to be run in will be killed by the SIGHUP signal between the fork() and the exec(), and any nohup wrapper or other stuff will have no chance to run and have any effect. (You can check that with strace)
Instead of nohup, you should set SIGHUP to SIG_IGN (ignore) in the parent shell befo... | Process killed before being launched in background |
1,429,002,573,000 |
My xterm supports uni-code. For instance, it displays the Euro sign:
echo -e '\xe2\x82\xac'
But it does not display one particular character:
PL_BRANCH=$'\ue0a0'
echo $PL_BRANCH
This character displays properly in another terminal (terminator). I am using same font in both terminals (Inconsolata).
What could be the ... |
Modern terminal application uses additional fonts other than the default one when a character is unknown but xterm uses exclusively a single font (except for the special cases of double-width characters)
The needed char $'\ue0a0', echo $'\ue0a0' is part of OpenSymbol font, we can use it with xterm but as that font doe... | Xterm does not display one uni-code character |
1,429,002,573,000 |
With terminal emulators like gnome-terminal, it is possible to change settings programmatically, from the command line using dconf and gconf.
But I have trouble finding a similar mechanism for xfce4-terminal.
Specifically, how to select colors or a theme (or preset as it is called in the preferences menu).
I tried fin... |
My changes to RJ-Adam's answer were rejected, thus I give correcting answer:
User specific configuration can be set in
${XDG_CONFIG_HOME:-~/.config}/xfce4/terminal/terminalrc
Which commonly resolves to:
~/.config/xfce4/terminal/terminalrc
Edit that and so xfce4-terminal picks up the changes immediately, if it is run... | How to programmatically change settings of xfce4-terminal? |
1,429,002,573,000 |
I want to use FISH shell. But I've read FISH is not a POSIX shell so setting it to default shell by chsh is not recommended. What I want is whenever I start xfce4-terminal I would like to start FISH shell instead of bash. Adding exec fish to .bashrc seems to be a solution, but I want a to know if there is a way to sta... |
Yes, sure. Run:
xfce4-terminal --preferences
And make: Run a custom command instead of my shell and type fish in the box just below. That's it, close and start xfc4-terminal. That's it. Enjoy.
| How can I make xfce4-terminal start fish shell? |
1,429,002,573,000 |
If I run fish from a bash prompt, it will inherit the environment variables I have set in my .bashrc and .profile files, including the important $PATH variable. So far so good.
Now, I want xfce4-terminal, my terminal emulator, to use fish instead of bash. I found that it supports a -e command line parameter for that b... |
When bash is run as a non-interactive shell it will not source the .bashrc file and if you use a graphical display manager then the login shell used to run the GUI launcher commands might not have sourced the .profile file. Thus, commands run using the GUI launcher might not have the desired environment variables set ... | How do I create a GUI application launcher for xfce4-terminal with fish but inheriting the environment variables from bash? |
1,429,002,573,000 |
Is there a way to disable scrolling through command history for the Xfce terminal? I don't wish to rely on palm rejection, I'd just like it disabled when I'm using the terminal. Specifically I'm talking about not cycling through previous commands at the prompt when scrolling with mouse/touchpad.
|
You are describing the feature of VTE (used in XFCE Terminal) which translates wheel-mouse scrolling into up/down cursor-keys when using the alternate-screen. That happens if you are running screen in something like xterm. You can avoid that by preventing screen from using the terminal's alternate screen feature.
Fo... | Disable scroll inside Xfce terminal / Avoid scrolling through command history |
1,429,002,573,000 |
I want the Xfce terminal to run a command when it is turned on, for example print a welcome message or some system stats. I want this message to be printed only on the Xfce terminal emulator when it starts, not on some other terminal emulators. Can I achieve this effect by modifying the file terminalrc? How?
|
I found the solution. I added this code to the .bashrc file.
if [ $COLORTERM == "xfce4-terminal" ]
then
echo "Welcome to the Xfce4 Terminal"
fi
| How to make Xfce terminal run a command when it starts? |
1,429,002,573,000 |
I am using XFCE Terminal emulator 0.4.8.
My ~/.inputrc file:
# Insert Key
"\e[2~": paste-from-clipboard
"\C-v": paste-from-clipboard
"\e[A":history-search-backward
"\e[B":history-search-forward
"\M-[3~": delete-char
When I click <Del> a tilde is printed instead of deleting the next character. When I remove .inputrc ... |
The line
"\M-[3~": delete-char
is incorrect because it tells bash to look for the meta character for [, which (according to bash) could be the escape character followed by [, or it could be the character formed by OR'ing [ with 0x80, i.e., 0xdb which is Û
The actual key would use just the escape character, so you sho... | Tilde when clicking <Del> key |
1,429,002,573,000 |
OS: Linux Mint 18.2 sonya
DE: XFCE
By clicking the menu-button in the panel, there exists the option Run Program .... I want to create a shortcut in Menu/Settings/Settings-Manager/Keyboard/Application-Shortcuts to access this application-launcher from the menu. Does there a terminal command exist which i can use to as... |
As mentioned in the documentation from the Xfce documentation page, you can either use the Run Program from the Start menu or you can press ALT + F2.
Application Finder
If you know the name of a program and it is not on the panel or in the desktop menu you can use the run dialog. To open the dialog type Alt-F2 or c... | How to create a shortcut in xfce for "Run Program ..." |
1,429,002,573,000 |
I am running CentOS 7 with XFCE as my DE. I made a bash script, originally stored in ~/bin (I have since deleted it), which I wanted to have run automatically at startup. I somehow succeeded, but I have tried to remove it from my autostart programs, to no avail.
when I run ctrontab -e, I am given an empty file to ed... |
If you are running systemd you can create a service that will start yourt software and then use systemctl enable [your-service] to start it on boot up. If your using openrc(old init) then you can use a similar method just use rc-update add [service] default
| Other than crontab, what other ways can one add programs to run at boot time? |
1,429,002,573,000 |
In windows 7 using Windows Key + Left or Right arrow makes a window take up half the screen.
XFce 4 has the ability to tile either two windows side by side or 4 windows one in each of four corners (bottom left, bottom right, top left, top right).
Is it possible to add keyboard shortcuts so that you can move windows in... |
If you use other window managers with XFCE you can manipulate windows in many ways you don't currently have with XFWM. Compiz in particular with the grid and put plugins give you shortcuts to place windows in various positions like a tiling window manager. You'll want to install ccsm (compiz config settings manager) t... | keyboard shortcuts for placing an xfce4 window into the corner |
1,429,002,573,000 |
I would like to configure xfce4-terminal (in Xubuntu 16.04) only by using the terminalrc file, not by using the GUI interface.
The terminalrc file is the file where I can configure different options according to the xfce4-terminal's documentation.
its location: $HOME/.config/xfce4/terminal/terminalrc
examples of opti... |
As egmont suggested in a comment, the option to disable the scrollbar can be found by disabling it in the GUI and then, searching in the terminalrc file the added line.
Edit this file: ~/.config/xfce4/terminal/terminalrc
The option to add in the terminalrc file to disable the scrollbar is:
ScrollingBar=TERMINAL_SCROLL... | How to disable the xfce4-terminal's scrollbar with an option in the terminalrc file? |
1,429,002,573,000 |
Hi I'd like to change the key mappings slightly in xfce4-terminal, maybe similar to adding Xterm.VT100.translations to .Xresources.
In particular, I want to make ctrl-backspace delete the last word, and ctrl-delete delete the next word.
Bonus: I'd like to make alt act like ctrl (duplicate functionality) for backspace,... |
Okay here is what I have on my .zshrc for ctrl+←, ctrl+→ and alt+←, alt+→
## use Ctrl <- and Ctrl -> for jumping to word-beginnings on the CL
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
## the same for alt-left-arrow and alt-right-arrow
bindkey '^[[1;3C' forward-w... | Change key mappings for xfce4-terminal |
1,429,002,573,000 |
If I open terminal and execute w command then it will show:
user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart -
Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like
user tty7 :0 12:04 39:56 36.87s 0.06s
/s... |
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by “login” sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emul... | w command doesn't show all pseudo-terminal sessions |
1,429,002,573,000 |
I am trying to change my xfce4 terminal keybindings by editing the accels.scm file.
One of the changes I lines I wrote is (gtk_accel_path "<Actions>/terminal-window/next-tab" "<Alt>]"). However, this is not working: it seems that gtk needs me to use some name like "RightSquareBracket" or something of the sort instead ... |
Launch xev, press the key and use the 2nd value inside the parenthesis in the 3rd line:
KeyPress event, serial 38, synthetic NO, window 0x4200001,
root 0x7b9, subw 0x0, time 18425452, (520,545), root:(522,547),
state 0x0, keycode 51 (keysym 0x5d, bracketright), same_screen YES,
XLookupString gives 1 bytes:... | gtk name for [, ] and / |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.