Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
3
votes
1
answers
2851
views
Preventing other GUI applications from stealing focus?
How can I prevent other applications from stealing focus from the active window? I have found solutions for other window managers, but nothing for "Metacity (Marco)" (the window manager of the MATE desktop manager). I don't want to have to specify every time which window must be "always on top", unl...
How can I prevent other applications from stealing focus from the active window? I have found solutions for other window managers, but nothing for "Metacity (Marco)" (the window manager of the MATE desktop manager).
I don't want to have to specify every time which window must be "always on top", unless it can be done automatically every time I switch to a new window.
I have determined the window manager by running
wmctrl -m
.
EDIT:
I have tried switching the focus-new-windows
flag from smart
to strict
for both Gnome and Mate(Marco):
$ gsettings set org.gnome.desktop.wm.preferences focus-new-windows strict
$ gsettings set org.mate.Marco.general focus-new-windows strict
But it didn't work.
Eleno
(1859 rep)
Feb 9, 2016, 02:28 PM
• Last activity: Jul 28, 2025, 11:08 PM
11
votes
3
answers
3878
views
How to install two applications/packages simultaneously?
Example: FlightGear (2GB) is installing and I just need to install udftools quickly, and I wish not to break the giant flightgear installation for that. Windows also supports installing two programs simultaneously, but if I try it on Linux, even on a different user and tty, it fails. How do I instal...
Example:
FlightGear (2GB) is installing and I just need to install udftools quickly, and I wish not to break the giant flightgear installation for that.
Windows also supports installing two programs simultaneously, but if I try it on Linux, even on a different user and tty, it fails.
How do I install two applications simultaneously?
neverMind9
(1720 rep)
Apr 11, 2018, 02:49 PM
• Last activity: Jun 9, 2024, 05:08 AM
0
votes
1
answers
1075
views
How to isolate open applications, and ideally processes, in Ubuntu workspace?
I combine work and study, so I need a separate set of tabs for each task. For example: for work it is chrome with work-related tabs, vscode, obsidian.md and others, and for study - chrome, but with others, overleaf, pycharm, todoist etc. If you use built-in workspaces, the problem is that when you o...
I combine work and study, so I need a separate set of tabs for each task. For example: for work it is chrome with work-related tabs, vscode, obsidian.md and others, and for study - chrome, but with others, overleaf, pycharm, todoist etc.
If you use built-in workspaces, the problem is that when you open the same application in one workspace, it opens a window of that application in another workspace, switching workspaces.
I would like tabs to be separate, and ideally -- and processes, so that multiple instances of, for example, telegram, spotify, and similar applications can be opened. One way to do this is to have separate users, but when you switch between them, one or the other user instance goes into hibernation or shuts down.
So my question is: how to isolate open applications or even processes, if it's possible, in Ubuntu workspace?
essacult
(3 rep)
Jan 11, 2023, 10:56 AM
• Last activity: Jan 11, 2023, 11:26 AM
0
votes
0
answers
127
views
How can I create a Gantt Chart
How can I create a Gantt chart if I'm running CentOS 8? This is for standard project planning application -- I want to lay out the schedule for a bunch of work. I'm aware of TaskJuggler but want to be able to schedule the start/stop times of the tasks myself.
How can I create a Gantt chart if I'm running CentOS 8?
This is for standard project planning application -- I want to lay out the schedule for a bunch of work. I'm aware of TaskJuggler but want to be able to schedule the start/stop times of the tasks myself.
Dave
(119 rep)
Aug 31, 2022, 10:36 PM
3
votes
0
answers
418
views
CLI tool to run commands defined in a config file
I'm working as part of a team of developers on a software project with many moving parts. We use a Makefile to easily run commands and scripts that are regularly needed during development. Examples might be: - Set up a Python virtualenv. - Intialize the local development database. - Run a linter. -...
I'm working as part of a team of developers on a software project with many moving parts. We use a Makefile to easily run commands and scripts that are regularly needed during development. Examples might be:
- Set up a Python virtualenv.
- Intialize the local development database.
- Run a linter.
- etc.
Most of these commands don't need to be customizable using additional arguments, so Makefile targets work perfectly:
.PHONY: venv
venv:
python3 -m venv venv
venv/bin/pip install -r requirements.txt
$ make venv
But it gets really cumbersome if additional arguments need to be passed to a command from time to time. Two straight-forwared ways are:
- Pass the aditional arguments via a variable, e.g. make foo FOO_ARGS="lalala"
. Cumbersome and messy if arguments contain spaces.
- Find the target in the Makefile, copy it to the shell prompt and edit it.
### Idea for a solution
I came up with a really simple concept of what I actually need: A command line tool, e.g. called run
, that looks for an executable file called runfile
in the current directory and its parents and executes that file, passing any command line arguments to that file. Implemented in Python it could look like this:
#! /usr/bin/env python3
import sys, os, subprocess, pathlib
cwd = pathlib.Path().resolve()
# Go through the CWD (current working directory) and all its parents and look
# for an executable file called "runfile".
for dir in [cwd, *cwd.parents]:
run_script_path = dir / 'runfile'
if os.access(run_script_path, os.X_OK):
break
else:
print(
f'No executable runfile found in {cwd} or any of its parents.',
file=sys.stderr)
sys.exit(1)
# Run the runfile, forwarding any command line arguments to it. Use the parent
# of the runfile as CWD and pass the original CWD in the environment variable
# "RUN_PWD".
subprocess.run(
[run_script_path, *sys.argv[1:]],
cwd=dir,
env=dict(os.environ, RUN_PWD=str(cwd)))
The runfile could be using any scripting language. I could e.g. be a Bash script:
#! /usr/bin/env bash
case "$1" in
venv)
rm -rf venv
echo python3 -m venv "${@:2}" venv
;;
lint)
pycodestyle --exclude='./venv,./node_modules,./.git' "${@:2}" .
;;
*)
echo "Unknown command: $1" >&2
exit 1
;;
esac
("${@:2}"
inserts the script's arguments following the first one as separate words into a command line).
$ run venv --copies
# Would run "python3 -m venv --copies venv".
### The question
Is there already a tool like this that maybe has more features? It would be ok if the tool used its own language to define commands instead of simply executing the file.
### Additional notes
I know that some build also have support for this as secondary features, e.g. npm
allows defining [scripts
](https://docs.npmjs.com/cli/v8/using-npm/scripts) that can be invoked from the command line:
npm run foo -- args...
But this already requires two words before the name of the script and a --
before additional arguments, not as convenient as it could be.
Installing [console scripts entry points](https://setuptools.pypa.io/en/latest/userguide/entry_point.html#console-scripts) into a virtualenv and activating the virtualenv may sometimes be a solution. But in this case one of the use-cases is to set up the project's virtualenv, so that's a chicken-egg-problem.
I know that I could probably hack $(MAKECMDGOALS)
. No. 😊
Feuermurmel
(705 rep)
Feb 9, 2022, 03:28 PM
• Last activity: Feb 9, 2022, 03:38 PM
2
votes
2
answers
1066
views
Files holder application like dropover and yoink for Mac
I've recently switched back from macOS to Linux Mint. The only thing I miss about Mac is having a utility that could hold my files for copying and pasting while I switch between the desktops. Yoink worked in a way that when you drag a file to a configured area (say left edge) a mini window appears....
I've recently switched back from macOS to Linux Mint. The only thing I miss about Mac is having a utility that could hold my files for copying and pasting while I switch between the desktops.
Yoink worked in a way that when you drag a file to a configured area (say left edge) a mini window appears. You can drag your files there and the window stays on that edge even if you are switching between the desktops. You can easily then pick the files and drop where you actually want those.
This helped me in a lot of cases like:
- Drag the file from the browser and the drop in another tab (normally you'd have to first download the file)
- easy copy-pasting files between windows or desktops.
I am starving for a Linux alternative.
Danial
(21 rep)
Aug 22, 2020, 01:59 PM
• Last activity: Jun 28, 2021, 03:42 PM
0
votes
1
answers
119
views
How to get both the current working directory and the current process in the status line for tmux?
I would like to have two status lines with the first status line showing which directory the window is in and the second one showing which process is running in the window. Is this possible? I use bash but I am open to switching to another shell if it is easier to make this configuration. If this is...
I would like to have two status lines with the first status line showing which directory the window is in and the second one showing which process is running in the window. Is this possible? I use bash but I am open to switching to another shell if it is easier to make this configuration.
If this is not possible with tmux or very hard to configure, is there any other tool I can use which can provide me this info? (Basically I want multiple tabs/windows open in terminal, with the dir and process info.)
tattersail2207
(1 rep)
May 27, 2021, 01:57 PM
• Last activity: May 29, 2021, 10:39 PM
2
votes
0
answers
113
views
Application for tracking applications usage times
Does there exist a program which allows to automatically track "window focus" time in, for example, Gnome? For example, I would like to track how much time per day I spend using a certain chat application.
Does there exist a program which allows to automatically track "window focus" time in, for example, Gnome? For example, I would like to track how much time per day I spend using a certain chat application.
sequence
(321 rep)
May 18, 2021, 09:30 PM
-1
votes
4
answers
177
views
Writing custom alias for common bash commands
*[best practices question]* I'm just getting started with unix - and I find some of the common operations e.g. creating symbolic links `ln -s` or renaming files `mv` unintuitive. I am debating whether to define my own aliases e.g. `rename` , `symlink` instead. **Is this a bad idea? why (not)?** ---...
*[best practices question]*
I'm just getting started with unix - and I find some of the common operations e.g. creating symbolic links
ln -s
or renaming files mv
unintuitive.
I am debating whether to define my own aliases e.g. rename
, symlink
instead.
**Is this a bad idea? why (not)?**
---
**Note:** I'm not doing sysadmin stuff, and am just using the unix terminal for productivity on my own personal computer.
**Clarification:** By this I mean defining my own syntax for *any* unintuitive built in bash command - such that I can understand them better - but it would be exclusive to machines I control (access to my aliases)
Rosabel Marquez
(1 rep)
Feb 18, 2021, 07:19 PM
• Last activity: Feb 18, 2021, 11:39 PM
15
votes
5
answers
7692
views
Override the window title for an arbitrary window in KDE and set a custom window title
Using KDE here, but there might be a solution that works with other desktops environments too. I often am dealing with many many windows. Most windows contain many tabs (e.g. a Dolphin window with many tabs, or Firefox, Konsole, etc). The window title will change based on my current tab (which for t...
Using KDE here, but there might be a solution that works with other desktops environments too. I often am dealing with many many windows. Most windows contain many tabs (e.g. a Dolphin window with many tabs, or Firefox, Konsole, etc). The window title will change based on my current tab (which for the most part is helpful most of the time), but when working with so many windows I'd like to organize them a bit and **be able to manually re-name the window, overriding the the window title that the application gives**. I might name one Firefox window "Research" and other Firefox window "Documentation" to be able to easily distinguish between the windows that I've used to organize and group different tabs accordingly.
Ideally I'd be able to click on a window title bar and easily give it a custom name, but I'd settle for a solution that's slightly more cumbersome as long as it works.
I've tried
wmctrl -r :SELECT: -T "Research"
but that only works temporarily (the title is reverted when the application changes it, for example when switching tabs).
Sean
(1185 rep)
Oct 13, 2011, 04:03 PM
• Last activity: Feb 17, 2021, 06:12 PM
0
votes
1
answers
1399
views
how do you check to see if your cinnamon desktop is running with 3D acceleration (i.e. not "software rendering")?
I have a VM that is sluggish and I think I fixed the issue but I want to make sure the cinnamon desktop is running with 3D acceleration (i.e. not "software rendering"). How do you check to see if your cinnamon desktop is running with 3D acceleration (i.e. not "software rendering")?
I have a VM that is sluggish and I think I fixed the issue but I want to make sure the cinnamon desktop is running with 3D acceleration (i.e. not "software rendering").
How do you check to see if your cinnamon desktop is running with 3D acceleration (i.e. not "software rendering")?
Trevor Boyd Smith
(4181 rep)
Dec 16, 2020, 07:37 PM
• Last activity: Dec 16, 2020, 07:53 PM
0
votes
2
answers
299
views
Generic text expansion tool in Linux?
Is there a generic text expansion tool in Linux? I have to type some same strings frequently and I want to use abbreviation to type faster. For example, I type a lot "symbol testapp/testapp.debug" in `gdb`. I want to create a shortcut "symdbg", so that when I hit `TAB`, that string will be replaced...
Is there a generic text expansion tool in Linux? I have to type some same strings frequently and I want to use abbreviation to type faster.
For example, I type a lot "symbol testapp/testapp.debug" in
gdb
. I want to create a shortcut "symdbg", so that when I hit TAB
, that string will be replaced with "symbol testapp/testapp.debug".
I hope the tool can be generic so I can do it anywhere like terminal/browser/editors.
Edit:
I'm using Ubuntu with xmonad
, fish
shell in urxvt
terminal. But tools for other environment are good to know!
strongwillow
(109 rep)
Mar 9, 2020, 10:43 AM
• Last activity: Oct 23, 2020, 03:01 AM
2
votes
2
answers
2186
views
Autokey won't start
I installed `autokey-gtk` application but it won't start. When I run it from terminal it will write a message: Xlib.protocol.request.QueryExtension but that's all. The application won't start. Do you know what is wrong?
I installed
autokey-gtk
application but it won't start. When I run it from terminal it will write a message:
Xlib.protocol.request.QueryExtension
but that's all. The application won't start.
Do you know what is wrong?
xralf
(15189 rep)
May 1, 2011, 04:40 PM
• Last activity: Sep 25, 2019, 02:12 PM
0
votes
0
answers
642
views
Is there a tiling WM that allows to place a common background window for all workspaces persisting the ability to use tiling algorithms?
Recently, I came across the idea of placing a window with currently playing video behind transparent terminal, [like this][1]. At the moment, I am using `dwm`, and I can implement a simple case of this idea with one video and one transparent terminal using monocle layout (placing a window with video...
Recently, I came across the idea of placing a window with currently
playing video behind transparent terminal, like this . At the
moment, I am using
dwm
, and I can implement a simple case of this idea
with one video and one transparent terminal using monocle layout
(placing a window with video behind a terminal), but I want to implement
more complicated things:
1. to make one background window with video that will be common for all
tags/workspaces - so it will be possible to switch tags/workspaces while
persisting background video;
2. to have an opportunity to use tiling layout algorithm above the
window with video.
There is a sticky patch for dwm that allows to have a common window
for all tags, but I didn't find the way how to persist background
monocle client on other tags with tiling layout (frankly, I doubt that
this is possible in dwm).
I think that this would be possible if there were some kind of
containers that can store different layouts on different layers
(sub-layouts?), so, for example, I could create container with "deck"
layout, place video in bottom element and activate "tiling" layout in
upper element, but even in that case I don't know how to persist video
between different workspaces...
Is there any way to do such things in dwm or any other tiling wm?
Aleksandr Fedchenko
(1 rep)
May 5, 2019, 09:33 AM
• Last activity: May 5, 2019, 10:54 AM
1
votes
3
answers
1404
views
Shortcut to delete command but keep arguments
When working in terminal I often have sequences of commands like: cat long/path/to/file/xyz.file nano long/bath/to/file/xyz.file bash long/path/to/file/xyz.file etc Usually I hit control + A, right arrow a few times, backspace a few times, then write the new command. But during the ten seconds I am...
When working in terminal I often have sequences of commands like:
cat long/path/to/file/xyz.file
nano long/bath/to/file/xyz.file
bash long/path/to/file/xyz.file
etc
Usually I hit control + A, right arrow a few times, backspace a few times, then write the new command.
But during the ten seconds I am doing this, I always wonder if there is some magic shortcut that will do this for me. So my question is...
**Is there a terminal shortcut to delete the command but keep arguments?**
If not, is there a way to write your own shortcuts?
The terminals I use most of the time are Ubuntu and OSX if that matters.
sudo rm -rf slash
(163 rep)
Oct 2, 2017, 03:22 PM
• Last activity: Apr 16, 2019, 02:55 PM
1
votes
1
answers
778
views
Stack tabs when using Geany
Is there a way on Geany text editor (Linux) to stack tabs, such that there are multiple rows of tabs? Issue: Sometimes I have open 30 or so files in Geany. But Geany only shows about 10 on average (based on the size of the file). Desired solution: Specify in a configuration setting how many levels o...
Is there a way on Geany text editor (Linux) to stack tabs, such that there are multiple rows of tabs?
Issue: Sometimes I have open 30 or so files in Geany. But Geany only shows about 10 on average (based on the size of the file).
Desired solution: Specify in a configuration setting how many levels of tabs for Geany to use. E.g., 1 (default), 2, 3, 4, ... max.
More info: Is there a plugin for this which already exists? If not, how feasible is it to create a plugin for this behavior?
There
(111 rep)
May 5, 2018, 11:43 AM
• Last activity: Jun 3, 2018, 01:08 PM
2
votes
1
answers
87
views
ZSH - Autosuggest for the values output in the terminal window?
Is it possible to achieve the following ➜ ag editNote src/store/actions.js 8:const editNote = ({ commit }, e) => { 26: editNote, src/components/Editor.vue 5: @input="editNote" 22: 'editNote', /frontend on master [✘!?] ➜ vi Ed For example I would like to start typing **vi Edit** and get this replac...
Is it possible to achieve the following
➜ ag editNote
src/store/actions.js
8:const editNote = ({ commit }, e) => {
26: editNote,
src/components/Editor.vue
5: @input="editNote"
22: 'editNote',
/frontend on master [✘!?]
➜ vi Ed
For example I would like to start typing **vi Edit** and get this replaced with
**vi src/components/Editor.vue**
DmitrySemenov
(805 rep)
Jan 30, 2018, 12:39 AM
• Last activity: Feb 4, 2018, 10:40 AM
1
votes
2
answers
2712
views
Why should not I update to most recent kernel immediately after release
Question intended for **system administrators.** Consider system running a old but working kernel and all the required functionality is available. (Ubuntu 12.04 LTS specifically with kernel 3.2) Then a new version of kernel is released ( Ubuntu 16.04 LTS with kernel 4.4). Above is just an example ca...
Question intended for **system administrators.**
Consider system running a old but working kernel and all the required functionality is available. (Ubuntu 12.04 LTS specifically with kernel 3.2)
Then a new version of kernel is released ( Ubuntu 16.04 LTS with kernel 4.4). Above is just an example case.
I have been suggested that I should not immediately update to most recent releases on the production system even if the release has support. Why is it so ? How long should I wait ?
ankit7540
(331 rep)
May 12, 2016, 02:52 PM
• Last activity: Jan 25, 2018, 06:50 PM
3
votes
1
answers
196
views
What is the command line equivalent of kupfer/quicksilver/synapse quick starter?
I want a way to quickly launch programs while I'm in an SSH terminal. But I don't want to have to remember the exact command. For example, if I type "fox" into kupfer/synapse/quicksilver or unity search, it will bring up firefox. Likewise if I type "browser" it'll bring up firefox. What is the comma...
I want a way to quickly launch programs while I'm in an SSH terminal. But I don't want to have to remember the exact command. For example, if I type "fox" into kupfer/synapse/quicksilver or unity search, it will bring up firefox. Likewise if I type "browser" it'll bring up firefox.
What is the commandline equivalent to this? Such that I can type
browser
and it lists firefox
in the terminal
I am familiar of course with hitting tab, but that assumes I have the first few letters correct, and doesn't let me type 'browser'. I am familiar with findutils locate
command, but again, same problem. I want the smooth desktop experience via text, much like lynx
browser gives a web experience via console.
Jonathan
(1555 rep)
May 14, 2017, 08:39 PM
• Last activity: May 16, 2017, 01:01 AM
6
votes
1
answers
846
views
What is a good way to maintain a backup of emails?
I want to be able to save my emails from various sources in a standard format and maintain a backup. An analog is taking pictures from multiple devices (e.g. cameras and smartphones) and saving all of them in a directory in JPEG format. The issue with archives (using export feature from KMail that I...
I want to be able to save my emails from various sources in a standard format and maintain a backup. An analog is taking pictures from multiple devices (e.g. cameras and smartphones) and saving all of them in a directory in JPEG format.
The issue with archives (using export feature from KMail that I mainly use or any other client) is that there is no easy way to determine if an email has been lost between two backups. An analogy is taking backups using
rsync
. To explain, let us say I keep two backups, B1 and B2 where the former is updated from my data source (e.g. my smartphone) and B2 is synched from B1 after a few days. It is easy to spot accidental deletions by doing dry runs in verbose plus delete extraneous files in destination mode, when doing the B1 to B2 sync. Related is also the problem of introducing email duplicates. Is there a smart way to save all emails?
pdp
(717 rep)
Nov 26, 2016, 05:40 PM
• Last activity: Nov 29, 2016, 12:30 PM
Showing page 1 of 20 total questions