date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,357,754,399,000
I am searching for a small new-email-notifier for IMAP mailboxes that displays it's status in the icon-bar (how do you call it?) of a window manager. Basically some biff/xbiff like tool ported to 21th century technology. ;) I am using awesomewm, which is able to display in its taskbar the 'applets' (?), which also wor...
I am now using Trysterobiff. It is a non-polling IMAP mail notifier for the systray. It implements the requirements, including the execution of external commands and does not crash. I've written it using Qt, thus Trysterobiff is quite portable. The non-polling operation is implemented using the IDLE extension of IMAP,...
IMAP mail notifier for window manager/task bar?
1,357,754,399,000
I can't find a way to find what program implements the org.freedesktop.Notifications service. Is it possible to ask DBus to tell me what program provides it? The reason for asking this question is quite banal: I found a new desktop notifications daemon I'd like to use, but it won't start and instead complains with thi...
The d-bus debug utility d-feet which is available as a package in many systems seems to be able to find the process id and command providing a service. For example, I ran it on a Fedora 23 xfce4 X11 systemd platform and selected Session Bus and entered the service name org.freedesktop.Notifications. It introspected th...
Find out the owner of a DBus service name
1,357,754,399,000
On a server I inherited, there is a cron job running hourly on one of the Debian servers. It sends an email out to a non-existent email, but bounces back to my account since I listed myself as the root email in /etc/aliases. The cron job has been deleted from /etc/cron.hourly (it was ntupdate), as it's listed in the e...
system crons Did you look through these files & directories to make sure there isn't a duplicate cronjob present? /etc/crontab /etc/cron.hourly/ /etc/cron.d/ /etc/cron.daily/ /etc/cron.hourly/ /etc/cron.monthly/ /etc/cron.weekly/ Also any files present in these directories that's executable will be run. Doesn't matt...
Cron job still running when deleted
1,357,754,399,000
I have written a script which generates notifications like this: notify-send -i audio-card "Transferring audio playback to speakers." \ "Audio playback has been transferred to the analog output speaker system." Is there any way to clear or to replace these notifications from the command line or from Python? Essen...
From CLI, you can display and close a notification pop-up via gdbus/qdbus. Here's how to that with gdbus: gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify my_app_name 42 audio-card "Message" "Body" [] {} 20 this will o...
Clearing/modifying previous libnotify notifications?
1,357,754,399,000
The notification popups stay too long on the screen in my opinion. How to modify the number of seconds notifications are displayed? I see no such option in any of the notification settings. (Kubuntu 18.04 - Plasma 5.12.7)
This can be done by modifying the file /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationPopup.qml. So, open it in kate: kate /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationPopup.qml Find the line notificationTimer.interval = notification.expireTimeout ...
Set the time of notifications in Plasma 5
1,357,754,399,000
I am using slack desktop client on my Arch Linux. I am using Xmonad Window manager along with the Xmobar status bar. On other Desktop environments, for example XFCE, the Slack Desktop client shows a small Icon (System tray icons) on the status bar, which is really helpful. ( Screenshots below are of Slack on XFCE ) ...
Finally, with the help of nice people on #xmonad IRC channel, I got the solution Here is how : First I resized the xmobar to leave a small gap on Right side (editing xmobarrc) position = Static { xpos = 0, ypos = 0, width = 1346, height = 20 }, Use the package stalonetray sudo pacman -S stalonetray Configure stalon...
System Tray Icons on Xmonad - Xmobar Or any other minimal status bar
1,357,754,399,000
Let's say I use notify-send with this long messages: notify-send 'd: title, up/down: zoom, w: win_to_img, </>: rotate, *: orig, Enter/0: blah blah blah' But it truncates the message, showing only a part of it with no option to view the full message: With Fedora 21 I was able to view the full message (pop up at botto...
notify-send works like this: notify-send [OPTION...] <SUMMARY> [BODY] Now, as you only have one (quoted) string, that's being used for the SUMMARY and the BODY is empty. Just use blank or whatever for the SUMMARY and the BODY will display the whole message (but only when you hover over the pop-up with your mouse)1: n...
notify-send - How to display full message when message is longer than one line?
1,357,754,399,000
I'm using the dynamic window manager of suckless (dwm). I noticed that firefox is able to send nice notifications when a download has finished. See the two figures When I'm on a different tag, I get this kind of notification (inverted 1 tag) upon a finished download. I'd like to use this kind of notification for my...
This is probably the urgency hint which can be set on windows. This hint is recognized by most window managers. Most terminals can be configured to set the urgency hint when receiving a bell. (u)xterm for example has the bellIsUrgent option and (u)rxvt has urgentOnBell. To ring the bell in a terminal just run tput bel...
What kind of notification is Firefox sending when a download has finished?
1,357,754,399,000
I am trying to instate a more graphically minimal notification system in Arch Linux. Specifically, I've taken interest with programs such as dzen2 or conky that allow for more text-based status bars. Is it possible to pipe notifications (as in the libnotify, notify-send ones) to a status bar made from programs like d...
I think you would be better off just removing libnotify and notify-send from the equation, given your stated requirements they do not provide any additional flexibility of functionality. If you are looking for a minimal status bar, conky has a comprehensive amount of functionality, all of which can be updated in real ...
How do I pipe notifications into my statusbar?
1,357,754,399,000
I want to see which notification daemon is running. This is because I want to replace it, since it does not properly confirm the notification from blueman-applet. I mention that I am running the i3 window manager.
I found out myself. Trigger the notification again Open a console, and run xwininfo to find out which process created the notification window. Uninstall that application, and install a different one (such as notification-daemon or xfce4-notifyd) Restart. In my case the culprit was dunst, which did not show buttons t...
How to identify the notification daemon?
1,357,754,399,000
My system has to auto-mount USB devices; how can I be notified when a USB device is plugged in? Where can I read more about this subject? I would like to handle this problem via C or a shell script.
Udev support running external programs KERNEL=="sdb", RUN+="/usr/bin/my_program"
How to be notified when a USB device was plugged in?
1,357,754,399,000
I am attempting to write a BASH script that creates a timestamp (to be written to file) every time a certain string is found within the output of dbus-monitor (parameters specified later in post). The main purpose of my script is to save the time (including milliseconds) and date whenever a song starts playing on Spot...
This should work: stdbuf -oL dbus-monitor --session interface='org.freedesktop.Notifications',member='Notify' | while grep -q 'string "Spotify"'; do date -u +%Y%M%d-%H%M%S.%N >> timestamp.txt done EDIT after @StéphaneChazelas comments: stdbuf -oL dbus-monitor --session interface='org.freedesktop.Notifications',me...
Run command every time regex is matched, reading from stdin which does not have an EOF
1,357,754,399,000
I was trying to write a script which would add a new mail icon to my system tray, but apparently Thunderbird does not support checking for new mail from the command line. I've tried a number of plugin, but they all seem to have only a vague description. The ones I tried just modified the new mail popup. Therefore I'm ...
In the past I used this plugin: https://addons.mozilla.org/en-US/thunderbird/addon/firetray/ a quote from the official plugin page: display unread messages count in tray icon Worked perfectly as far as I can remember.
Thunderbird tray icon for mail notifications
1,357,754,399,000
I have a Bash script that checks my laptop battery and sends me an Android notification (via shuttle, a Bash script I wrote that serves as a cli interface for the Pushbullet API). It works nicely, but it will repeatedly notify me to unplug my laptop when the battery reach 100%. Instead, I'd rather it just notify me of...
How about: if [ "$percent" -eq 100 ] && [ "$full_flag" -eq 0 ]; then shuttle push note Chrome "Aurora: Battery charged" "Battery is at $percent percent" full_flag=1 fi if [ "$percent" -lt 100 ]; then full_flag=0 fi
Bash script: do something one time inside a loop then stop, but continue looping
1,357,754,399,000
I have (and often change) 3 keyboard layouts on my Mint 17/Mate. I would like to see a notification on my screen when layout is changed, e.g. "Switched to English/US". I tried to do it via keyboard settings, to find a program or script to do it, but I couldn't. The question is: are there any programs to show current l...
I didn't change my keyboard layout very often, but when i do it, i use (for exemple) : setxkbmap fr There's also an option to show the current layout of your keyboard : setxkbmap -query result : rules: evdev model: pc105 layout: fr options: terminate:ctrl_alt_bksp Considering this, you could do som...
Keyboard layout change indicator
1,357,754,399,000
I am running linux mint and use the notify-send command for various purposes, and of course also receive notifications from regular applications e.g. discord or MS Teams When using Cinnamon DE, they look pretty normal, and I can even add icons to my custom notify-send calls to make it clear what is going on However, I...
Systems that do not use a desktop environment usually require installing a separate notification daemon to handle notifications. It appears that you already have the dunst notification daemon installed. To configure its appearance, you can edit ~/.config/dunst/dunstrc. If it is not available, you can create a copy fro...
How to customise the appearance of notify-send?
1,357,754,399,000
On Debian, I am now getting these messages, Dialog reads, Relogin or restarts required! Your session is running obsolete binaries or libraries as listed below. Please consider a relogin or restart of the affected processes! bash[pids] sh[pids] How can I disable these notifications?
Edit the file /etc/needrestart/notify.conf Uncomment the line, #NR_NOTIFYD_DISABLE_NOTIFY_SEND='1' So it looks like NR_NOTIFYD_DISABLE_NOTIFY_SEND='1'
How can I get these dialogs informing me that I need to restart to stop popping up?
1,357,754,399,000
In KDE, I find that if I echo something to pts/0: me@mypc:~$ echo hello > /dev/pts/0 I get a message flash sent to myself. I'd like to make a cron job to send similar messages to myself regularly. How can I do this? P.S. I know that Ctrl+Alt+F7 switches to the GUI, but echoing to /dev/tty7 just gives me a permission ...
If you want to send a pop up message to a user logged into a Desktop Environment, have a look at notify-send.
Pop up a message on the GUI from cron
1,357,754,399,000
I was going through this article on iptables and there the author said that: It's important to turn off ECN (explicit congestion notification) so that Internet communications will work properly. Why do we need to disable the ECN?
There used to be a lot of broken routers out there that would drop any packets with the ECN bits set. I remember trying it and experiencing this personally. This site gives you a taste of how things used to be, particularly the "8% of the internet unreachable!" link. It's of roughly the same vintage as the article you...
Why should the ECN on your machine be disabled?
1,357,754,399,000
I am using Linux Mint 17. I want to be informed every 50 min, at every hour for small break. Here is cron job: nazar@desktop ~ $ crontab -l DISPLAY=:0.0 XAUTHORITY=/home/matrix/.Xauthority 00 13 * * * /home/nazar/Documents/scripts/lunch_break_job.sh # JOB_ID_2 50 * * * * /home/nazar/Documents/scripts/pc_break.sh # J...
You need to set XDG_RUNTIME_DIR as well. Change your crontab to this: DISPLAY=":0.0" XAUTHORITY="/home/nazar/.Xauthority" XDG_RUNTIME_DIR="/run/user/1001" 00 13 * * * /home/nazar/Documents/scripts/lunch_break_job.sh # JOB_ID_2 50 * * * * /home/nazar/Documents/scripts/pc_break.sh # JOB_ID_1 * * * * * /home/nazar/Docume...
Notify-send doesn't work at Cinnamon
1,357,754,399,000
Is there a way to add a dot to notifications from specific applications, similar to an update notification? I've switched today to Geary e-mail, and am missing a claws-mail feature that made notifications similar to these system notifications, dot wise speaking, whenever I got new mail. I'm using Gnome 3, Debian. To ...
Unfortunately this seems to be a "hard" problem. In any case, I found a workaround using the Notifications Alert extension by hackedbellini. You can color (and blink if you want) the date if there is an unread notification. It offers blacklisting or whitelisting if you want to filter which applications this works for....
Adding notification "Dot" in gnome
1,372,441,655,000
You know, I was just there, doing my things, when suddenly a terrible Broadcast message appeared! fiatjaf@mises ~> sl fiatjaf@mises ~> ls dotfiles/ urxvt vim/ vimrc fiatjaf@mises ~> cowsay good morning ______________ < good morning > -------------- \ ^__^ \ (oo)\_______ (__)\ )\...
man wall will give you what you need. You execute wall with either a filename, or you pipe content to it. For example, either, wall file.name to broadcast the content of the file file.name or echo "Dive\!" | wall to send the message Dive! Update: As Stephen points out in this answer, later versions of wall can send me...
How do I send a notification to all active shells, like shutdown does?
1,372,441,655,000
I'm on Debian 6.0.5 (squeeze) and every now and then I see the following icon in the notifications area of the GNOME2 pannel: but black instead of red. It reads A package manager is working. Usually it just displays the red one after a few seconds, which is Available updates, so I assume it was just looking for updat...
"A package manager is working" means that something is holding a lock on /var/lib/dpkg/lock and/or/var /cache/apt/archives/lock. You can find out which process this is with the fuser command: dennis@lightning:~$ sudo fuser /var/lib/dpkg/lock /var/cache/apt/archives/lock /var/lib/dpkg/lock: 18049 /var/cache/apt/archiv...
How can I see which package manager is running?
1,372,441,655,000
here are my notifications and I would like each notification to replace the one before it by the way I am using dunst for my notifications
You should use dunstify instead of notify-send, because first one allows you to use notification ID and replace older notifications with newer ones. Here is link to info about dunstify, and link to example of creating volume level indicator.
How to make dunst show repeated notifications of the same program as one single notification
1,372,441,655,000
I'm using procmail with Maildir/ and easy rules like the one below to save incoming emails into directories: :0: * ^X-Spam-Status: Yes Spam/ Now I would like a desktop notification on new emails in certain directories/rules, I know already how to handle notifications but how to tell procmail to save into a directory ...
Here's a slight adaptation of @slm's answer. You should not use locking with Maildir, and the flags and the lock colon were the wrong way around. (You would effectively create a lock file named c, rather than clone the message, so the second action would never fire.) The f flag seems out of place. I reversed the orde...
procmail save into a dir and execute a script?
1,372,441,655,000
How can I notify all online (Desktop) users from the command-line? I know that if I want that I get notified when something is done, I just do like this: sudo apt-get update | notify-send "apt-get update" "update finished" What should I use to notify all users (or some specific user)?
You can try wall. On my KDE machine, a small panel pops up with the message sent with wall. Of course, the message also appears in all terminals, but maybe your users do not have a terminal open. Example: echo "It is 9 o'clock and all is well." | wall
CentOS: Alert all desktop users from command-line
1,372,441,655,000
I've been messing around with my system too much and messed something up. I'm new to Ubuntu, but have been using linux on servers for a few years. I'm not sure of the correct terminology so I'm including screen shots to explain what is going on. First, system specs: Ubuntu 10.4 LTS x64 Lucid Core i7-970 Nvidia GT...
The Power thingy and the user chat bubble thingy are both the same applet called "Indicator Applet Session".
Gnome panel missing application icons, chat bubble menu, and power menu
1,372,441,655,000
I have the following script: #!/usr/bin/env bash sleep_period=8m while true; do if ps -eo %C --sort -%cpu | head -2 | awk 'NR==2 { exit !($1>8); }'; then notify-send 'CPU alert!' '......' xdotool key shift fi sleep ${sleep_period} done But I don't know how to get the notification to print the % CP...
If I understand your logic correctly, how about this: while true; do highest_cpu="$(ps -eo %C --sort -%cpu | awk 'NR==2 {print $1}')" if [ "$highest_cpu" -gt 8 ]; then notify-send 'CPU alert!' "$highest_cpu" ... fi ... done If you need a non-integer CPU usage threshold, the following Bash-only sol...
How to include %CPU usage in a notification?
1,372,441,655,000
I've managed to get myself into an argument elsewhere trying to discourage somebody from writing a library that invokes aplay in order to get a GUI program to make a simple noise: the sort of thing that on a text console would be done by \a My understanding is that ALSA as a subsystem is fairly pervasive, and libasoun...
There is nothing more annoying than a program that makes a sound that you cannot control. If you want to give immediate feedback to something typed or clicked, use something visual. At the most basic level, the X11 equivalent to a terminal bell is function XBell(), which works over any X11 connection. xkb added more f...
Best practice for generating bell/beep in a *n*x GUI-oriented program
1,372,441,655,000
I have set "Away after 5 minutes" in: Gajim -> Preferences -> Status This mostly works as expected: After 5 minutes of inactivity, my status automatically changes to "Away". When I come back and move mouse, or type on keyboard, the status changes back to "Available". But it only works 95% of the time. Sometimes...
I'll try to answer your question even before you update question with the details. The Analysis There are these states of idle in gajim: @unique class IdleState(IntEnum): UNKNOWN = 0 XA = 1 AWAY = 2 AWAKE = 3 You usually consider only AWAKE or AWAY. The UNKNOWN state is a generic state which is set w...
Gajim: status change from "Away" to "Available" does not work randomly?
1,372,441,655,000
Description of the problem I have UPS Orvaldi KC2000 (its capacity: 2000VA/1400W) and I want to setup configuration of my Debian 10 (Buster which is currently testing) to: get GUI (preferably GNOME) notifications when there is power failure and my computer is running on UPS battery (to know that I have little time to...
This probably a partial duplicate of: Run various shell commands when NUT reports a low UPS battery The tricky part is to display the notification on the desktop, googling a bit, I found http://rogerprice.org/NUT/ConfigExamples.A5.pdf, page 71 it describes some scripts how to do that.
Setup NUT power failure notifications when running computer on UPS battery
1,372,441,655,000
On Ubuntu 12.04 - actually Kubuntu, but I am using NetworkManager, so the configuration should be the same - I have configured a few VPN connections. Now, if I have a long-running up- or download, how can I ensure that all network traffic is stopped immediately and unconditionally if the VPN connection breaks off? Wha...
NetworkManager should be able to do this for you. From the man page: Information about networking is exported via a D-Bus interface to any interested application, providing a rich API with which to inspect and control network settings and operation. NetworkManager will execute scripts in the /etc/NetworkMana...
How can I be notified about state changes to a VPN adapter
1,372,441,655,000
I'm writing a simple osd_cat-based utility to display messages received through libpurple (via Finch or Pidgin, for example). As of now, this is what I have managed to create: dbus-monitor "interface=im.pidgin.purple.PurpleInterface, member=ReceivedImMsg" | awk '/string/ && (NR%2==1) {split($0, sender, "\"") }; /strin...
Old question, but for googlers: I was having similar problems, but on a much simpler scale. I was simply trying to do echo "Some string\nWith a bunch of chars" | osd_cat What I found is that osd_cat seems to have some issues with either lagging detection of availability of the OSD mechanism, or input buffering probl...
Why does the following osd_cat script fail?
1,372,441,655,000
I use ArchLinux, but this should be irrelevant, other than being the reason why I often refer to its wiki pages. I think don't have a really clear understanding of how notifications work, and what are the "players" interacting for notifications to work: how many players are involeved? What is a notification server, a...
What is a notification server, and what does it serve? In general terminology, a server is a program that clients connect to in some way (whether over network or over local IPC mechanisms). The notification server is therefore a program that accepts "show a notification" requests from clients, and shows notification...
How do notifications work on linux?
1,372,441,655,000
I would like to see the "new messages" count number on my taskbar, like Google Mail, for example something like: Inbox(2) - Mozilla Thunderbird I found FireTray, but it doesn't quite work, the taskbar remains unchanged even when I have new messages: Is it possible to have count number like GMail? I am using Ubuntu 1...
First thing, ensure that indicator support is installed on your system (packages libindicator7 and libindicator3-7). This will enable you system to receive indicator messages. $ sudo apt-get install libindicator7 libindicator3-7 Then on Thunderbird open Tools → Add-ons. There ensure that the Extension named "Messagin...
"New messages" count for Thunderbird on Taskbar
1,372,441,655,000
I'm looking for a simple solution to forward libnotify notifications (from knotify4) to a remote growl servers (running on Windows and Android). So far I'm only able to send remote growl notifications from the command line (using gntp-send or this python lib) The Growl for linux implementation is only able to forward ...
I've just found it is possible to do that with a python script connected to the local dbus server as suggested here + the gntp library.
How to forward libnotify to growl
1,372,441,655,000
I recently installed Linux Mint 15 with Cinnamon. It ran smoothly after forcing a kernel update by activating visibility of "Level 5" "dangerous packages". Later, after a post-update reboot, my notifications look like those seen in Ubuntu's Unity (Notify OSD). I have only installed things through Mint's software cente...
Turns out some package must have installed notify-osd. Uninstalling it fixed my issue. sudo apt-get remove notify-osd I also made a bug report (https://bugs.launchpad.net/linuxmint/+bug/1196502)
Ubuntu styled notifications in Linux Mint
1,372,441,655,000
I use arch linux with i3wm. My notifications does not work. When I type dunst in to command line it responds whith: WARNING: No dunstrc found. When I type notify-send --icon=gtk-info Test "This is a test" or dunstify --action="replyAction,reply" "Message received" it keeps running until I kill it with crt+c while no...
Instead of installing dunst as a service, add it to your i3 config: Edit ~/.config/i3/config and add: exec --no-startup-id dunst
Arch linux: Notifications not working in i3wm - dunst: CRITICAL: Cannot open X11 display
1,372,441,655,000
I was playing around with Pushover, and had the thought that it would be cool if I could use it as an argument on any random command, so that it would run a pushover script at the end of the task, regardless of what that task was. I have no idea if it's possible, or how I would go about it, but I'd like to learn. Th...
You do it the other way around: $ pushover-notify "This is my message" command arg1 arg2 Your script pushover-notify could be something like this: #!/bin/sh TOKEN=your_token USER=your_user MSG="$1" COMMAND="$2" shift 2 if "$COMMAND" "$@" ; then # here run your send-message script, with message "$MSG". for example:...
What would it take to add a command to run a script at the completion any given random task?
1,372,441,655,000
Is there a GUI to track any socket connection sent to this computer and which program that initiates it? Also if possible track any incoming connection sent to this computer and which program that handles it (as a realtime popup indicator if possible) ? For example: "/bin/x owned by user x tries to connect to x.x.x.x:...
There is old school console tool: nethogs - Net top tool grouping bandwidth per process e.g. run in this manner: # nethogs eth0 NetHogs version 0.8.0 PID USER PROGRAM DEV SENT RECEIVED 11173 user rtorrent eth0 111.001 4.358 KB/sec 13159 user rtorrent ...
Linux GUI to track connections made from/to this computer
1,372,441,655,000
I'm using Ubuntu-Server 12.04, but I wasn't sure if this was an Ubuntu specific question, so I'm posting it here. I got myself a graphical user interface by installing xinit and openbox (using apt-get install). I installed guake as well (again using apt-get install). However, when I try to run guake in my terminal emu...
This report indicates it's sudo apt-get install notification-daemon.
Guake throws an error on startup
1,372,441,655,000
I am using Debian with KDE. There is a small bash script, that runs in the background. If it encounters a certain condition, I want my work on a full-screen IDE or completely unrelated console windows, to be interrupted with a notification. Once I saw an app, the sole purpose of which was to pop a window of googly eye...
notify-send is simple, all you need to do is call it from your bash script like this notify-send 'some title' 'some message' You'll get nice little notification pupup on KDE.
Looking for a simple graphical notifier in KDE, invokable from bash
1,372,441,655,000
Besides: chmod -x /usr/libexec/notification-daemon reboot are there any solutions to turn off permanently all the annoying notification messages?
Partial answer: as SL uses GNOME, this tells you the gconf keys for disabling at least the power management's notifcations. So in case these are your "annoying" ones... Edit another part, I think you're done with notifications if you disable the Notification Area Applet, probably via some GUI panel options.
Turn off notifications under Scientific-linux 6.1
1,372,441,655,000
I am using Plasma-desktop notifications for all kinds of things, often from scripts using kdialog or notify-send. My Plasma desktop uses a dark background with a light foreground (text). Until a few months ago, all was well, but after a system update (in May?) my notifications kept their dark background but started ...
Luckas' answer pointed me in the direction of a workaround (rather than a solution): In /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml @@ -230,7 +230,7 @@ ColumnLayout { // HACK RichText does not allow to specify link color and since LineEdit ...
How can I change the text colour in a Plasma-desktop notification?
1,372,441,655,000
Whenever I run notify-send, nothing happens. When I run xfce4-notifyd-config and click preview, I get dialogues saying: Error calling StartServiceByName for org.freedesktop.Notifications: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.Notifications exited with status 1 and (x...
Try sourcing /etc/X11/xinit/xinitrc.d/50-systemd-user.sh from your xinit.
xfce notifications not working
1,372,441,655,000
Here's an interesting situation. I have: A Linux box that is a motion sensor and can execute command line commands upon receiving a motion event (see the Linux motion app). Another Linux box that (I would like to) dedicated to additional processing in the event that a motion is detected. The reason I don't want the ...
Step #1 First make sure the motion sensor box has a SSH private key set up on it: ssh-keygen. Step #2 Then make sure the public key for said private key is on the more powerful computer. You need to put it at the end of a file with a name like this: /home/${user}/.ssh/authorized_keys NOTE: ${user} is your user's na...
Broadcast or send machine readable code to ssh clients
1,372,441,655,000
I'm using Linux Mint 16 Petra with the MATE desktop environment. Perhaps I shouldn't have done this, but when I was adding a new application to my list of startup applications, I saw what seemed like duplicate entries, and so I removed the duplicates. After a reboot, the notification area in my panel is now displaying...
This issue sounds suspiciously familiar to this one from Ubuntu. This bug is old, and has to do with gnome-panel. The bug in Launchpad is titled:Visual corruption affecting several panel applets. SUMMARY: After graphical logon notification area gets scrambled. Icons are in terrible mess. Some of them are overlapping ...
Why is my notifications applet displaying incorrectly?
1,372,441,655,000
There is both zenity and notify-send. (on Fedora/GNOME at least, both seems to be pre-installed.) So considering I want to show notifications, what are the differences between these too ones? Is there anyone that is installed in more distros or so (by default)? Is the process of showing notifications any different? Is...
Functionality comparison zenity --notification is equivalent to notify-send for the most simple cases. For example, these two commands are equivalent: $ zenity --notification --text=Title $ notify-send Title and so are these: $ notify-send Title 'Long text message' $ zenity --notification --text='Title\nLong text mes...
What are the differences/(dis)advantages of zenity vs notify-send?
1,372,441,655,000
I use IRSSI (Win 8.1 x64 + cygwin + SSH to remote host, sometimes via putty instead of cygwin) and it's configured to flash taskbar button whenever there's activity in any channel or private chat. There's a bot in one of the channels I'm in which frequently sends some information to the channel and I don't want to be ...
As of irssi 0.8.17 it's possible to ignore ONLY activity: /help ignore The special level 'NO_ACT' can be used to ignore activity in the statusbar without actually ignoring the message; this behavior is somewhat special because it is allowed in addition to other ignores for the same target. Example: /IGNORE mike...
IRSSI: Disable bell on activity in certain channel
1,554,098,830,000
I need to write a script to create and alert and get thread dumps if a string (Related string is found) in a log file - /tmp/area.log. I am able to do this in 2 separate scripts so far but would like combine them into one. Script 1: create an alert filelocation=$1 string=$2 count=$(cat $1 | grep -i "$2" | wc -l) if ...
It is very simple, hope you are asking to do thread dump when you find the string in the log. So when you script 1 finds string in the log you need to run the thread dump script. To do so you need to include the thread dump script in the if [[ "$count" -ge 1 ]]; true block. filelocation=$1 string=$2 count=$(cat $1 | ...
Look up a string in a log to set an alert and generate thread dumps
1,554,098,830,000
When I get a chat message in Empathy, I get a notification in GNOME Shell. This notification allows me to input a reply directly, instead of having to switch to Empathy. Is there any way I can get a similar prompt from a shell script?
No, there is no way to do this. At least not without using a GNOME Shell extension. Here's why. GNOME, along with other desktops, uses a desktop standard from the FreeDesktop (non-)standards body. This particular standard is called Telepathy. Essentially, Telepathy provides an abstract way of dealing with chat for des...
How can I receive input through notifications in bash?
1,554,098,830,000
The notifications extrude the screen. I am on Ubuntu 11.10 with Gnome3.2.
There is a patched version of notify-osd that you can use to customize all aspects of the notification bubbles, including position on the screen. Other possible tweaks include: change font and background colors, opacity, size, corner radius change the timeout (only works if an application specifies the timeout) disab...
Notification out of screen
1,554,098,830,000
I'm connecting using OpenSSH to a Linux server where I have a tmux session where I do certain compiling work which takes a long time. Now I would like to be get right away a notification on my Linux client (the computer I'm connecting from) once a certain command which takes a long time finally is complete. Locally, I...
The simplest solution is to use the exit from tmux, by issuing a tmux detach, to close the ssh connection, then send a notification, and then reconnect and attach back to the tmux. Eg with the script ssh -t remote tmux notify-send done ssh -t remote tmux attach You run tmux, and start off your long-running command, t...
Notification that remote process completed (but no email)
1,554,098,830,000
I want to notify user about important details when package is installed. I've looked at https://www.debian.org/doc/debian-policy/ch-controlfields.html#list-of-fields but don't see anything fit for that purpose. Is there any way to do this?
It seems to me that this is covered earlier in that document, in Prompting in maintainer scripts, with: Package maintainer scripts may prompt the user if necessary. Prompting must be done by communicating through a program, such as debconf, which conforms to the Debian Configuration Management Specification, version ...
How to print message to the user on package installation?
1,554,098,830,000
Is it possible to see the last notifications, that were send through notify send? Sometimes, i just miss the notification and want to see it again.
This depends on what notification deamon you are using. If you are using dunst, which is often used with i3, you can access the history with ctrl + ` You can change the key in ~/.config/dunst/dunstrc: # Redisplay last message(s). # On the US keyboard layout "grave" is normally above TAB and left # of "1". Make sure t...
See last notifications from notify send in I3
1,554,098,830,000
I'm running Pop_OS on a System 76 laptop. It's running Gnome and for some reason after re-installing the OS on a new drive, (the original SSD borked on me) the font in the notifications are HUGE! We're talking 72pt here! Anyways after a couple hours of looking around the interwebs and poking around the system, I've fo...
Using gnome-tweak-tool, which should be available in the repositories (or installed already), you can adjust font sizes and scaling, along with some HiDPI scaling options. There are also a few scaling options in the 'Universal Access/Accessibility' section of the Gnome settings program. One of those should have the se...
Gnome notifications font size is huge. How to change?
1,554,098,830,000
Since a few weeks, I get a notification after each boot telling me that important updates has been installed. Even if I dismiss it then immediately reboot, it comes again. It starts to be quite annoying. It looks like it has started after I get a message asking me something like rebooting for installing updates (sorry...
Deleting the file /var/lib/PackageKit/offline-update-competed solves it. Solution found on Debian forum here. It looks like it is a known bug. But it seems to be there since at least two years. And so it may happen again eventually. I hope someone knows a better solution. (And yes by the way, there is a typo in the f...
"Important updates installed" keeps popping up
1,554,098,830,000
My OS is Xubuntu 14.04 and if you are using it too, you've surely noticed that when internet connection is established, it gives a notification by default at the top right corner of monitor. It has a button Don't show notification and I pressed it accidentally. Now I missed the notifications so much and want it back! ...
Yes, the notification setting can be restored via gsettings. The reason you didn't find the setting is because the it is not stored by Xubuntu notification daemon xfce4-notifyd. Reset network notification The easiest way is to reset the network notification to default setting from command line. The following one-line ...
Missing connection notifications in Xubuntu
1,554,098,830,000
i was working on a python script that displays notification, here's the library I'm using https://www.devdungeon.com/content/desktop-notifications-linux-python from gi.repository import Notify Notify.init("App Name") Notify.Notification.new("Hi").show() it works fine when I run it without sudo but when I run it with ...
Fixed, added a file in /usr/share/dbus-1/services/org.freedesktop.Notifications.service with [D-BUS Service] Name=org.freedesktop.Notifications Exec=/usr/lib/notification-daemon/notification-daemon in it
Ubuntu Notification Failed to execute program org.freedesktop.Notifications: No such file or directory (23)
1,554,098,830,000
in RHEL 7.5, or 7.6 where I am using GNOME classic 3.28, I run a tar command in a terminal window which takes a few seconds, when finished a popup happens saying command completed and other times when I right click and do new terminal, the terminal window shows up almost immediately, but i also get a popup saying ter...
I'm using gnome-session 3.28.1-10.0.1.el8 and have a Notifications page in Settings that allows me to turn off all notifications or just those for a particular application. Turning them all off seems to have prevented the annoying completion messages.
gnome 3.28 disable ready/completed pop-up
1,554,098,830,000
For some of my commonly-used applications, GNOME places their notification icons into this small tray at the bottom-left of my screen. Here's how it looks expanded: It's normally tucked away with about 1 or 2px protruding and can be expanded on click, but this has a major drawback: when it's expanded, it takes up usa...
Through gnome-tweak-tool, you can install the topicons plus extension. It does just that; moves the icons to the top bar, with a few options to get them just right for your setup. Here's a direct link for you convenience: https://extensions.gnome.org/extension/1031/topicons/
In GNOME, can I move icons from the notification tray to the system bar at the top of the screen?
1,554,098,830,000
I want to display my desktop notifications (I'm using Gnome 3) on some other device. So I want to write a software that gets the notification on my computer and sends it over the internet. Unfortunately, I didn't find any good point to start on how my code can get the notifications and do something with them. Is there...
Well, Gnome notifications use D-BUS to pass the messages around. The gnome specification describes how to use the org.freedesktop.Notifications.* classes and has a good deal of formatting tips. In general it is a HTML-ish format. Yet, you absolutely cannot talk to the D-BUS on another machine remotely. Let's not ev...
How do I get the desktop notifications?
1,554,098,830,000
Is there a way, in Linux or FreeBSD, to receive notification from system at a specified time? I'm thinking something in like of what inotify in Linux does for filesystem events. There IS a way to that using cron, but I'm asking if there is a lower-level interface that can be called programatically. If cron is an 'offi...
There are two low level interfaces that I'm aware of: One is simply to do a sleep() until that moment when you want to receive the notification. The sleep call is provided by glibc. The other method would be the alarm() system call. It allows you to tell the kernel that after a defined amount of time has passed it sho...
Get system notification at a certain time?
1,554,098,830,000
When I connect my smartphone to my Debian Linux machine, I see a popup notification from "Portable Media Player". "Who/what" is sending this notification? PMP is a common expression, so Google didn't help much. I'm using: Debian GNU/Linux 10 KDE Frameworks 5.54.0 Qt 5.11.3 (built against 5.11.3)
You are not getting a notification from a portable media player, you are getting a notification about one: the system identifies your phone as a portable media player and is letting you know that a portable media player (your phone) has been connected. This is very common, phones are often recognized as media players ...
How to identify the application sending this notifications?
1,554,098,830,000
I would like to configure NUT UPS monitoring software under Linux to simply page me when the UPS goes onto battery power, and then when it returns to line power. For example, when I receive the following messages from upsmon in syslog: Aug 19 05:43:27 jupsden upsmon[466]: UPS jupsden@localhost on battery Aug 19 05:43:...
Sure you could use 0-length timers, but if you want immediate reactions, there is also the AT ... EXECUTE syntax. If you want pages immediately whenever the power state changes, you would use the AT <notifytype> <upsname> EXECUTE <command> syntax. In other words you could do something like this in upssched.conf: CMDSC...
NUT and immediate notifications
1,554,098,830,000
Using Firefox 64 with Cinnamon (4.0.8) on Arch Linux. Since upgrading to Firefox 62, I'm getting a system notification saying "input AudioIPC Server x%" whenever I start or stop playing media in Firefox. Screenshot below: This is a bit annoying, I'd like to stop getting these without disabling notifications altogethe...
This was caused by the pasystray package. It was reported on GitHub and fixed on version 0.7.1. I had also found a report in the Manjaro forums.
How to disable audio sink notifications from Firefox on Cinnamon?
1,554,098,830,000
What I'd like to achieve is as follows. Say, I run a command in tmux's window: sleep 5; notify-me And I want to see a notification telling me tmux's session name and tmux's window name of what has just finished. I'm running Awesome windows manager. I can display a notification like so: #!/usr/bin/env bash set -eu ech...
I've come up with the following function (to be put into ~/.bashrc): n() { local msg=$(tmux display-message -p '#S: #W: finished') echo " local n = require('naughty') n.notify({ text = '$msg' , preset = n.config.presets.critical }) " | awesome-client }
Desktop notifications of finished tasks
1,437,996,449,000
I'm trying to use a cron job to see when the battery gets lower than a given threshold, and then to send a battery critical notification. However, when I make the cron job execute a script every minute, and make the script send me a notification, it doesn't work. To make sure that it's not a permissions issue with the...
I added this to my crontab and all my notifications work (currently tested with zenity and notify-send): DISPLAY=":0.0" XAUTHORITY="/home/me/.Xauthority" XDG_RUNTIME_DIR="/run/user/1000" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
Unable to send notifications from cron job
1,437,996,449,000
I'm trying to get Dunst to make different sounds when different applications send notifications. Dunst uses a script to play a sound when it gets a notification, this is what is currently in mine: #!/bin/sh paplay ~/.config/dunst/notification.ogg My idea was to use an if statement checking for the name of the applica...
According to the documentation, when you call scripts from a rules file, your script has access to a few environment variables. Or you can give them directly as arguments to the script you are calling. So I guess what you want in your script is something like if [ "$DUNST_APP_NAME" = "application1" ]; then #... el...
Getting the name of the program sending notifications
1,437,996,449,000
I'm trying to send a notification through a notify-send notify-send 'System' 'Dist files is already' $(du -h /var/cache/distfiles/ | tr -d '/var/cache/distfiles/') But the spacer that I need cannot be displayed for some unknown to me reason, it outputs: Invalid number of options. But If I'll remove the spacer in the...
The command tr doesn't work as you intended: -d, --delete delete characters in SET1, do not translate Meaning that tr removes single characters from the SET1, for example: $ echo foobar | tr -d fb ooar Now let's see man notify-send: SYNOPSIS notify-send [OPTIONS] {summary} [body] So you have to pass 2 a...
Problem with a spacer
1,437,996,449,000
I accidentally subscribed to news notifications from a stock market site and now I am getting notifications every few minutes that are irritating me. I do get other notifications for email I'd like to keep. How can I find which alerts are active on my system and turn them off? Or failing that, turn them all off. I am ...
To disable Web push notifications for a site in Firefox : Click on the "i" (left of the green lock on the address bar). Open permissions preferences. Notifications/Settings Block the website
How to turn off a notification coming from a website?
1,437,996,449,000
I have two computers, a desktop and a laptop, both running Debian Stretch. Desktop notifications works on the laptop, and I believe it works (the attached monitor is broken, so I can't check, and maybe I should say "used to work"). On the laptop I run i3 as wm, no desktop environment, and dunst as notification daemo...
Based on the comments to the question, I found Why can't I run Gnome apps over remote SSH session? Two of the answers (not the accepted one, but that is older, and might work too, just not be the easiest way any longer) there mentioned dbus-launch. And if I run dbus-launch notify-send "Hello world", the notification ...
Forwarding desktop notifications over SSH
1,437,996,449,000
I would like to set up my terminal to use a visible bell notification. Konsole is my preferred terminal emulator, but I can't seem to figure this out. Everything I can find on the web points me towards set bell-style visible in .bashrc, or towards Settings->Configure Notifications. The bash setting seems to have no ef...
Thanks to @Gilles' hints, I put together something that flashes the command window when there is a bell in a visible session. To do this I wrote a quick bash script: #!/bin/bash #flash console as a visible bell #requires installation of xcalib xcalib -i -a sleep 0.01 xcalib -i -a and entered the full path to this sc...
Does konsole support a visible bell?
1,437,996,449,000
Based on my previous searches, I think that the answer is that I can't do that, but anyway I would like to ask because I'm not a linux pro. I have a small app made with nodejs that launch a desktop notification every second: import notifier from 'node-notifier' import {CronJob} from 'cron'; /* Create a cron job that ...
You should specify the environment variable: DBUS_SESSION_BUS_ADDRESS in your systemd service and use RemainAfterExit=yes in the section [Service]. In my case, I used echo $DBUS_SESSION_BUS_ADDRESS to get its value: echo $DBUS_SESSION_BUS_ADDRESS #output: unix:path=/run/user/1000/bus So the systemd service would be: ...
How to run a node app which launch a desktop notifications using systemd service
1,437,996,449,000
I am working on customizing the look of my desktop with the cinnamon.css file in a custom theme that I am working on for Linux Mint, and I came across the osdWindow class in the file, and was able to change the background-color, border-radius, etc. of the volume and brightness osd notifications. But I was wondering ho...
I figured it out! The trick was to open the osdWindows.js file and find the following lines: this._icon = new St.Icon(); this.actor.add(this.icon, { expand: true }); and comment out the second line. Then I discovered that while this does remove the icons, it does not resize the osd window, so I then found the foll...
How to customize the osd windows in cinnamon?
1,437,996,449,000
I'm using rsync to push some changes to a server, for that I made a bash script and I want to show a status notification in the desktop (I'm using Linux Mint 18 Cinnamon) Is it possible to send the output of rsync to notify-send so I can see the amount of data synchronized? Here is my actual bash script: notify-send "...
If you want a notify popup holding the final summary line, something like sent 6,673,231 bytes received 17,718 bytes 13,381,898.00 bytes/sec total size is 6,613,892 speedup is 0.99 then you can capture the rsync output into a file, and use the last 2 lines of the file: rsync ... | tee /tmp/out notify-send "$(tail ...
bash : send rsync status using notify-send
1,437,996,449,000
I want to get a notification each time I get a /query message or get highlighted in a channel. this notification should be in the form of bubble OSD (on screen Display). If OSD isn't possible for Linux, I'll settle for bringing the terminal window containing the irssi instance to the top of the window stack and flic...
This is easy enough to set up using the fnotify script. Set it to autoload and then customise it to print to a file of your choosing: sub filewrite { my ($text) = @_; # FIXME: there is probably a better way to get the irssi-dir... open(FILE,">>$ENV{HOME}/path/to/your/fnotified"); print FILE $text ....
OSD notification for Irssi
1,437,996,449,000
I'm just learning Linux for educational purposes, but, I am really enjoying this operation system. For a homework I have to implement a system that contains something that the users can see as the safest when managing a server, so, I'd want to configure something like: If a user with root permission needs to install a...
In a modern distribution with a non-exotic configuration this is already happening, see the output of journalctl -xe You can parse it with something like the command below to get something easier to read: journalctl -e | perl -ne 'print "\"$1\" ran \"$2\" with sudo\n" if(/.*sudo.*?\:\s*(\S+).*COMMAND=(.*)/);'
Need to monitor sudo permission
1,437,996,449,000
I subscribe to the Boston Globe. I get unwanted news alerts from them as desktop notifications. I never asked for them. I don't want them. I contacted the Boston Globe and they won't help me. I logged on to bostonglobe.com and looked for a relevant setting - no luck. I get many desktop notifications. I only want to s...
The UI on these notifications changed a few days ago. (I do an apt update; apt upgrade every night.) The notification box now has a place you can click (I forget if it was a tiny gear icon or what) to block notifications from this source (in my case bostonglobe.com). I still don't know the answer to my question, but m...
How to block specific desktop notifications? [closed]
1,437,996,449,000
Is it possible to deactivate wpa_cli notifications/messages like <3>WPS_AP_AVAILABLE? Because it spams it, and in a VT where you have to slowly type MACs@ and bssIDs, it's really hard with those bothering messages
Sadly, no. This function is responsible for deciding if events sent from wpa_supplicant to wpa_cli are written to the interactive terminal. static int wpa_cli_show_event(const char *event) { const char *start; start = os_strchr(event, '>'); if (start == NULL) return 1; start++; /* * ...
Deactivate wpa_cli notifications
1,437,996,449,000
I use Linux Mint. Every 3-5 hours I see a new update notificaton. I have no probelm installing them, but just from curiosity, why do I get them that often? Is it a regular thing? Should I worry about it?
The mintupdate refresh the apt cache periodically and display the available packages upgrade, that's why you get a notification every 3-5 hours (the default is 2 hours, you can adjust it from the mintupdate preferences). It is a good feature to keep the system up-to-date. When you receive a notification, you can upgra...
Too much notifications for updates in Mint
1,437,996,449,000
There's a process in my system (a standard desktop installation with upwards of 150 quiescent processes at any time) that is sporadically resetting a config file's permissions that I have explicitly set so that it could be read by multiple users. Even though I have ways to prevent that from happening (eg, changing t...
First try list the open files if you can diagnose , which display the user too along with which program does that. lsof /path/file-name Check out these for more details : Check which process modify file
How to find which running process is modifying a file's permissions (Linux)? [duplicate]
1,437,996,449,000
I would like to display a dialog box using zenity or dialog or something similar based on a specific string displayed in console window? Background: I have created a wrapper shell script which calls Tomcat 7 catalina.sh. I want to display a info box with a OK message when "Server startup in XXXXXms" is outputted to t...
Completely untested: /path/to/catalina.sh 2>&1 | while IFS= read -r line; do echo "$line" if [[ $line == *"Server startup in"* ]]; then dialog --msgbox "$message" 10 40 fi done
Create dialog based on console output
1,437,996,449,000
Whenever I visit any Index page of any website, it pops up with this notification. I'm using Kali GNU/Linux Rolling.
If your browser is Google Chrome, you may get rid of gnome-keyring in it. Just switch to internal Chrome password storage with --password-store=basic on Google Chrome start: /usr/bin/google-chrome-stable --password-store=basic
how to remove the popup notification of keyring login?
1,437,996,449,000
I am on BunsenLabs (debian jessie 8.2). One day the notifications started looking like this. I don't remember messing with anything to with notification themes. If I select these options from the notification options, nothing happens. How do I reset or fix this?
As ipor-sircer noted, it was an extra notification daemon called dunst that was installed. I started getting regular notifications again after I have uninstalled it, logged out and logged in.
How do I reset notification themes?
1,437,996,449,000
I have a quite long Bash script I use to install Apache server environments including PHPmyadmin and several other utilities, after logging to the remote machine via SSH. I run the script via the Ubuntu server 16.04 CLI terminal. When the script runs, it stops sometimes, about 5-6 times to ask for password (whether i...
Try this: # modprobe pcspkr # echo -e "\a" >/dev/console If you didn't hear a sound... Are we sure you do have a piezo speaker in there? Otherwise, continue with loading pcspkr on boot: # echo pcspkr >>/etc/modules
Sound indicator for when a script temporarily stops? For example, to fill in data or passwords? [duplicate]
1,378,499,802,000
Is this the right way to do float to integer conversion in bash? Is there any other method? flotToint() { printf "%.0f\n" "$@" }
bash In bash, that's probably as good as it gets. That uses a shell builtin. If you need the result in a variable, you could use command substitution, or the bash specific (though now also supported by zsh): printf -v int %.0f "$float" You could do: float=1.23 int=${float%.*} But that would remove the fractional par...
How to convert floating point number to integer?
1,378,499,802,000
I was looking for a command to limit numbers read in from stdin. I wrote a little script for that purpose (critique is welcome), but I was wondering if there was not a standard command for this, simple and (I think) common use case. My script which finds the minimum of two numbers: #!/bin/bash # $1 limit [ -z "$1" ] ...
You can compare just two numbers with dc like: dc -e "[$1]sM $2d $1<Mp" ... where "$1" is your max value and "$2" is the number you would print if it is lesser than "$1". That also requires GNU dc - but you can do the same thing portably like: dc <<MAX [$1]sM $2d $1<Mp MAX In both of the above cases you can set ...
Is there a unix command that gives the minimum/maximum of two numbers?
1,378,499,802,000
Suppose I want to compare gcc version to see whether the system has the minimum version installed or not. To check the gcc version, I executed the following gcc --version | head -n1 | cut -d" " -f4 The output was 4.8.5 So, I wrote a simple if statement to check this version against some other value if [ "$(gcc --ver...
I don't know if it is beautiful, but it is working for every version format I know. #!/bin/bash currentver="$(gcc -dumpversion)" requiredver="5.0.0" if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then echo "Greater than or equal to ${requiredver}" else ...
How to compare a program's version in a shell script?
1,378,499,802,000
I am making the check for update script for my theme I have 2 text files. First one is called "current.txt" and contains the current version. There is 4.1.1 string in that text file. Second one is called "latest.txt" and contains the latest version. There is 4.2 string in this text file. So here is the code echo "Chec...
The test command, also named [, has separate operators for string comparisons and integer comparisons: INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2 vs STRING1 = STRING2 the strings are equal and STRING1 != STRING2 the strings are not equal Since your data is not strictly an integer, your test needs to use...
Bash - Integer expression expected
1,378,499,802,000
I have a line (or many lines) of numbers that are delimited by an arbitrary character. What UNIX tools can I use to sort each line's items numerically, retaining the delimiter? Examples include: list of numbers; input: 10 50 23 42; sorted: 10 23 42 50 IP address; input: 10.1.200.42; sorted: 1.10.42.200 CSV; input: 1,...
With gawk (GNU awk) for the asort() function: gawk -v SEP='*' '{ i=0; split($0, arr, SEP); len=asort(arr); while ( ++i<=len ){ printf("%s%s", i>1?SEP:"", arr[i]) }; print "" }' infile replace * as the field separator in SEP='*' with your delimiter. You can also do with the following command in case of...
How can I numerically sort a single line of delimited items?
1,378,499,802,000
I have a file in the name of Build.number with the content value 012 which I need to increment by +1. So, I tried this BN=$($cat Build.number) BN=$(($BN+1)) echo $BN >Build.number but here I am getting the value 11 when I am expecting 013. Can anyone help me?
The leading 0 causes Bash to interpret the value as an octal value; 012 octal is 10 decimal, so you get 11. To force the use of decimal, add 10# (as long as the number has no leading sign): BN=10#$(cat Build.number) echo $((++BN)) > Build.number To print the number using at least three digits, use printf: printf "%.3...
How to increment the value of a (decimal) variable (with leading zero) by +1?
1,378,499,802,000
I would like to know if there is a way of using bash expansion to view all possibilities of combination for a number of digits in hexadecimal. I can expand in binaries In base 2: echo {0..1}{0..1}{0..1} Which gives back: 000 001 010 011 100 101 110 111 In base 10: echo {0..9}{0..9} Which gives back: 00 01 02...99 ...
You can; you just need to break the range {0..F} into two separate ranges {0..9} and {A..F}: $ printf '%s\n' {{0..9},{A..F}}{{0..9},{A..F}} 00 01 ... FE EF
Bash expansion hexadecimal
1,378,499,802,000
Is it possible to generate real random numbers with a specific precision and in a specific range using the Integer Random Generator $RANDOM? For example how we can generate real number with 4 precision between 0 and 1? 0.1234 0.0309 0.9001 0.0000 1.0000 A simple workaround: printf "%d04.%d04\n" $RANDOM $RANDOM
awk -v n=10 -v seed="$RANDOM" 'BEGIN { srand(seed); for (i=0; i<n; ++i) printf("%.4f\n", rand()) }' This will output n random numbers (ten in the example) in the range [0,1) with four decimal digits. It uses the rand() function in awk (not in standard awk but implemented by most common awk implementations) which retu...
Bash: How to generate random float number using $RANDOM
1,378,499,802,000
I have a file of genomic data with tag counts, I want to know how many are represented once: $ grep "^1" file |wc -l includes all lines beginning with 1, so it includes tags represented 10 times, 11, times, 100 times, 1245 times, etc. How do I do this? Current format 79 TGCAG..... 1 TGCAG..... 1257 TGC...
With awk: awk '$1 == "1" { print; x++ } END { print x, "total matches" }' inputfile
Grep lines starting with 1, but not 10, 11, 100 etc [duplicate]
1,378,499,802,000
Is there a simple command to reverse an hexadecimal number? For example, given the hexadecimal number: 030201 The output should be: 010203 Using the rev command, I get the following: 102030 Update $ bash --version | head -n1 GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) $ xxd -version xxd V1.10 27oct98 ...
You can convert it to binary, reverse the bytes, optionally remove trailing newlines rev <2.24, and convert it back: $ xxd -revert -plain <<< 030201 | LC_ALL=C rev | tr -d '\n' | xxd -plain 010203 Using $ bash --version | head -n1 GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu) $ xxd -version xxd V1.10 ...
Reverse a hexadecimal number in bash
1,378,499,802,000
how to calculate percentage from number for example we set number=248 and we want to know what is the 80% from $number so how to calculate it in bash ? expected output 198 ( exactly is 198.4 but we want to round down with floor )
bash cannot do floating point math, but you can fake it for things like this if you don't need a lot of precision: $ number=248 $ echo $(( number*80/100 )) 198
bash + how to calculate percentage from number [duplicate]
1,378,499,802,000
I've such a file: name: xxx --- time: 5.4 seconds name: yyy --- time: 3.2 seconds name: zzz --- time: 6.4 seconds ... Now I want to sort this file by these float numbers to generate a new file as below: name: yyy --- time: 3.2 seconds name: xxx --- time: 5.4 seconds name: zzz --- time: 6.4 seconds ... I've tried the...
If using GNU sort or compatible, you can use its -g switch to do a general numeric sort: $ sort -g -k5,5 file name: yyy --- time: 3.2 seconds name: xxx --- time: 5.4 seconds name: zzz --- time: 6.4 seconds The -k5,5 tells sort to perform the sort on just the 5th column. Usage Keep in mind the details from the info so...
How to sort lines by float number
1,378,499,802,000
I have a txt file that contains some numbers like this: 1 2 3 4 5 And I have another txt file that contains the same number of lines, but with other numbers: 6 7 8 9 10 I want to add them together, namely 1+6, 2+7, 3+8, etc.. How do I write the script? By the way, I've got a variety of answers s...
This is basic task many tools can solve; paste + awk combo seems exceptionally handy: $ paste file1 file2 | awk '{$0=$1+$2}1' 7 9 11 13 15
How do I add numbers from two txt files with Bash?
1,378,499,802,000
I spent hours in searching how to round "floating numbers" in BASH but couldn't find any correct! solution :( If I put these numbers to Excel, then I will receive the correct results after rounding to 2 decimals: 3.314 -> 3.31 3.315 -> 3.32 8.124 -> 8.12 8.125 -> 8.13 How to have the exact results in BASH? I tried wi...
If your system uses GNU coreutils then the numfmt command should be available, and allows you to choose between rounding ‘up’, ‘down’, ‘from-zero’ (the default), ‘towards-zero’, or ‘nearest’. For example (here in a locale where the decimal radix character is .): $ numfmt --round=nearest --format %.2f << EOF 3.314 3.31...
How to round to 2 decimals in bash like MS Excel does?