date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,316,752,812,000 |
who -r
run-level 4 2015-01-19 21:56 last=S
I'm on slackware,what does it mean S?
Previous runlevel?
|
Yup. Previous runlevel, which in this case appears to be Singleuser mode.
| Who command: what is S on slackware? |
1,316,752,812,000 |
I'm working on a user menu so that when a user logs in all they get is this menu; on this menu is a selection of reboot option. I want one of the options to be reboot the system if no one is logged in.
I want a search to be carried out to see if anyone has logged in. I think this would be a good start:
# who | wc
i... |
This seems like what you're looking for. The issue as I see it is that there's always going to be at least 1 user that's logged in, i.e. the one accessing the menu, so you're looking for when the number of user's is 1.
$ who | awk '{print $1}' | sort -u | wc -l
1
This takes the output of who and cuts just the first ... | I want to reboot the system once a search had been done to see that no-one is logged in |
1,316,752,812,000 |
I'd like to perform selective shutdown of a server in my house after backing-up over SSH. My post-backup script waits for five minutes and then runs a very short 'safe shutdown' script located on the server. This script was using who -q to get the number of users logged on, however as I started executing this script n... |
As meuh says, the use of a pseudo-terminal may be forced with the -t option, and then the login will show-up with who. However whilst this a home system, if it weren't it still would concern me a little that if someone logged in without using that switch I might be unaware of his presence on my system without looking ... | How to Use who/w with Non-Interactive SSH logins |
1,316,752,812,000 |
How to view all currently logged in users on Alpine Linux? It doesn't have who by default apk add who doesn't find any packages. Is there another package for Alpine that contains who? Or does it use some other utility for the same purpose?
I tried to look at the docs but searches for "list users" and "logged in users"... |
The who program is part of the coreutils package. You can use apk add coreutils to install it:
# which who
#
# apk add coreutils
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/3) Installing libacl (2.2.... | How to view all currently logged in users on Alpine Linux? |
1,316,752,812,000 |
How does users define what users are logged in?
If I ssh into a box twice, I see my username twice listed if I execute users. However, if I create a new login shell via sudo su -, I do not see root listed as users. Same goes for any other user such as sudo su - user. Of course, a non-login shell also doesn't show up i... |
users counts login sessions. From sudo:
The su command is used to become another user during a login
session.
(Emphasis is mine.) A login session creates a new tty, where as su uses the existing tty.
I just looked at the source code to the users command. What it does is read utmp. So I guess the bottom line is th... | Why does the `users` command return different users depending on whether I ssh or open a new terminal? |
1,316,752,812,000 |
I noticed by chance today that I had 2 users running on my Linux system.
I do not know much about Linux users but I ended up running the “w” command that gave the following output when Firefox is running:
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
main seat0 login- 17:22 0.... |
That is normal.
The seat is all of the hardware devices that are in your workspace which is in your case, is seat0 as you are logged into a Gnome session whereas tty2 or the terminal is what is being used to run firefox. In your case tty2 is attached to seat0. If you were to log in via SSH, there would just be pts/0 (... | My username mentioned twice in who command |
1,316,752,812,000 |
I have the following script.
#!/bin/bash
#Solution script1
who
date +"Today %d %B, there are $# users logged in onto the system"
In the background user1 has logged in onto tty2 and tty3 and root has logged in onto pts/0 and tty1. The answer then should be
Today 22 Oktober, there are 2 users logged in onto the syst... |
Just parse the output of who:
#!/usr/bin/env bash
num=$(who | sort -uk1,1 | wc -l)
date +"Today %d %B, there are $num users logged in onto the system"
Explanation
sort -uk1,1 : the -k1,1 means "sort on the 1st field and only on the first field". The -u means "print only the unique sort fields". Together, they will p... | Scripting: Counting users logged in onto the system |
1,316,752,812,000 |
I would like to know how the command "who" pulls out information about ssh history into a Linux system. For example, on my shared-network workstation, where everyone can ssh into it:
[johny@gandor ~]$ who
johny :0 2018-08-30 06:44 (:0)
johny pts/0 2018-08-30 06:45 (:0.0)
johny pts/1 2018-08-30 ... |
Take a look at the man page for who. e.g. "If FILE is not specified, use /var/run/utmp."
This is not a text file, so opening with vi will offer a poor view of the file contents. od -c /var/run/utmp | more would serve better.
| Source of information - command who |
1,316,752,812,000 |
The X window system in a desktop Linux (where just one physical monitor is used) usually uses display 0, screen 0.
The output of who in Ubuntu 14.04 is
user1 :0 2016-06-15 14:25 (:0)
where :0 is the abbreviation for :0.0 (:display.screen). Here I logged in only from the GUI.
Then I opened a terminal emula... |
You're referring to the text at the end of the line. That is written by screen to indicate which pseudo-terminal connection it is using, as well as which window-number screen has assigned to it. Comments in the code indicate what it does:
/*
* Construct a utmp entry for window wi.
* the hostname field reflects w... | Display used by screen in utmp |
1,316,752,812,000 |
I run who -b to get the date of the last reboot. It returns 2013-10-29 14:55.
Now ran by a daemon (I am sending this date to a server) it returns Oct 29 14:55. But some other times (before last reboot in Oct 29) it would return something like 2013-10-24 13:17 consistently.
First set of questions :
What in an environme... |
This is probably due to a locale change:
$ locale | grep LC_TIME
LC_TIME="en_GB.UTF-8"
$ who -b
system boot 2013-11-04 10:04
$ LC_TIME=C who -b
system boot Nov 4 10:04
Perhaps your locale was changed, and didn't take effect until after the reboot (perhaps you didn't update your environment after ... | who -b date format varies strangely |
1,316,752,812,000 |
Working on a Raspberry Pi 2, running Raspbian GNU/Linux 9 (stretch).
I am simply trying to understand why, when I run the top command I can see some users that I cannot see in the who command. Here is output of the commands run on the RPi:
$ top
top - 12:36:42 up 2 days, 15:19, 2 users, load average: 0.29, 0.34, 0.... |
You can find additional information about your system's command-line tools and their parameters by looking at their "man page" (by running man who, for example).
From the respective man pages:
top - display Linux processes
who - show who is logged on
While we're at it, there is also:
w - Show who is logged on an... | Why is top command showing users that the who command is not? |
1,316,752,812,000 |
When I type who in my console terminal, I get the following output:
hubert :0 2014-05-16 21:40 (:0)
hubert pts/0 2014-05-16 21:46 (:0)
From info who I know that both :0 and pts/0 should name instances of the terminal. It is clear to me what pts/0 means but I have no idea how to interpret the fir... |
:0 is an X display name. This means they logged in through XDM on the :0 framebuffer.
pts/0 is a pseudo-tty, this is an xterm or gnome-terminal window.
| What is the :0 terminal in the who command's output? [duplicate] |
1,316,752,812,000 |
Consider I have created a user 'test' during Installation which I use to login to my system. My root user is 'root'. I further open two terminal sessions for each of the users respectively. Now the problem is when I type the 'w', 'who' or even the 'finger' command (in my root terminal session) to list all users logged... |
New terminal window, I then use su - username to log in to the other user
This is your error of thinking. You are not logging in.
su does not create a login session. It is not a login mechanism. It "switches user" to run a program under the aegis of a different user account, adding privileges (that account's privi... | Seeing user two times |
1,316,752,812,000 |
I am a Linux system admin, I will login every system of my local network. I don't want my IP to show up via who command.
For example, if someone enters:
$ who
it reveals my IP. Is there any way to hide my IP from the who Linux command?
[EDIT by chrips]
This is important for those concerned with their personal util... |
Most simply you could make the utmp log files non-world readable. This is even mentioned in the utmp man page:
Unlike various other systems, where utmp logging can be disabled by removing the file, utmp must always exist on Linux. If you want to disable who(1) then do not make utmp world readable.
like this:
sudo c... | How can I hide my IP from linux who command [closed] |
1,316,752,812,000 |
I am in a Linux/Unix Systems class and I need to determine commands I can use to determine who is logged in on a specific terminal? I know there is the w, who, or finger commands. Do any of these commands have options to show a user on a specific terminal or type of terminal?
|
The second field in the who command shows the console (terminal) that users are logged in on.
username tty2 2017-07-16 19:05 (:0)
| Commands I can use to determine who is logged in on a specific terminal? |
1,316,752,812,000 |
(Example screenshot taken from https://askubuntu.com/questions/1343872/ubuntu-shows-other-users-are-logged-in-whenever-i-shut-down-even-though-i-am-the)
But my question is: how does the system know this? I have done
sudo chmod o-r /var/run/utmp
sudo chmod o-r /var/log/wtmp
And I verified that my user cannot run w or... |
The information about active sessions and logged in users is provided by systemd-logind (or elogind on non-systemd systems) and any user can get the information via the DBus interface:
$ busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ListUsers
a(uso) 2 1000 "jenkins" "/org/fr... | "Other users are logged in" how does the system know? Where is the information leaking? |
1,316,752,812,000 |
I have 2 machine setup of rhel7 , one is in terminal mode and the other is in grahical mode , when I run 'who' command on both the machines why do I get 'tty' in 2nd column output for the machine in terminal mode and 'pts' for machine in graphical mode
|
See here
What is the purpose of the pts directory in linux
The pts/0 is telling you which "pseudo terminal" the user was logged in on. In this case it's terminal 0,1,2 etc.
A tty is a native terminal device, the backend is either hardware or kernel emulated.
A pts (pseudo terminal device) is a terminal device which i... | Explain who command output in 2nd column [duplicate] |
1,316,752,812,000 |
When I issue the command who in a bash terminal:
$ who
me console 2018-11-09 07:13
me ttys000 2018-11-09 07:13
me ttys001 2018-11-09 07:13
The manual states:
who - show who is logged on
Print information about users who are currently logged in.
I am working on two terminals ttys000 and ttys00... |
Taken from an answer from this question:
Historically the console was the main physical device used by the System Administrator to control the server, and TTYs were the users' serial terminals attached to a server. Now console and tty0 usually identify the same virtual device.
| The console terminal demonstrate by who |
1,316,752,812,000 |
The command w said
02:50:35 up 20:54, 10 users, load average: 1,07, 1,29, 1,41
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
myuser :0 - lun05 ?xdm? 1:38m 0.11s /bin/sh /etc/xdg/xfce4/xinitrc
myuser pts/0 - 02:06 31:29 2:45 7:35 /usr/bin/xfce4-... |
This is somewhat difficult to explain but /dev/pts/n are just virtual devices which only serve to move data form the keyboard to the program to standard output and aren't actual files. There will be a new pts spawned for every application you run which is why they sometimes won't match up.
| who and w report my user ten times..but I have only four pts open |
1,316,752,812,000 |
I have just used the command 'last' to see who has logged into my server.
I am unsure how to read some of the output, particularly in Column 2 where it states pts/l and :0.
Instead of spoon feeding me the answer, could you point me in the direction of a good source or pdf's to read in order to become more familiar wit... |
pts/1 is your pseudoterminal. A pseudoterminal provides processes with an interface that is identical to that of a real terminal.
http://linux.die.net/man/4/pts
:0 is your X11 Display
https://en.wikipedia.org/wiki/X_Window_System
| how to read ssh output from 'last' and 'who' command |
1,316,752,812,000 |
In the terminal, how can I reveal the real name of the users online (with university IDs)? getent?
|
There are a number of tools to allow you to do that. Try them all:
who
w
last -p now
finger
which one you prefer is up to you :-)
| How can I reveal the real name of the users online (with university IDs)? |
1,316,752,812,000 |
I'm working on a script an I need to show how many people are logged into XServer. It was suggested that I look at the last part of the who command (N:N):
user1 tty7 2013-10-10 12:14 (:0)
I'm trying to find information on this an having trouble finding it. Any info would be appreciated. Thanks.
|
That's the display and screen information. When you're within an X session, you should find something like :0 in $DISPLAY.
This number is broken down into two parts: the first number is the display number: this generally is a group of devices that contains one or more screens, with one or more input devices. The scre... | How many XUSER's |
1,316,752,812,000 |
If I connect via SSH to my Debian 12 Server from another Linux Server and run the who -m command, it displays the following:
test-user pts/1 2024-01-24 11:13 (xx.xx.xx.xx)
But, if I connect from a Windows 11 computer, via Windows Terminal or using a third-party App to connect to the same Debian 12 Server us... |
If you look at the source code of the GNU implementation of who, you see:
if (hard_locale (LC_TIME))
{
time_format = "%Y-%m-%d %H:%M";
time_format_width = 4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2;
}
else
{
time_format = "%b %e %H:%M";
time_format_width = 3 + 1 + 2 + 1 + 2 + 1 + 2;
... | Display consistently the date and time output for the who command |
1,484,765,828,000 |
I would like to resize the window to the left half of the screen.
A solution to achieve that would be to use wmctrl and keybind the right command to a keyboard shortcut.
But the manpage only shows how to resize to a certain height and width, for example:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && w... |
I got the answer here.
this would be the script to maximize it to the right half of the screen:
#!/bin/bash
# resizes the window to full height and 50% width and moves into upper right corner
#define the height in px of the top system-bar:
TOPMARGIN=27
#sum in px of all horizontal borders:
RIGHTMARGIN=10
# get widt... | How do I resize the active window to 50% with wmctrl? |
1,484,765,828,000 |
The following script fails to resize an already maximized window:
wmctrl -i -r :ACTIVE: -b remove,maximized_vert,maximized_horz
xdotool windowunmap --sync
xdotool windowmap --sync
wmctrl -r :ACTIVE: -e 0,300,168,740,470
I am pretty sure the culprit is in the middle two lines, which I am meaning to apply to the curr... |
Looks like the -i option in the first wmctrl cmd is causing trouble.
Try this:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,300,168,740,470
| Resizing a maximized window from the command line |
1,484,765,828,000 |
Currently I have successfully used wmctrl -r :SELECT: -t 2 but something like wmctrl -r -i 0x03e00003 -t 2 does not work. How should I write the command in order to select the window to be moved by ID not by mouse?
I am using Linux Mint 13 with the default MATE DE .
I have also tried wmctrl -i -r 0x03e00003 -t 2
... |
Perhaps you're getting confused with the -t # switch. The windows are numbered as starting with a 1 but the first window is actually number 0. Notice in the output of wmctrl -l:
$ wmctrl -l
0x00c00028 -1 grinchy Top Expanded Edge Panel
0x0120001e 0 grinchy x-nautilus-desktop
0x06015fee 0 grinchy saml@grinchy:~
0x060... | How to move a window to a different workspace using its ID, in bash? |
1,484,765,828,000 |
I would like to execute a command-line command that activates "click and drag" mouse selection on a single local X11 screen.
The goal is to:
get the selected rectangle X and Y coordinates,
get the rectangle width and height,
output these values to stdout,
(optional) draw a selection border while dragging the mouse.
... |
A simple tool is the import command from ImageMagick. Simply provide an output filename:
$ import /tmp/out.png
and it will grab the mouse and show an appropriate cursor. Press button 1 and drag out a rectangle which will be shown as a wire frame. Let go and the file will be created. You can get the info from this fil... | Command-line tool to get "click and drag" rectangle coordinates from the screen [duplicate] |
1,484,765,828,000 |
I have a startup application that has no option to "start minimized" or "close to system tray" etc. and therefore would like to use a startup script that will first start the application and then minimize its window.
Actually, I already have a startup script that closes the window of an application which luckily has a... |
You can use xdotool like that:
xdotool search "Mozilla Firefox" windowminimize
| How to minimize an application window from command line |
1,484,765,828,000 |
In the era of X11, I could do wmctrl -l to list available windows, that I can use in my scripts.
$ wmctrl -l
0x01000050 0 my-pc project1 – Readme.md
But nowadays most application use Wayland. The above command only shows windows that are running with XWayland.
I want to be able to use applications in Wayland mode an... |
Yes, it is possible. The idea is to ask kwin for this information. It is done via kwin script. It can only communicate the world with dbus, so we cannot run shell commands in kwin scripts (at least directly). But we can run kwin script from shell script.
Create the following script ~/bin/list_windows.js:
const clients... | Is there a way to get list of windows on KDE Wayland? |
1,484,765,828,000 |
I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround:
myprogram &
sleep 1
winID=$(wmctrl -l | awk '/./{line=$0} END{print $1;}')
But this relies on three heavy assumptions:
the program will take less than 1 second to ... |
To get the Window ID in my program, I have the program set the title to something unique, then have the program start wmctrl and parse its output (and not the shell script that started the program), and then report on the Window ID (most often via a file).
Since the program doesn't continue until the windows are open,... | Retrieve X11 window ID of a just-launched GUI-program |
1,484,765,828,000 |
As a first project for learning awk, I wanted to reformat the output of the wmctrl command, which can be installed like this in Debian 11:
sudo apt install wmctrl
To list information about all the windows I have open, I run this command:
wmctrl -lpG
Sample Output:
0x0120002b 4 7 2 157 3836 2068 my-pc windo... |
wmctrl -lpG \
| awk '{
tmp=$0;
# remove first 8 fields from tmp
sub(/^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ /,"",tmp);
print "----------------------\nWindow ID: " $1 "\nDesktop Number: " $2 "\nProcess ID: " $3 "\nx-offset: " $4 "\ny-offset: " $5 "\nwidth: " $6 "\nhe... | AWK - Dealing with spaces in the last column of output from wmctrl |
1,484,765,828,000 |
I am using a 21:9 Monitor and wrote a script to tile/align my windows to the left, centre and right side of the monitor, using keyboard-shortcuts:
┌─────────┬─────────┬─────────┐
│ window1 │ window2 │ window3 │
│ left │ centre │ right │
│ aligned │ aligned │ aligned │
└─────────┴─────────┴─────────┘
The script ... |
The -i option needs a window id, which is what you get if you just run
xdotool getactivewindow
which prints a decimal number like 20971543. So you can do
wmctrl -i -r "$(xdotool getactivewindow)" ...
But you don't need to do this as wmctrl accepts a pseudo-window id string of :ACTIVE: to mean the focused window, so ... | How to resize and move a window by its PID using `wmctrl`? |
1,484,765,828,000 |
I have a dual monitor setup with Compiz as window manager on Ubuntu 14.04. I can resize a window to stretch over both windows. However, while the physical display panels are a few centimeters apart, the software by default thinks of them to be right next to each other without a gap in between. This means, e.g. a diag... |
I found a related question on Ask Ubuntu which sort of did the trick for me. Instructions for the whole process, including creating the "gap" between monitors (works at least on Ubuntu 14.04):
Find out the current total screen size (assuming there's currently no virtual gap between monitors):
$ xrandr | grep Screen
S... | Stretch window over two monitors with "gap" in between |
1,484,765,828,000 |
I am trying to just get the application name out of this code:
wmctrl -l
but I don't know how to do it!
If you could please explain how I could do this, that would be great.
EDIT:
The output of wmctrl -l is:
0x01000007 -1 parrot Top Expanded Edge Panel
0x01000017 -1 parrot Bottom Expanded Edge Panel
0x01200006 -1 par... |
There's several ways to do it. Depending on your preferred type of tool, you might choose one over other
AWK
Most appropriate way. Set words 1,2,3 to empty string and print
$ wmctrl -l | awk '{$1=$2=$3="";print}'
Alternatively to get rid of leading space, you can do this:
$ wmctrl -l | awk '{for(i=4;i<=NF;i++) prin... | Getting just the application name from wmctrl -l |
1,484,765,828,000 |
I am trying to use wmctrl to move a window to a workspace.
By wmctrl -l window is
0x03e00057 9 meer montazo - Google Search — Mozilla Firefox
Command and output is
/usr/local/bin/wmctrl -v -i 0x03e00057 -t 3
envir_utf8: 0
No window was specified.
My understanding is that -i points to the hex id of the window (f... |
From the documentation of -t <DESK>:
Move a window that has been specified with the -r action to the desktop <DESK>.
Thus:
wmctrl -i -r 0x03e00057 -t 3
-i means that any argument that specifies a window is a window ID rather than a substring of the window title. It's a simple option, not followed by a window ID. It... | wmctrl move window to workspace |
1,484,765,828,000 |
I'm running Ubuntu 20.04.5 LTS with the XFCE4 window manager.
I'm looking for a way for a shell script to be fired off when a particular X Window has been closed.
I know that I can create a program to run wmctrl or xdotool over and over again in a loop that checks for the existence of the X Window in question, and the... |
A simple way to do this is with the xprop standard X11 utility. You provide a means of identifying the window, by window id, window name, or interactively by clicking on it, and it shows the X11 properties of that window. Adding the option -spy will make it loop waiting for changed-property events, which it will displ... | Detecting when an X Window has been closed |
1,484,765,828,000 |
If I type these two commands in a terminal:
xfce4-terminal --hide-menubar --hide-borders --hide-toolbars --title=dt
wmctrl -r dt -e 0,10,10,720,720
I get the desired result (position and resize of window with title dt, noting than unlike gnome-terminal, xfce4-terminal doesn't rewrite manually assigned titles)
Natural... |
The && concatenation operator causes the second command not to be executed until after the first command (xfce4-terminal) exits (and only if the exit status indicates success, since it is a short-circuit logical operator).
You should get the behavior you expect if you change && to ; or simply place the wmctrl comma... | WMCTRL not working after starting xfce4-terminal |
1,484,765,828,000 |
Is it possible using wmctrl to send keystrokes to a window? I know it's possible by using xdotool. Both tools are very similar, so maybe I missed something when I read the man pages for wmctrl.
|
No, wmctrl doesn't have ability to send keystrokes in the sense of typing out letters and key combinations. There is -c flag for closing window, which can be used to emulate Ctrl+F4 for closing a window, but that's a stretch of reasoning.
You can combine those, of course, although wmctrl refers to window XIDs in hexa... | Sending key with wmctrl |
1,484,765,828,000 |
I want to list main applications processes report in this format
ps -e -o pid,comm,pmem,pcpu,uname
To filter main GUI applications wmctrl -pl is the only way I can get processes ids.its great if xlsclients can be used. It contains the real list with names I want.
How can I combine them as single commands to get repor... |
It's often the case that in Unix you can chain commands together, and often times many commands are built specifically so that they'll work with the output generated by other commands.
Luckily you can take the output of xlsclients and parse it down so that it's just the name of the command. You can then pass this info... | Get report of the gui application processes |
1,484,765,828,000 |
I have many figures of widthxheight (550-570)x(465-486) at the southwest logically set there by Matlab's movegui() function.
I would like to open all those southwest windows of the size range in an external display or in Workspace 2.
Meuh's command shows those figure dimensions width x height, their hex codes and ti... |
There is no supported working solution for Gnome 3.14 in Debian 8.5.
Let's hope the next release of Gnome at Q1-Q2 2017 will help the case.
| How to move windows of dimension range to Workspace 2? |
1,484,765,828,000 |
You can list the process ID of each widow with this command:
wmctrl -lp
Does there exist a command that shows the running command of each window (kind of like htop has a column for "Command")?
If not, how could you combine commands to ultimately achieve this?
|
This will replace the pid in wmctrl -lp’s output with the corresponding command, if one is found:
wmctrl -lp | awk '{ pid=$3; cmd="ps -o comm= " pid; while ((cmd | getline command) > 0) { sub(" " pid " ", " " command " ") }; close(cmd) } 1'
This obviously won’t work for windows displaying remote processes; it also wi... | List Running Commands of All Windows |
1,484,765,828,000 |
The following fails to resize my active window (simply nothing happens). Is there something I'm missing?
The command I used is:
wmctrl -r -e :ACTIVE: 0,100,100,600,400
|
You syntax for the command is wrong, use:
wmctrl -r :ACTIVE: -e 0,100,100,600,400
The -r parameter expects a window name string (or :ACTIVE:) and the -e paramter expects the dimensions.
| Wmctrl Resizing Issue |
1,484,765,828,000 |
I have shortcut keys setup that take the focus to a certain application in my Xubuntu setup.
So e.g.:
START+1 takes me to my main web browser window
START+2 takes me to my main Sublime window
START+3 used to take me to IntelliJ IDEA using this command set in XFCE settings editor under xfce4-keyboard-shortcuts:
bash -c... |
Try using xprop to get the class of the window and then use that instead of the title, this shouldn't change any time soon.
You can run xprop | grep -i class from a terminal and then click on your Intellij IDEA window and it should print out the class in the terminal.
I have not used wmctrl, but I use the class or app... | Ubuntu: XFCE: Is there a workaround for swiching to IntelliJ IDEA with wmctrl after IDEA removed "IntelliJ" from the `window title`? |
1,390,467,595,000 |
As root, I'm connecting to a remote host to execute a command. Only "standarduser" has the appropriate id-file and correct .ssh/config, so I'm switching the user first:
su standarduser -c 'ssh -x remotehost ./remotecommand'
The command works fine, but despite the fact that I used "-x" (disable X11-Forwarding) and hav... |
Seems like your root lacks some X11 magic cookie in the .Xauthority, which your standarduser has. Here is how to fix this.
SHORT VERSION (thanks to @Vladimir Panteleev)
standarduser@localhost:~$ sudo xauth add $(xauth list | grep "unix$(echo $DISPLAY | cut -c10-12)")
ORIGINAL LONG VERSION
To fix things, first detect ... | "su" with error "X11 connection rejected because of wrong authentication" |
1,390,467,595,000 |
While attempting to SSH into a host I received the following message from xauth:
/usr/bin/xauth: timeout in locking authority file /home/sam/.Xauthority
NOTE: I was trying to remote display an X11 GUI via an SSH connection so I needed xauth to be able to create a $HOME/.Xauthority file successfully, but as that mes... |
Running an strace on the remote system where xauth is failing will show you what's tripping up xauth.
For example
$ strace xauth list
stat("/home/sam/.Xauthority-c", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
open("/home/sam/.Xauthority-c", O_WRONLY|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File exists)
rt_sigprocmask(SIG_B... | Why am I getting this message from xauth: "timeout in locking authority file /home/<user>/.Xauthority"? |
1,390,467,595,000 |
I'm logged in remotely over SSH with X forwarding to a machine running Ubuntu 10.04 (lucid). Most X11 applications (e.g. xterm, gnome-terminal) work fine. But Evince does not start. It seems unable to read ~/.Xauthority, even though the file exists, and is evidently readable (it has the right permissions and other app... |
TL,DR: it's Apparmor's fault, and due to my home directory being outside /home.
Under a default installation of Ubuntu 10.04, the apparmor package is pulled in as an indirect Recommends-level dependency of the ubuntu-standard package. The system logs (/var/log/syslog) show that Apparmor is rejecting Evince's attempt t... | Evince fails to start because it cannot read .Xauthority |
1,390,467,595,000 |
Recently, I switched from Ubuntu to Arch Linux. I've installed X11 as my Window System and KDE as my Desktop Environment. I've separate partition for /home, /var, / and /boot and they all mount at boot time. When I run startx, the following message gets displayed.
xauth:timeout in locking authority file /home/hello/.X... |
First a clarification, X is not a window manager, it is a windowing system.
Now, the ~/.Xauthority file is simply where the identification credentials for the current user's Xsession are stored, it is the file read when the system needs to determine if you have the right to use the current X session.
You should never... | How to run startx as non-root? |
1,390,467,595,000 |
From my local machine I ssh to a remote server along with authentication regarding X display. I know that in this process, MIT-MAGIC-COOKIES are used and the value in both server and client needs to be identical in order for the authentication process to be valid.
However, when I login to a remote server and have conf... |
I believe you're getting confused by how SSH performs the proxying of the X11 connection via the tunnel it's established on the remote server side with how magic cookies typically works. From the SSH man page:
excerpt
The DISPLAY value set by ssh will point to the server machine, but with a
display number greater tha... | x11 connection established but magic-cookie value different? |
1,390,467,595,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,390,467,595,000 |
I just noticed something peculiar about how sudo handles the .Xauthority file:
sudo xauth add $(xauth list | tail -1)
user@server: sudo xauth info
Authority file: /root/.xauthYZ21Nt
File new: no
File locked: no
Number of entries: 1
Changes honored: yes
Changes made: no
Curre... |
The xauth cookie is stored in that temporary file (~/.xauthXXXX) which is removed when sudo returns (e.g. when the sudo xauth info command has finished).
I suggest you have a look at the source code of the pam_xauth module:
#define XAUTHTMP ".xauthXXXXXX"
...
int
pam_sm_open_session (pam_handle_t *pamh, int flags UNUS... | Where is sudo hiding my root's .Xauthority data? |
1,390,467,595,000 |
I have removed for a mistake my $HOME/.Xauthority file.
I want to recreate it without restarting X11.
ATM I have start a new X11 session with this command
startx -- :1
but my :0 display still don't run any X11 application.
I have tried those commands
rm ~/.Xauthority
touch ~/.Xauthority
xauth add ${HOSTNAME}/unix:0 ... |
You're creating a new cookie and telling clients to use this new cookie. But the server is still using its own cookie. You can't connect to the server to retrieve the cookie without knowing the cookie.
You may be able to obtain the cookie through other means (after all, it exists in the memory of the server process). ... | How to generate correctly a new .Xauthority file for a display missing it, without restarting X? |
1,390,467,595,000 |
I'm trying to forward my X windows, but seems to be limited to just on session?
What I'm trying to do is invoke x-applications as another user, through a sudo su -.
If I know the other user's password, than this is easily resolve with:
ssh -Y user@host
password: ********
gedit &
However, if running a user which I d... |
The problem is probably that su - will clear all the environment variables except TERM, so you will lose the DISPLAY setting. Try setting DISPLAY=localhost:10.0 (for example) before the gedit.
| Forwarding X-windows through a su - session |
1,390,467,595,000 |
I'm currently using a systemd unit file to configure a service which uses X server display.
The X server instance is launched by the user logged in (currently pi user) but the service is launched at root.
I can successfully launch the service using systemctl start test_graphic_app if I hard code the .Xauthority file l... |
There are more sophisticated versions of xhost +, namely xhost +si:localuser:root which adds only local user root to the list of allowed connections.
You need to find where to put this command so it is run on login, depending on your distribution. Look in /etc/X11/ for an existing file using xhost already. On my pi I ... | Systemd - Find .Xauthority file to use |
1,390,467,595,000 |
I would like to generate a new Xauthority file using xauth with another hostname portion and write it to a different file name (as opposed to ~/.Xauthority where the xauth command typically writes to).
[Later on I want to copy this file to another machine with a different hostname. This machine is a container which b... |
There are 2 sorts of hostname entries managed by xauth, local names such as myhost/unix:0 and remote names such as remote:0. The latter are held as ip addresses, but I imagine you are referring to the local names.
The hostname part of these are not actually of any significance to X11, but can be used by the xdm tools ... | How to replace the hostname portion with xauth (OLD: How to redirect output of xauth command?) |
1,390,467,595,000 |
I ask for your help since I am on linux and when I wanted to log in normally (typing my password) it kept loading indefinitely, and when I open the "console" with the key combination
(ctrl alt fn f3) and start session From there everything is fine, but when I want to start with startx it gives me the following error:
... |
The .Xauthority lock timeout error typically is caused by problems writing to the file. Typical causes for this would include:
incorrect permissions on the .Xauthority file (ownership or permissions)
over disk quota or disk full
incorrect permissions on the home directory
From discussion in comments, it sounds like... | Xauth: timeout in lock authority file /home/user /.Xauthority |
1,390,467,595,000 |
According to my own experience, su - user used to break SSH X11 authentication. There are plenty of posts on the web explaining how to use xauth list and xauth add to copy the MIT-COOKIE between sessions.
However, for some reason this is no longer necessary.
When I login using ssh -X usera@host, I see the following a... |
This is implemented by the pam_xauth.so module which you can find documented in man pam_xauth. If you look in the last line of /etc/pam.d/su you should find a line
session optional pam_xauth.so
which runs the module when you do su - userb. In the environment, variable XAUTHORITY will be set to the temp... | .xauth followed by random numbers |
1,390,467,595,000 |
I'm using CentOS 6, with Xfce as a desktop environment and have switched to xdm from gdm as a display manager.
However, after making this change, I am observing a very strange oddity: graphical applications can run without $XAUTHORITY being defined:
$ echo $DISPLAY
:0.0
$ echo $XAUTHORITY
$ zenity --error --text "...... |
The X(7) overview man page (recommend reading the whole thing, by the way) tells us:
The file from which Xlib extracts authorization data can be specified with the environment variable XAUTHORITY, and defaults to the file .Xauthority in the home directory.
So no, XAUTHORITY is not mandatory if you have your authoriz... | GUI running without $XAUTHORITY being defined, but not for root |
1,390,467,595,000 |
I am working on a systemd/udev setting that I would like to share upstream, however I can't get it to work in a non-hacky way. Essentially, I have this script as the exec of a systemd service:
ICON="somepath/dslr-camera-white.png"
function on-display() {
local sdisplay=$(echo $XDG_SESSION_TYPE)
... |
You don't directly run user services from udev rules; instead, you should have udev tell systemd that the device wants a particular user service to run.
With a TAG+="systemd", ENV{SYSTEMD_USER_WANTS}="dslr-webcam.service" like this:
ACTION=="add", ATTR{idVendor}=="04a9", ATTR{idProduct}=="3218". TAG+="systemd", ENV{SY... | Run display dependent command in a system setting event |
1,390,467,595,000 |
$ xhost
access control enabled, only authorized clients can connect
xterm works:
$ docker run --rm -it --network host \
--volume ~/.Xauthority:/root/.Xauthority:ro \
--env DISPLAY \
alpine:3.19 sh -euxc 'apk add xterm; exec xterm'
chromium opens a window and seems to receive keystokes, but the window is empty ... |
Not exactly an answer, but it probably makes more sense to run chromium under non-root:
$ docker run --rm -it --network host \
--volume ~/.Xauthority:/.Xauthority:ro \
--env DISPLAY \
alpine:3.19 \
sh -euxc 'apk add chromium shadow
useradd -m a
cp .Xauthority /home/a
chown a... | Chromium doesn't start under docker without `xhost +local:` |
1,564,319,976,000 |
When I run X apps from the command-line (e.g. leafpad; most apps), I receive the following warning on the console:
... dbind-WARNING **: ... Couldn't register with accessibility bus: Did
not receive a reply. Possible causes include: the remote application did
not send a reply, the message bus security policy blocked... |
Put this:
export NO_AT_BRIDGE=1
someplace where it gets run, e.g. in /etc/environment or your ~/.bashrc / ~/.bash_profile.
This workaround is suggested in this wiki page (in German) or here (in English), but I don't really understand why it's needed or what it really does, so caveat emptor.
| Getting dbind-WARNING's about registering with the accessibility bus |
1,564,319,976,000 |
I am looking for a Linux distro that is accessible to someone who is totally blind. I am aware of Vinux and Sonar GNU, but the former is dormant and the latter is discontinued. What is out there that both is current and also not likely to go away? This search is also satisfied by a mainstream distro like Debian or Ubu... |
As noted in the question, there have been several Linux distributions aimed at blind and visually impaired users, many of which were neglected for a long time or even abandoned.
In early 2017, Vinux announced plans to merge with Sonar, using Fedora as a basis. That was the last thing I heard about this.
TalkingArch is... | Are there any up-to-date blind-accessible Linux distros? |
1,564,319,976,000 |
I am using Fedora on a computer with touch screen. When was using Fedora 26 or older, the on-screen keyboard always pops up when I am using the touch screen (like when I selected gedit window, the on-screen keyboard shows, and I have to close it manually). I found that caribou is the keyboard which annoys me, and this... |
You may use a GNOME shell extension called "Block Caribou".
It claims to block caribou (the on screen keyboard) from popping up when you use a touchscreen in GNOME shell v3.26.
Edit: for later versions and if Block Caribou doesn't seem to help try the newer shell extension Block Caribou 36.
| How to disable the on-screen keyboard when I use the touch screen? |
1,564,319,976,000 |
I'm looking for a tool that allows to zoom in on the screen regardless of the application or program you're currently running. This tool should not only magnify the screen, but also the mouse pointer.
Background of the question is as follows: I have a visual impairment, but would like to use Linux, mainly for data se... |
I have the exactly same needs and, for more than a decade, Compiz has solved all these problems for me, but only when used with Xfce (not with GNOME or Unity, because it doesn't zoom the sidebar and menubars; haven't tested it with Cinnamon yet). I am currently using xubuntu 18.04, which installs Xfce by default.
Befo... | Is there a way to zoom in on the screen AND mouse pointer in any Linux distribution? |
1,564,319,976,000 |
Which GNU/Linux distributions have good screen magnifier software, either freely available, or pre-installed with the OS?
Being a visually impaired nerd, I'd like to gain experience on as many platforms as possible. I've gotten accustomed to the smooth magnifying experience with the zoom functionality that comes with ... |
I have heard a lot of good things about Vinux, It is designed with the Visually Impaired community, And i assume that it has the best of the best with the tools you probably need.
In general you can install most of the software you want, on whatever big distro you chose to use, but the above distro has all of that bu... | Which GNU/Linux distributions have good screen magnifier software, either freely available, or preinstalled? |
1,564,319,976,000 |
I have found enabling sticky keys under xorg (awesome desktop manager) on Super User, which showed me that I can enable sticky keys via
xkbset sticky -twokey
This works as expected, but in my case I'd prefer to only make a specific key (Alt Gr) be sticky instead of all modifier keys. Can this be configured? And if so... |
On X11 one way to achieve that is by using XKB and making the right alt key set the current latch mode as AltGr. There are a couple of ways to go about it:
Option 1
You can export your current keyboard layout to a file, change only the behavior of the right alt key (AltGr) and load it back to X, overriding the default... | Make specific key sticky |
1,564,319,976,000 |
I use GNOME 3.36 on Arch Linux and even if control panel shows up the right option activated (see the screenshot below); none virtual keyboard is shown when needed i.e. on an input box like the search box on the upper-left corner.
How can I have an onscreen-keyboard?
Do I need any external package?
journalctl does n... |
Thank to @muru,
I solved this issue by installing the caribou package
| Where is the GNOME virtual keyboard? |
1,564,319,976,000 |
I have xkbset st -twokeys in ~/.xsession file. My process list is (mine, not system):
winbindd: domain child
/lib/systemd/systemd --user
(sd-pam)
/usr/bin/pipewire
/usr/bin/wireplumber
/usr/bin/pipewire-pulse
/usr/bin/pipewire-pulse
/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activ... |
X is turning it off again. For some reason that doesn't make sense anymore, sticky keys, two keys, mouse keys, slow keys, bounce keys, and beep when LED changes expire.
Solution: xkbset exp =st in addition to the enabling command.
This changes sticky keys and two keys to be non expiring.
| what keeps turning off stickykeys and how do I stop it? |
1,564,319,976,000 |
Is there a way to set system-wide default GTK theme to "HighContrast" in the same manner, one can set font DPI on a system level?
Here is the snippet I use for the font DPI:
fonts = {
fontconfig = {
dpi = 160;
};
};
|
The solution is to write config files into "/etc/xdg" (not "/etc").
gtk-2.0 and gtk-3.0 are directories in the same directory as configuration.nix:
environment.etc = {
"xdg/gtk-2.0".source = ./gtk-2.0;
"xdg/gtk-3.0".source = ./gtk-3.0;
};
| How to set a system-wide gtk theme in NixOS? |
1,564,319,976,000 |
When I press Shift for 8 seconds (as the upcoming dialog says, I rather feel these are 10 seconds) GNOME enables "slow keys", how they call it.
Fortunately a dialog pops up before it is finally enabled. However that cannot be quickly dismissed by navigation with the keyboard (you can only click on "Cancel", moving wit... |
Just to close this question as answered: In the question you can see how to do it, it is actually possible in the visible settings application.
There only was a bug that prevented this from working correctly in GNOME 3.28 at least, and has been fixed (to be released in v3.32, I guess.).
| How to disable GNOME's 8 sec. shift hotkey for activating slow keys/keystroke delay? |
1,564,319,976,000 |
When I enable Large Text in a GNOME/Wayland desktop session it works in most applications. In GNOME Web it's a bit different:
browser chrome gets bigger
some websites get bigger (e.g. https://en.wikipedia.org/wiki/Main_Page )
some websites stay the same (e.g. https://arstechnica.com )
I get around this in Mozilla-ba... |
There is a direct equivalent for GNOME Web:
Open the dconf editor
Navigate to org/gnome/epiphany/web/default-zoom-level
Set the value (for example 1.25)
Hat tip: https://askubuntu.com/questions/207151
| How to enforce Large Text in GNOME Web? |
1,564,319,976,000 |
I've got a red-deficient variant of colourblindness. Red text is very difficult for me to read because it's much darker to me than for people with regular colour vision, so when it's on a black background I often can't see what it says unless I copy and paste the content to another window with a different colour schem... |
It's something that could be done easily by shifting your terminal emulator's colour palette, rather than configuring bash, could you give it a try?
| Can I permanently remap one colour to another in my bash_profile? |
1,564,319,976,000 |
My docker script executes the following two commands
gsettings set org.gnome.desktop.interface toolkit-accessibility true
gsettings get org.gnome.desktop.interface toolkit-accessibility
The first command runs (silently) but the second command returns false.
What sort of reasons would cause gsettings set org.gnome.des... |
Solution:
apt-get install dbus-x11
...
eval $(dbus-launch --sh-syntax)
| gsettings set org.gnome.desktop.interface toolkit-accessibility true fails |
1,564,319,976,000 |
I was always a bit frustrated from the lack of characters in modern computer systems such as, from what I know:
A global template literal character for which the closest character today is a backtick (`)
A global quote character, for which the closest character today is a single quote mark (') or a double quote mark... |
Yes, there were attempts to create a system with its own set of characters to better describe algorithms. The most noticeable and successful was (and still is) - APL, by IBM.
IBM even created a special keyboard for writing in it.
There is a GNU APL implementation, but it looks like it is not part of any distribution a... | Is there an example for a shell or computing accessibility culture aspiring a shell with more special characters and if so what is it? [closed] |
1,445,429,333,000 |
I'm trying to run ADB on a linux server with multiple users where I am not root (to play with my android emulator). The adb daemon writes its logs to the file /tmp/adb.log which unfortunately seems to be hard-coded into ADB and this situation is not going to change.
So, adb is failing to run, giving the obvious error:... |
Here is a very simple example of using util-linux's unshare to put a process in a private mount namespace and give it a different view of the same filesystem its parent currently has:
{ cd /tmp #usually a safe place for this stuff
echo hey >file #some
echo there >file2 ... | Is it possible to fake a specific path for a process? |
1,445,429,333,000 |
I would like to know that is it possible to use Android studio in FreeBSD ?
I tried to run it but I couldn't.I installed IntelliJ from ports but there was no option to select the Android SDK.
|
When Android Studio was still in Beta, I tried to get it running on FreeBSD (my preferred platform) but had nothing but issues.
I did manage to compile a debug APK but could not get a full release version (weird). I ran Android Studio under Linux Emulation but there was still issues with the Java side of things (from ... | Android studio on FreeBSD |
1,445,429,333,000 |
I'm trying to analyze the reason for random reboots of my phone (see here).
Therefore I wanted to record the logcat and kernel messages till the restart to see the logs even after the usb disconnects, which is probably earlier than the restart?!
So I constantly copied proc/kmsg and the logcat to files. Now this needs ... |
If you install the busybox binary, it includes the nohup command (this will require root access). Busybox may be present, but the command not symlinked, in which case you would need to use busybox nohup command. If busybox is not present, then the easiest way to install is with busybox installer. After that is install... | How to keep running a process in Android when disconnecting adb terminal? command "nohup" not found |
1,445,429,333,000 |
I'm trying to use $EXTERNAL_STORAGE in the adb pull command. I noticed that the variable has its scope defined in Android only and so it would not work successfully in adb pull $EXTERNAL_STORAGE/Pictures/Screenshots/ ~/.
Of course, I can write an absolute path to fetch all the screenshots but the issue is something e... |
You were almost there with your first attempt. The problem is that adb unhelpfully adds a carriage return at the end of every line. You can't see it in the basic usage where the output is printed to the terminal, because a carriage return at the end of a line has no visual effect (the carriage return moves the cursor ... | adb pull not accepting a variable as source, gives *' does not exist..* error |
1,445,429,333,000 |
I recently purchased an Android phone (my first). This is probably not relevant to the question, but it is a Micromax Canvas Hue AQ5000, running Android 4.4.2.
I want to access the phone from my computer, currently running Debian wheezy. ADB was recommended to me. I installed android-tools-adb, and after enabling Deve... |
On my gentoo system, the following udev rules are setup (in /lib64/udev/rules.d for me):
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0664", GROUP="android"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0664", GROUP="android"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0664", GROUP="android"
SUBSYSTEM=="usb",... | Setting up adb for user access |
1,445,429,333,000 |
I am outputting results from an android shell command to a file, with MS-windows cmd via ADB.exe.
It outputs the correct results, but I am getting an extra line between each result. It looks normal in interactive cmd (without extra lines), but when it is saved to a file the additional lines show up.
I am using Note... |
Try
adb shell -T "ls -l" > test.log
or, if it complains that error: device only supports allocating a pty:
adb shell "ls -l >/data/local/tmp/list"; adb pull /data/local/tmp/list test.log
Not all the devices support the ssh inspired -t and -T options, even if your adb client program does.
This isn't Windows-specific:... | Remove extra blank lines from CMD adb shell, when redirected to file |
1,445,429,333,000 |
For example, I want to check if a directory exists on the phone.
R=$(adb shell 'ls /mnt/; echo $?' | tail -1);
$ echo $R
0
$ if [ "$R" -ne 0 ]; then echo "Path doesn't exist"; else echo "Path exists"; fi
: integer expression expected
Path exists
What's wrong with R? Ok, try it with another variable which is definit... |
adb is adding a carriage-return (aka 0x0d, Ctrl-M, \r, etc) before the line-feed. Probably for ease of use with Windows software that expects lines to end with CR-LF rather than just LF.
You can see this yourself with hexdump aka hd, e.g.:
$ printf "$R" | hd
00000000 30 0d ... | How can I evaluate the result of an adb shell command? |
1,445,429,333,000 |
a long time ago, i wrote a udev rule for adb with my phone (device) by setting a group. Everything was OK until some things changed recently:
device rom
udev packet
adb packet
now i get under user:
$ adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: insufficient... |
ok found what was issue:
file ~/android contains some files probably store debug keys which are different after device flash/wipe - simply remove them
to be exactly:
~/.android/adbkey
| how to debug adb insufficient permission case |
1,445,429,333,000 |
I set up earlier this month HISTTIMEFORMAT cause I needed to see the time on some of the commands I previously used. However, I most likely messed something up with those commands, because every time I try to use adb for anything (adb kill-server eg.) I get the following error: bash: /home/user/Android/Sdk/platform-to... |
Hypothesis: your old ~/.bashrc contained an incomplete line and the line was related to adb. Your command
echo 'HISTTIMEFORMAT="%d%m%y %T "' >> ~/.bashrc
added to the line instead of adding another line. This behavior is one of the reasons the last line should be properly terminated.
My tests indicate an incomplete l... | HISTTIMEFORMAT messed up adb |
1,445,429,333,000 |
Motivation: I often open a remote shell on android devices (using adb/ Android debug bridge), and want to write scripts on my machine (not android devices, because I have multiple) to help me when i first connect into the shell.
For example, I might want to change directory into a specific folder,
echo "cd /storage/se... |
To keep the pipe open, don't let it close. You may do this by adding cat to the left hand side in the pipe:
{ echo "cd /storage/self/primary/Download; mkdir bobby"; cat; } | adb shell
The cat process will execute after echo, and have its standard output connected to the adb shell command, while its standard input re... | Keep pipe open (stdin in connected to terminal) after pipe |
1,445,429,333,000 |
I need to access my Nexus 7 2013 LTE (deb) over adb and fastboot, but it seems that it's required to be root to be able to run the adb server to be able to access the device due to USB rules.
How can I configure udev to allow access to this device as a non-root user for adb and fastboot?
|
Create a new file at /etc/udev/rules.d/50-nexus7-deb.rules:
/etc/udev/rules.d/50-nexus7-deb.rules:
# adb protocol on nexus 7 deb/razorg:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d001", MODE="0600", OWNER="myusername"
# fastboot protocol on nexus 7 deb/razorg
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",... | How do I allow non-root access to Nexus 7 2013 LTE (deb) over adb and fastboot? |
1,445,429,333,000 |
I am trying to copy WeChat database file called EnMicroMsg.db so I can view it in SQLite browser.
With my Nexus 7 tablet rooted and physically connected, the usb debugging checked I ran the following commands on cmd: adb devices which confirmed that my devices is connected, adb shell to enter the shell mode, su comman... |
Following Andrew Sun's suggestion in this stackoverflow answer, I installed adbd Insecure from Google Play.
The developer according to this link
explained that the app gives root access in adb shell and allows access to system files and directories through adb push/pull, which exactly solved my problem.
After install... | How to pull database file from physically connected android device |
1,445,429,333,000 |
I was trying to execute the following shell script below
function Check_Status () {
if [[ "$(adb shell getprop sys.boot_completed)" =~ "adb: no devices/emulators found" ]];
then
echo "here"
else
echo "im here"
fi;
};
Check_Status
I'm getting the following output,... |
The text on your pic looks the same as the one in your script, yes. But it's a bit hard to be sure from just a pic.
But note how the text comes to your terminal when you run the script? The command substitution is supposed to capture the output, whatever gets caught by it, does not get printed. adb probably prints tha... | unable to satisfy if condition in shell script |
1,445,429,333,000 |
I installed tcpdump on my Android tablet and am running commands from a root adb shell. I'm working from the tcpdump man page examples, specifically this one:
To print all IPv4 HTTP packets to and from port 80, i.e. print only packets that contain data, not, for example, SYN and FIN packets and ACK-only packets.
tcp... |
The quotes cause the command adb to be passed three arguments:
shell
tcpdump
tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)
It presumably then tries to run the command
tcpdump tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)
without the quotes (as the shell on... | tcpdump filter expression breaks via adb |
1,445,429,333,000 |
I'm trying to create a one-line, platform-independent solution for finding the local IP address of a Android device with adb shell and grep (the internal grep on my android device). I have a solution that works, but something keeps bothering me.
By the way, I'm running my solution from within Powershell 7, if that mak... |
You could just run the grep locally rather than as part of your adb expression:
$ adb shell "ip addr show wlan0" |
grep -o -P '^ *inet \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
inet 192.168.1.167
The -P option there means --perl-regexp, and is necessary to support the \d escape.
You could also just use a combination of... | Using grep to extract IP through adb shell |
1,445,429,333,000 |
Yesterday I downloaded Android Studio for my Debian Testing system. I wanted to run a HelloWorld application (just a blank activity) but weren't able to run it. With adb I can install it without having any problems.
However, if I try to do it with Android Studio, it gets stuck on 'Installing APKs'. The same happens wh... |
I have the exact same setup as you with debian testing and installed android studio 2.3.3. It took me a while to find out that you have to set it to software graphics for the emulator phone to appear.
I still have the issue with the hello world app not appearing on the emulator and the emulator appearing as blank. I h... | Android Studio: Running application in emulator not working |
1,445,429,333,000 |
I'm trying to execute the following shell script, where I'm trying to keep executing a command in an infinite loop and until the output is not equal to a certain substring
checkDeviceStatus=$(adb shell getprop sys.boot_completed 2>&1)
function Check_Status () {
while [ ! "$checkDeviceStatus" =~ "device offline" ] ||... |
#!/bin/bash
function Check_Status () {
while [[ "$(adb shell getprop sys.boot_completed 2>&1)" =~ "device offline" ]] || [[ "$(adb shell getprop sys.boot_completed 2>&1)" =~ "device still authorizing" ]] || [[ "$(adb shell getprop sys.boot_completed 2>&1)" =~ "no devices/emulators found" ]];
do
sleep 1
if [[ ... | ./shell.sh: line 6: [: =~: binary operator expected |
1,445,429,333,000 |
I recently started using the adb command line utility tool and what I'm trying to do is to extract all of the images from a folder on my android device.
I've tried the command below with no success.
adb pull /data/media/0/Pictures/Screenshots/*.png /root/Desktop
I've also tried a specific image
adb pull '/data/me... |
Try "adb push", copy a file from your host to device to that location.
You can also verify the location(path) by using "adb shell" command. After executing "adb shell", you will get a shell prompt of your device and you can verify the location in it.
If "adb shell" or "adb psuh" doesn't work then make sure your device... | Dealing with adb devices |
1,445,429,333,000 |
I have an Android command whose output is as follows:
$adb shell "head -20 /d/dma_buf/bufinfo"
Dma-buf Objects:
size flags mode count exp_name buf name
00020480 00000002 00000007 00000003 ion-system-660-vendor.qti.hard dmabuf210
Att... |
I'm able to extract the pids with:
$ awk 'NF == 6 {print $5}' inputfile | grep -Eo '[0-9]+'
660
660
660
660
Since Android uses procfs, you can see the actual binary as a symlink in /proc/$pid/exe. But, since this is a magic (i. e. procfs) symlink that doesn't obey the normal POSIX rules, you can't use the more commo... | Use awk on an Android command |
1,327,195,646,000 |
How can I convert a .cue / .bin (cdr track) image into a single .iso file?
I have
Fedora 16 (x86-64)
Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
|
You should look at bchunk, which is specifically meant for this type of conversion. You should be able to install it with sudo yum install bchunk, but I'm only 95% sure it's in the standard repo. bchunk will create an ISO from any data tracks, and CDR for any CD audio. If you want everything in one ISO bchunk is not... | How can I convert a .cue / .bin ( with cdr tracks) image into a single .iso file? |
1,327,195,646,000 |
What applications are available for GNU/Linux that allow read-out of CD-Text data from CDs?
Command-line programs would be preferred.
|
Libcdio contains a collection of command-line which are CD-Text aware. Specifically, you can get CD information using the cd-info program.
For more information on using particular libcdio library functions, have a look at the online documentation.
| How can I read CD-Text information from CDs |
1,327,195,646,000 |
What is currently the best way to rip scratched audio cds under Linux?
What I find complicated, is that there are several tools available but it is not clear if one tool has better error correction features than the other.
I mean, there are at least:
cdparanoia
cdda2waw
cdrdao
|
cdparanoia started as a patch on a cdda2wav from 1997 and never updated the cdda2wav code. Since 2002, there is no visible activity on the project.
cdrdao was a similar short running project, founded in 1998 and no new features since at least 2004. There was never special support for bad media.
cdda2wav started in 199... | How to rip scratched audio cds? |
1,327,195,646,000 |
Up until Fedora 14 I was successfully using cdctl to enable/disable the CD/DVD eject button on my laptop (Thinkpad T410). Sadly it has stopped working now.
I've consulted the methods discussed in these 2 questions:
disable cd/dvd button on linux laptop (ubuntu)
Disable the DVD eject button on a Thinkpad running Linux... |
Thanks to @Affix's answer which gave me the right direction to head, I've figured out the solution to the problem.
The problem is definitely caused by UDEV as you've guessed. The issue is this line that is in most UDEV files related to the cdrom drive.
Example
On Fedora 19 there is the following file, /usr/lib/udev/ru... | How can I disable the button of my CD/DVD drive? |
1,327,195,646,000 |
Is there a way to rip an audio CD to an ISO9660 file? I've tried simple things like dd in the past and it hasn't worked. I'd like to essentially have a mirror image of exactly what's on the disk, not even necessarily a folder of WAV files.
I do understand that I could rip the CD to WAV files or even FLAC files, but is... |
An audio CD doesn't contain a filesystem at all. The format is defined as a particular stream of bits directly representing sounds. This is unlike DVDs, where a video DVD is a DVD with a UDF filesystem with a particular structure.
The classical CD burning suite, cdrecord, includes cdda2wav to rip an audio CD to a WAV ... | Rip an audio CD 1:1 |
1,327,195,646,000 |
I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this?
On an Ubuntu 12.04 derivative.
|
cdparanoia
You can get a list of CD audio tracks using the command line tool, cdparanoia.
$ cdparanoia -sQ
Example
$ cdparanoia -sQ
cdparanoia III release 10.2 (September 11, 2008)
Table of contents (audio tracks only):
track length begin copy pre ch
=====================================... | Reading amount of tracks from an audio CD? |
1,327,195,646,000 |
There's a question over at audio.SE at the moment and I thought it may attract some answers here. I asked the user and he's happy to have it posted here to see if anyone has some ideas. Here it is verbatim:
I'm working with a client who needs to minimize the time between when recording is done and when the finalized ... |
Well, you could do it with some command line tools.
cdrecord (wodim on debian) can burn audio CDs on the fly, but it needs an *.inf files that specify track sizes etc. You can generate an inf file upfront with a dummy CD that has (say) one large audio track (74 minutes) using cdda2wav (icedax on debian).
In the live s... | Is it possible to record audio directly to a computer's optical drive? |
1,327,195,646,000 |
When playing audio CDs with mplayer, I always get a choppy playback. Playing audio from files, like MP3 (from any optical media, or other drives), etc. works fine. Watching video DVDs is also ok. Listening to uncompressed media that's on my hard drives, like WAV or CDR, works fine as well.
But when playing audio CDs l... |
The problem is the usage of mplayer cdda:// and the libcdparanoia library, because libcdparanoia has it's own caching method. This method bundles about 15 second in one request to read from the CD and that period is long enough that the CD spins down.
There are two options how you can solve this problem:
mplayer whic... | Choppy audio CD playback with mplayer |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.