date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,405,814,980,000 |
Is it true that find is not supposed to be doing even the most simple path unification/simplifications operations, such as coalescing multiple successive slashes together (which would be equivalent to the original form)?
For example the output of find ./// is:
.///
.///somefile
[…]
(tested with find from GNU and busybox)
If so then why is that? Is there any sensible use case I'm missing? Perhaps for the case that someone is grepping the output of find inside scripts?
BTW, Also interesting is the output of GNU's find for find ./// -maxdepth 0 -printf '%h\n' (%h is supposed to be "Leading directories of file's name (all but the last element and the slash before it)"): .// (simply one fewer /)
|
If you don't have utilities that can understand NUL characters, then this historical behavior can be used to distinguish between files. The output of find will never contain two slashes in a row unless they are provided as part of the initial path. This means that output like
.//path/to/file
./name/more
tells you that there is a directory called file\n. rather than there is a sub-directory of the current directory called name if you invoke find with
find .// -print
| Any reason why find does not merge multiple slashes into one? |
1,405,814,980,000 |
I looked at this scheme and now i want to know, can one executable be runned in a two systems, which have the same ancestor? (and so probably the same kernel?)
For example, according to the scheme: Solaris <- System V R4 <- BSD 4.3, so, can the BSD* (OpenBSD, FreeBSD, NetBSD) and the Solaris run the same executable?
P. S. may be this question is obvious and meanigless to you, but i am completly new to the *nix, so for me it is important.
|
Short answer: No.
Medium answer: Maybe, if the target OS supports it.
Long answer...
First thing to be aware of is that different vendors may use different chip sets. So a Solaris binary may be compiled for a SPARC chip. This won't run on an Intel/AMD machine. Similarly AIX may be on a PowerPC. HP-UX might be on PA-RISC. Let's ignore all these problems and just stick with the "Intel/AMD" space.
The next problem is that different OSes may expose different kernel system calls. This means that any call the application makes into the kernel won't do what is expected. This is obviously a problem. However the target kernel may be able to provide an "ABI compatibility layer"; the kernel (let's say a FreeBSD kernel) can detect you are trying to run a Linux binary and can translate between the Linux kernel ABI and the native kernel ABI.
The next problem is one of libraries; a Linux binary would expect to be able to load glibc of a specific version, which may not be present in the hosting OS. This may be solvable by copying the required libraries over. Again an OS may make this easier for you, e.g. by having a package for these libraries to make them easy to install.
After all this your binary may run :-)
Back in the 90s, Linux had a iBCS module which allowed for exactly this sort of thing. It made it possible to run, for example, SCO Unix programs on Linux. I had run SCO Unix Oracle on my machine as a proof of concept. It worked pretty well! Obviously there was no vendor support, so it wasn't suitable for production :-)
Now Linux has a massive foothold in this space other OSes try and add compatibility layers to allow Linux programs to run on their OSes.
So if your OS supports is and if you install and configure it properly then you may be able to run some programs from another Unix.
| *nix executable compatibility |
1,405,814,980,000 |
I'm trying to execute a compiled Lazarus file which was working on macOS 10.14.x. After updating to 10.15, I started to get an error, "Bad CPU type in executable", which as far as I understand means that it is no longer compatible.
./myScript
->>>>>>>>>>>>>>> bad CPU type in executable
file myScript
->>>>>>>>>>>>>>> Mach-O executable i386
uname -a
->>>>>>>>>>>>>>> Darwin-MacBook-Air.local 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64
uname -p
->>>>>>>>>>>>>>> i386
I wonder why this executable causes this error while it is i386 which had to be compatible with this version?
Is there any way to run it on macOS 10.15.x? Or is the only way to build it again with different, compatible build settings? (This is not yet supported by Lazarus.)
|
macOS Catalina (10.15) dropped support for 32-bit executables, which is why your executable no longer works.
The ideal solution is to build a 64-bit binary. The Lazarus wiki describes how to do this: target x86_64, use Cocoa widgets, and build with fpc rather than ppc386.
| Executing "Bad CPU type" executables in 10.15.x |
1,405,814,980,000 |
Here on a Debian system I use mainly gpg2. Some (Debian packaging/signing) tools use gpg1 internally, and changing them as it should be would be infeasible.
Both my gpg versions are using the same work directory (~/.gnupg) and their databases / configuration seem mainly compatible. An exception for this is the handling of the private keys.
As I experienced, private keys created by gpg2 are not visible for gpg1 (but their public pairs are).
Digging a lot on the net, as I understand, the gpg versions are using different files (and maybe different formats) below ~/.gnupg to store them. There are also various one-line solutions to convert the gpg2 database to gpg1 and vice versa.
Now I have to use mainly gpg2, but I have to allow also gpg1 to work. My idea for this task is that
I export the gpg2 private key database.
I import it with gpg1.
The expected result would be that I can see the same public and private keys with both gpg versions.
Is it possible? Could it work? How can I do that?
(Note: at least Ubuntu and Mint uses already gpg2 for packaging tasks, but Debian still doesn't.)
|
GnuPG 1.4, 2.0 and 2.1 all support the "good old" pubring.gpg file for storing public keys. As long as a pubkey.gpg exists, also GnuPG 2.1 will continue to use it and not create a public keyring in the new keybox format.
There are differences with respect to private keys, though. While GnuPG 1.4 and 2.0 both store private keys in the secring.gpg file, GnuPG 2.1 merges those into the public keyring file, such that GnuPG 2.1 (gpg2, on newer distributions also gpg) and GnuPG 1.4 (gpg1 if available, on older distributions also gpg) do not share a common secret keyring store any more (but still can do for the public keyring, as already explained).
If you export the secret keys from gpg2 and import them to gpg/gpg1, you should be able to use them from both implementations. GnuPG 1.4 does not mind that secret keys are stored in your pubring.gpg file. Be aware GnuPG 1.4 cannot merge secret key packets; if you change your subkeys in GnupG 2.1 and want to copy them to GnuPG 1.4 agein, you will have to delete the secret key from GnuPG 2.1 and import it again. Always make a backup copy before changing anything!
| Can I use GnuPG 2 and GnuPG 1 concurrently, seeing the same keys? |
1,405,814,980,000 |
sfdisk --delete $disk
From Ubuntu 18.04 or later works. What is the equivalent command in Ubuntu 16.04 LTS?
Ubuntu 16.04 LTS (--delete missing),
Ubuntu 18.04 LTS (--delete present)
|
Solution 1: build and install sfdisk from sources (to be able to use a more recent version)
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-2.35.tar.gz
tar -xvf util-linux-2.35.tar.gz
cd cd util-linux-2.35
./configure
make
make install
/usr/local/bin/sfdisk --delete $disk
Solution 2: use fdisk
# list disk and partitions
fdisk -l
# open the target disk with fdisk
fdisk /dev/target-disk
# then use the d command option to delete the partition you want to remove
# then use the w command option to save the changes
| Missing argument option in sfdisk? |
1,405,814,980,000 |
Occasionally, NixOS changes config options in a way that is not entirely backwards compatible. For example, nixos 19.09 did not have a programs.gnupg.agent.pinentryFlavor option, but in nixos unstable (soon 20.03) I need to set it to a non-default value in order to get the right pinentry variant.
I share my configuration across machines, some of which run nixos-19.09 and some nixos-unstable, so I want my configuration to be compatible with both. (even without multiple machines, it would be nice to be able to switch nixos channels without breakage)
Setting programs.gnupg.agent.pinentryFlavor = "gtk2"; as needed for nixos-unstable causes nixos-rebuild to fail on nixos-19.09:
error: The option `programs.gnupg.agent.pinentryFlavor' defined in `[...]/desktop.nix' does not exist.
(use '--show-trace' to show detailed location information)
Is there a way to check if an option is valid?
Essentially, I'm looking for what to write in place of ???(pinentryFlavor)) here, so as to not set a nonexistent option:
programs.gnupg.agent = { enable = true;} // (
if ???(pinentryFlavor)
then { pinentryFlavor = "gtk2"; }
else {});
|
The configuration function does receive an options attr, so it is possible to check if a given option is defined using builtins.hasAttr before setting it in the configuration.
Most NixOS configurations don't extract options, so you may need to add it first. For example:
{ config, pkgs, options, ... }:
{
programs.gnupg.agent =
{ enable = true; } //
# False on NixOS 19.09
(if builtins.hasAttr "pinentryFlavor" options.programs.gnupg.agent
then { pinentryFlavor = "gtk2"; }
else {});
}
Similarly, the same approach can be used to set options used by nixos-rebuild build-vm, which would normally not be available.
Instead of needing to set options via environment variables when running the VM like
QEMU_OPTS='-m 4096 -smp 4 -soundhw ac97' ./result/bin/run-*-vm
the equivalent options can be set in configuration.nix:
# The default 384MB RAM is not enough to run Firefox in a VM
virtualisation =
lib.optionalAttrs (builtins.hasAttr "qemu" options.virtualisation) {
memorySize = 4096;
cores = 4;
qemu.options = [ "-soundhw ac97" ];
};
| Set NixOS config option only when it is valid, for backwards compatibility |
1,405,814,980,000 |
If for example I have compiled a simple C program that uses GTK 3 on a machine running Ubuntu, will I be able to run it on other Linux flavours?
Note: My actual questions is "Should I label my compiled program for Linux or just Ubuntu?"
eg. Should I label my downloads page as
Windows
program.exe
Linux
program
Macintosh
program.app
or
Windows
program.exe
Ubuntu < Version 17.04
program
Macintosh
program.app
|
Linux executables are not specific to a Linux distribution. But they are specific to a processor architecture and to a set of library versions.
An executable for any operating system is specific to a processor architecture. Windows and Mac users don't care as much because these operating systems more or less only run on a single architecture. (OSX used to run on multiple processor architectures, and OSX applications were typically distributed as a bundle that contained code for all supported processor architectures, but modern OSX only runs on amd64 processors. Windows runs on both 32-bit and 64-bit Intel processors, so you might find “32-bit” and “64-bit” Windows executables.)
Windows resolves the library dependency problem by forcing programmers to bundle all the libraries they use with their program. On Linux, it's uncommon to do this, with the benefit that programmers don't need to bundle libraries and that users get timely security updates and bug fixes for libraries, but with the cost that programs need to be compiled differently for different releases of distributions.
So you should label your binary as “Linux, 64-bit PC (amd64), compiled for Ubuntu 17.04” (or “32-bit PC (i386)” if this is a 32-bit executable), and give the detail of the required libraries. You can see the libraries used by an executable with the ldd command: run ldd program. The part before the => is what matters, e.g. libgtk-3.so.0 is the main GTK3 library, with version 0 (if there ever was a version 1, it would be incompatible with version 0, that's the reason to change the version number). Some of these libraries are things that everyone would have anyway because they haven't changed in many years; only experience or a comparison by looking at multiple distributions and multiple releases can tell you this. Users of other distributions can run the same binary if they have compatible versions of the libraries.
| Compiled Executable |
1,405,814,980,000 |
I run Puppy Linux (Puppeee to be precise) on my old x86 netbook and I love it: It's breathed new life into my netbook and made it suitable as a low(ish)-power home server.
However, some cloud and telephony companies only grudgingly compile their proprietary code for Linux and usually then only for a few major distros like Ubuntu.
Are there any methods to provide compatibility for Ubuntu in another distro like Puppy Linux when I only have whatever binary package the company provides?
|
As mentioned in my comment, docker would work very well for this. The downside to it is that it eats a lot of disk space. Aside from disk space, there's no other overhead, not even CPU or memory.
In a nutshell, docker essentially sets up a chroot inside a full OS image. So you end up running another distro inside your own. Docker is simply responsible for setting up the environment in which the application runs, and then starting the app. Once the app is launched, it's just another process on your system. Shows up in ps, can be killed, etc.
Since you're running the full distro, the only possible incompatibility is if whatever you're trying to run depends on kernel features your kernel doesn't have. This is not very likely.
Once you get docker on your system, you can build an image containing the software. You'd do this by creating a "dockerfile" which looks like:
FROM ubuntu:12.04
RUN apt-get install -y wget
RUN wget http://telephonyco.com/proprietary_code.deb
RUN dpkg -i proprietary_code.deb
After you build this, you can either run the program directly with:
docker run -ti name_of_image_you_created proprietary-program-foo
Or you can get a shell inside the image:
docker run -ti name_of_image_you_created bash
| Are there methods or compatibility libraries to run .deb applications on Puppy linux (where where no app source is provided)? |
1,405,814,980,000 |
When I establish LAMP environments on Debian, I install some PHP extensions:
apt install php-{cli,curl,mbstring,mcrypt,gd}
From the above, besides php-gd, all packages are missing in Arch.
What are their substitutes, if at all, in Arch? How should I handle this situation?
|
Not every distro splits it up the same way, so some of it is already in the main package.
# archlinux with only main php package installed
$ php --modules
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
hash
json
libxml
mbstring
mysqlnd
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
Other modules can be found in either standard repository or AUR ( https://aur.archlinux.org/packages/php71-mcrypt/ seems to be one ) and if all else fails - you might have to build it yourself.
That's if you really need a specific extension, and didn't simply install it out of habit. According to Wikipedia, mcrypt is abandonware since 2007.
| Arch: Some very-common PHP packages missing in repo |
1,405,814,980,000 |
Are the MDoc macros, commonly used to create BSD manpages, commonly available on non-BSD systems (such as Ubuntu and other GNU Linux distros)? Is it safe to design manpages using them when writing cross-platform documentation?
|
I think you can probably use these macros without problems.
I looked on 3 sample OS's I have: ubuntu 14.04, debian 7.8, fedora 21, and they
all use the groff package to include the mandoc macros (though not the mandoc command)
and to provide a man page on them: mdoc(7).
I checked if there were any man pages installed actually using these macros with:
find /usr/share/man/man1/ -type f |
while read f;do if gzip -d <$f | fgrep '.Dd'; then echo $f; fi; done
and found several files, eg ftp(1), ssh-agent(1), ncal(1). I tried the man
command on these, and they showed up correctly.
So, if most systems have groff installed they can read these man pages. Anyone got a mac osx to try on?
| Is the mdoc macro set available on non-BSD systems by default? |
1,405,814,980,000 |
We have a typical account domain with NFS home directories, accessible by the mail server as well as various user workstations.
Do the versions of the vacation package installed on the mail server and the workstations need to match?
My understanding is that the vacation program uses a Berkeley DB to keep track of which senders it has already auto-replied to, so as not to send bounce messages to the same sender twice. What if the database is created on a workstation whose vacation is linked to one version of Berkeley DB, and subsequently used by the MDA, where the vacation on the mail server is linked to some other version of Berkeley DB? Will that cause a failure?
According to the Oracle documentation,
Berkeley DB major and minor releases may optionally include changes in all four areas, that is, the application API, region files, database formats, and log files may not be backward-compatible with previous releases.
So I'm worried that letting different versions of the Berkeley DB library access the same ~/.vacation.{db,dir,pag} files could cause data corruption.
|
Yes, vacation does use Berkeley DB for the purpose you described.
Indeed, you could run into problems if you try and access the same Berkeley DB files using different versions of the client libraries. The on-disk format does change from time to time and upgrading is normally handled transparently by the client application (or manually, using the db_upgrade script). Once the database files have been upgraded, there's no guarantee that a client using a previous version of the client libraries will be able to access the database files that have been upgraded. In light of that, it's probably a prudent step to synchronise the vacation versions across your estate just to be safe.
There's another issue (although it's probably minor) - you can run into concurrent access problems accessing Berkeley DB over NFS. See the FAQ for more information. I'd imagine it's probably not a big problem though, as vacation isn't a transaction processing system.
| Can the vacation e-mail auto-responder cope with Berkeley DB version skew? |
1,405,814,980,000 |
Following up on Is Ubuntu LTS binary compatible with Debian?
I know Ubuntu and Debian binary packages are incompatible more often than not. I know mixing packages from different sources is generally a bad idea, and people get warned against doing that all the time. So let's keep the discussion pure technical --
What exactly will introduce incompatibility for packages from different sources, when of course the dependencies are not the problem?
------ Separation, more details below ------
Like the saying:
about binary compatibility (https://wiki.ubuntu.com/MarkShuttleworth#What_about_binary_compatibility_between_distributions.3F): Debian packages are likely built with different toolchain versions, so you may incur in troubles
Why different toolchain versions will give problem? Like
I know how to pull the minimum set of packages from Debian sid into my Debian stable, and had been doing that all the time,
I used to carry packages from older version of Ubuntu / Debian to their newer versions, or even
copying a single executable from my Ubuntu / Debian to another distro, be it RedHat or even FreeBSD,
and never had problem before. So what exactly is causing the problem that people are saying?
Is it gcc or kernel version? Unlikely to me, as they get upgraded all the time throughout the lifespan of me using that release.
So it is the version of glibc? But it'll be backward compatible normally and most probably, right?
Quoting from the answer from my first link:
There really is no guarantee or even implication of cross-compatibility. Don't expect either the Debian or Ubuntu communities to give you much sympathy if things go wrong. In that event you're mostly on your own. As long as you're okay with that then feel free to give it a try.
So basically I see warning against the practice everywhere, but nobody give further technical explanation. Can anyone list the risks of doing so, those potential technical
problems please?
That answer will help me, if I want/need to mixing packages from different sources, say Debian or Ubuntu, or within the same distro but different releases, (if the dependencies are not the problem), to choose the safest approach, to pull a PPA that I know for sure will never end up in Debian, into the Debian Bullseye that I'm currently using.
|
Binary and package incompatibilities are different and are worth explaining separately.
Binary incompatibility
This is usually what is referred to when people talk about toolchain differences etc. Toolchain incompatibilities themselves are unusual, because the toolchain is, along with the kernel, one of the areas were developers are most careful about preserving backwards compatibility. As a result, a binary built in the past should continue running, as long as its binary dependencies continue to be available; that boils down to keeping the libraries it needs.
Where things break is with forwards compatibility: a binary built “in the future” can’t be guaranteed to run. This commonly shows up as missing symbols in the C library (which are detected precisely because the C library developers take great care to maintain compatibility). One might think that the C library doesn’t change much, so building a program with different C libraries shouldn’t change the symbols it needs, and it should remain compatible. That isn’t the case, and functions do change regularly in backwards-incompatible ways; the C library preserves backwards compatibility by continuing to provide versions of functions compatible with previous interfaces, with an appropriate version symbol. For example, version 2.33 of the GNU C library has incompatible changes to such common functions as the stat family (fstat/lstat/stat etc.); a program built with a default setup of 2.33, using those functions, will require version 2.33 of the C library to run.
Toolchain-related libraries, and the C library, are maintained in such a way that such incompatibilities show up as library symbol changes, or soname changes, and thus end up encoded in package dependencies (for packaged sofware) or are caught by the dynamic linker (for separate binaries).
In libraries which aren’t as carefully maintained as the C library, such incompatibilities don’t show up as immediately, they only show up if the faulty combination is tested (and even then, perhaps only in certain circumstances). Distribution developers usually only test packages in the context of the release being developed, so they won’t know that the package they built for Ubuntu 20.04 installs correctly on Debian 10 but kills your pet squirrel if you use it between 1am and 2am CEST on June 21.
This leads nicely to ...
Package incompatibility
Whether this is done consciously or not, packages are rarely built in a vacuum, they are part of a distribution release. This starts with the package source (and more generally, project source) itself: projects and packages are built on their developers’ systems, and unless great effort is put into it, might not accurately encode their dependencies.
This trickles down to binary package dependencies, and dependencies described in documentation. A project maintainer might not realise that their project in its current configuration only works because, say, systemd version 239 started setting the system up in a certain way. Package maintainers might not realise that either, if the release of the distribution they’re working on happens to already have version 239 of systemd (bear in mind that distribution maintainers usually live in the future, i.e. they develop in what will be the next release).
All this could be caught by testing, but once you start mixing and matching binaries from different distributions and releases, you’re likely to be the first person ever to test your exact combination of package and binary versions. And that is why this isn’t recommended: most users want to use their systems, not test them.
Of course, and this fits in with your experience, in many cases everything just works. This is also contributes to the bias you perceive: people tend not to write posts (or questions, in a Stack Exchange context) explaining how they installed package X from distro Y on their Z system, and it just worked. So most of the content you see in this domain is scenarios where things didn’t work, or ended up being complicated to set up, or broke something else; and people are understandably reluctant to spend time helping someone fix a probably one-off problem that they brought on themselves by doing something which was explicitly recommended against.
| What introduce package/binary incompatibility? |
1,405,814,980,000 |
Why does Linux support this:
umount /
Why would anyone write that, instead of this:
mount / -oremount,ro
I'm looking at the kernel code here:
if (&mnt->mnt == current->fs->root.mnt && !(flags & MNT_DETACH)) {
/*
* Special case for "unmounting" root ...
* we just try to remount it readonly.
*/
if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
return -EPERM;
down_write(&sb->s_umount);
if (!sb_rdonly(sb))
retval = do_remount_sb(sb, SB_RDONLY, NULL, 0);
https://elixir.bootlin.com/linux/v4.18/source/fs/namespace.c#L1612
|
Luciano Andress Martini points out:
First time I have a problem in a filesystem in linux I received a message by fsck like "/dev/hda2 is mounted read-write". In that epoch (1999), I did not understand what that means. I am 11 y.o. The only thing that come to my mind was: umount /, and it works (as it remounted read-only).
(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair a filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).
In other words, if you don't even know there is a command to remount a filesystem read-only, you can try the same commands as if you needed to fsck (repair) /dev/fd0 or your /home filesystem. The special case allows this to work, even though the fsck command is on the filesystem you apparently unmounted :-). It's nice that Linux can be helpful like this, when you try to repair a corrupted system.
There is one other use of this special case: umount -a, used in old shutdown scripts. This is defined to simply unmount all filesystems in reverse order, finishing with the root filesystem. It makes sure all filesystems are in a consistent state on the disk, so they do not require a fsck on the next boot. The Linux kernel does not shut down any filesystem automatically; you need to have some shutdown program or "init system" that does this.
I'm not certain why this special case is in the kernel, rather than in the umount command. One reason might be that old kernels accepted the name of the mounted device, instead of the directory the filesystem was mounted at. Perhaps this made it seem simpler or more reliable to put this code in the kernel.
The special case is not documented in the current man pages for umount(2) or umount(8). So the current man page implies that umount -a will always show an error, but this is not the case. I suspect that umount -a is not very widely used nowadays.
There is a very similar code comment in early versions of Linux including 0.99.10 (1993).
This does not seem to be a standard for traditional UNIX. The FreeBSD kernel returns an error instead. I'm not sure why there's a specific error check for this case, separate from the general error check for unmounting a filesystem that is currently in use. The FreeBSD equivalent of umount -a is aware of this issue, and stops before unmounting the first filesystem i.e. the root. (The code is here, but you need to understand how for loops and array indexes work in C :-).
The old scripts that rely on umount -a contrast with more recent scripts for SysVinit, which are still available in Debian for example. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.
umount -a is not ideal on modern systems. It is simpler to leave a /proc filesystem mounted so that /proc/mounts can still be used. /dev is also usually a separate mounted filesystem, which might be an issue.
For an example of an old shutdown script, see the reference script etc/rc.d/rc.0 in the old SysVinit-2.4.tar.z / SysVinit-2.4.tar.gz.
#! /bin/sh
#
# brc This file is executed by init(8) when the system is being
# shutdown (i.e. set to run at level 0). It usually takes
# care of un-mounting al unneeded file systems.
#
# Version: @(#)/etc/brc 2.01 02/17/93
#
# Authors: Miquel van Smoorenburg, <[email protected]>
# Fred N. van Kempen, <[email protected]>
#
PATH=/bin:/etc:/usr/bin
echo Unmounting file systems.....
umount -a
echo Done.
| Why does the Linux kernel support "umount /"? |
1,405,814,980,000 |
Apologies if this is a stoopid question.
With some effort I have managed to install openSUSE Leap 15.3 on my laptop. As you may know 15.3 is rather different to earlier releases in that it apparently "uses binaries from" SLE 15 SP3. Unfortunately, another difference appears to be that many packages which were there all the way up to 15.2 appear to be missing, I've seen the line There is no official package available for openSUSE Leap 15.3 (this example is llvm) way more often than I care.
So my question: Is it generally possible / safe to use SLE 15 SP3 repositories instead? (I see that one of the automatic update repositories is indeed SLE.) I daren't simply try for fear of damaging my system.
|
Do not mix packages from OpenSuse and Suse Enterprise, if it's not crucial. Adding repositories would mean to actually have the system licensed and being able to reach the SLE repos. I see there is a package for llvm for Leap 15.2, which should work on 15.3. Grab the binary package and install it.
| How close are Leap 15.3 and SLE 15 SP3? Can I use one's rpms with the other? |
1,632,089,077,000 |
I would like to run the following command:
tar --sort=name --owner=root:0 --group=root:0 --mtime='UTC 2020-01-01' -cvf api.tar api
But need the following fallback for macOS:
gtar --sort=name --owner=root:0 --group=root:0 --mtime='UTC 2020-01-01' -cvf api.tar api
(Note: the arguments are identical.)
Can I call gtar first, and then tar as a fallback, as a one-liner, writing the arguments only once?
|
Can I call gtar first, and then tar as a fallback, as a one-liner, writing the arguments only once?
To answer this as asked: this can be done as a simple implementation of storing the arguments in an array. (Bash/ksh/zsh. See How can we run a command stored in a variable? for the issues and the POSIX-compatible workaround.)
args=(--sort=name --owner=root:0 --group=root:0 --mtime='UTC 2020-01-01' -cvf api.tar api)
if ! tar "${args[@]}"; then
echo "using 'tar' failed, retrying with 'gtar'" >&1
gtar "${args[@]}"
fi
or a as a one-liner, if you insist:
tar "${args[@]}" || gtar "${args[@]}"
Though this doesn't tell why it failed, and would try to retry with the other tar even if the problem is something like a non-accessible directory.
Another alternative would be to only rerun the command if the first one errors with "command not found". The shells usually set $? to 127 in that case. Of course, this requires flipping gtar first, since tar probably exists, in some form.
gtar "${args[@]}"
ret=$?
if [ "$ret" = 127 ]; then
tar "${args[@]}"
ret=$?
fi
The test [ "$? = 127 ] trashes the value of $?, hence the extra variable to hold the actual exit status if needed.
In the specific case of the two tars, Kusalananda's answer about checking beforehand is also a good solution.
| Running a 2nd command as a fallback with the same arguments as the 1st command |
1,632,089,077,000 |
I personally work cross platform with Windows and Linux and sometimes I edit .sh files with Notepad++. It is hence problematic for me to keep all my files' tab indents as Unix-like so my solution was to use space-based indenting.
Yet, I encounter problem when indenting herdocs inside heredocs. For example, here is an external heredoc, holding an internal cat heredoc:
bash /dev/fd/10 10<<-'EOT'
Some command.
cat << EMW >> /etc/apache2/apache2.conf
EMW
Some other command.
EOT
As I recalled I ran this successfully with Unix-like tabbing in bash, but not with Windows-like tabbing as then the script broke and the same goes for using spaces.
My question:
My question can actually be comprised of these questions and I ask it not only for me but for other curious people to find this:
Why can't we use spaces for indenting commands and heredocs inside other heredocs?
If I'm wrong and there is a workaround to allow space indenting for commands and heredocs inside other heredocs, than what is it?
|
First of all, there is no such thing as a Unix-like tabulation or a Windows-like tabulation. A tabulation character is the same in Windows and Unix. What may change among text editors (not among OSes), is 1. what happens when you hit the TAB key or 2. how many spaces are displayed when the editor meets a tabulation character in the source code. A rule of thumb is to set indentation to whatever you like (in number of spaces) and to keep tabulation to 8, but this is another debate.
Now, back to your code. The problem is the EMW delimiter. With this syntax of yours, the EMW line can not be indented (be it with spaces or TABs), it must be at the beginning of a line. Else, it loses its heredoc delimiter status.
So, one solution could be:
bash /dev/fd/10 10<<'EOT'
Some command.
cat << EMW >> /etc/apache2/apache2.conf
....
....
EMW
Some other command.
EOT
Note also that the content of apache2.conf (symbolized above with ....) must not be indented, or it would be indented in apache2.conf too.
If you want to indent the whole bash code, use this syntax instead:
bash /dev/fd/10 10<<-'EOT'
Some command.
cat << EMW >> /etc/apache2/apache2.conf
....
....
EMW
Some other command.
EOT
Here, leading space used for indentation is composed of any number of the TAB character (TAB, not space!)
What did I change? I changed 10<<'EOT' to 10<<-'EOT'. This special syntax asks bash to discard any leading TAB character while parsing a heredoc. The EMW delimiter can then be indented, as well as the content of apache2.conf.
| Why must I use tabs instead of spaces in heredocs? [duplicate] |
1,632,089,077,000 |
Are there any drawbacks to having Cygwin and Windows share the same $HOME directory, in this case the Windows profile directory?
|
Merging them will work fine.
Cygwin proper doesn't store anything in your HOME directory. On first running Cygwin with a fresh home directory, default versions of .bash_profile and such get put there, but again, there is no conflict with things that already get put there.
I, too, find it frequently convenient to be able to use Cygwin on things that live under your Windows profile directory. However, I don't want the two to be the same[*], so I just make a symlink to it in my home directory. I'm never farther from my Windows profile directory than a cd ~/WinHome.
[*] So many programs feel privileged to throw random junk in the Windows profile directory that it would annoy me to see it every time I say ls in my home directory. I prefer to keep that mess at arm's length. I feel my home directory should be mine. I'm happy to let ~/WinHome be a midden.
| setting Cygwin's $HOME to Windows profile directory |
1,632,089,077,000 |
Consider the following Makefile:
X = macro-X-value
foo:
echo $$X $(X)
The intention here is to use X both as a name of an environment variable and
of a macro. When using bmake, it works as intended:
$ env X=env-X-value /usr/bin/bmake
echo $X macro-X-value
env-X-value macro-X-value
$ env -i /usr/bin/bmake
echo $X macro-X-value
macro-X-value
But when using GNU Make (v. 4.2.1), the behaviour gets weird:
$ env X=env-X-value /usr/bin/gmake
echo $X macro-X-value
macro-X-value macro-X-value
$ env -i /usr/bin/gmake
echo $X macro-X-value
macro-X-value
So, it seems like gmake exports the value of the macro X as an
environment variable X, but only when the outer environment already
exports X.
I can't find anything about this in the POSIX Make description. In fact, there is this bit there:
Macros are not exported to the environment of commands to be run. […]
Is this behaviour documented? Is this a bug? Can it be disabled?
|
Based on what I can read from the manual, it seems GNU make treats its variables a bit like the shell. When it starts, it imports variables from the environment to its internal set, and when running commands, exports to their environment the ones marked for export. Which implies it only has a single table for all variables, and no way to have environment variable and a non-environment variable of the same name.
6.10 Variables from the Environment:
Variables in make can come from the environment in which make is run. Every environment variable that make sees when it starts up is transformed into a make variable with the same name and value.
and 5.7.2 Communicating Variables to a Sub-make:
Except by explicit request, make exports a variable only if it is either defined in the environment initially or set on the command line [...] If you want to export specific variables to a sub-make, use the export directive, like this:
export variable …
If you want to prevent a variable from being exported, use the unexport directive, like this:
unexport variable …
As far as I tested, using unexport X just removes it from the environment of the launched process completely, with seemingly no way to keep a different value than the one the internal variable has.
Using the .POSIX built-in target didn't seem to change that behaviour either, but then, the opinion seems to be that no Make is too strict on POSIX behaviour anyway.
| GNU Make exports macro as environment variable only when it's already present |
1,632,089,077,000 |
When expanding the /etc/passwd GECOS field to get the user's full name, should we expand only the first ampersand (& character), or all ampersands?
In a GECOS field with comma (,) delimited subfields, should ampersands only be expanded in the first subfield (i.e. the user's full name) or in all subfields?
If the Unix username contains capital letters, should we preserve them in the & expansion, or should we only capitalize the first letter of the username and lowercase the rest?
|
Ampersands should only be expanded in the first comma-delimited subfield (i.e. the so-called "full name" or "real name" subfield). If there are no commas in the GECOS field, treat the entire field as the real name.
Any and all ampersands are expanded, not only the first one.
If the first character of the username is an ASCII lowercase letter, that letter is uppercased in the ampersand expansion. Otherwise it is left intact. No case conversion is done to characters other than the first one.
The de facto authoritative sources for this information are sendmail server and finger client implementations. Implementations for BSDs and Solaris are open source, and all of them would seem to agree on the above rules.
The GECOS field is no longer an up-to-date name for this field. It would more accurately be called the finger field since on almost all systems the expected layout of the comma-separated subfields comes from finger.
| Ampersand in the passwd GECOS field |
1,632,089,077,000 |
If I install Linux on a USB stick using computer A, then plug it into computer B with different hardware and try to boot and work on it, should I generally expect it to work? Or should I rather accept that Linux, when installed (as opposed to using Live CD/USB), gets tied to the hardware and is generally not supposed to work seamlessly on different hardware?
If the answer is "it depends", let's narrow the question:
All hardware is x86. Nothing fancily customized, just stock laptops/desktops currently available on the market;
Distros: latest OpenSUSE, Ubuntu or Cubes OS with default settings;
No fancy software, just web/office etc.
The background behind this question is that I am deciding whether to have separate USB stick Linux installations for each computer I have, or just clone the same one.
|
I've done it; when I got a new laptop about 2 years ago I just pulled out my old hard drive and put it into the new one. A couple months ago I upgraded the OS (Debian stable) and things are still working fine. The only thing I noticed is that instead of eth0 and wlan0 I have eth1 and wlan1.
Generally, Linux installations include lots of drivers you don't need for your hardware, so if you add or change any hardware in the future, the new hardware will "just work." If you stray from common distros or start customizing them by blacklisting hardware you don't have or removing drivers or modules from the hard drive, you might have problems, but most likely your biggest issue will just be finding a network card that your distro doesn't have good support for.
If you have separate sticks, they might feel "cleaner" (as you install software you don't end up using, etc., then switch to a "new" stick) over time, but cloning will probably remove some maintenance headaches like different passwords, different software versions, etc.
| How tied are Linux installations to hardware? [duplicate] |
1,632,089,077,000 |
Based on this link the Hyper-V 2019 is compatible with Debian 10.0 up to Debian 10.3.
Is this a strict case or can I use 10.5 or even 10.7 without any problems?
|
10.x releases are backwards-compatible with previous 10.x releases, and the kernel is still based on the same stable branch, so you shouldn’t have any problem running the latest 10.x point-release on Hyper-V 2019.
| Debian 10 Hyper V compatibility |
1,632,089,077,000 |
I have made a package in Arch Linux by using the PKGBUILD and makepkg method. So the file is a .pkg.tar.xz format. My goal is to be able to somehow convert this package to a format compatible with other Linux flavors (such as centOS) so I can install it on them as well. Is there a good way to do this? Or is there another method that any of you suggest?
|
There is no clear way to "convert" Arch Linux packages into CentOS packages. The best thing you can do is to follow this ArchWiki guide on how to create packages to other distributions from inside Arch.
Depending on what distribution it is, the technique will change like using virtualization or chroot. If you take a look at the wiki you will see that on specific Fedora/CentOS cases, it involves installing rpm-org from AUR and create a chroot environment to put all needed packages inside.
But, there is no way to directly convert PKGBUILD into rpm
| How do I convert a package made in Arch Linux by using PKGBUILD and makepkg into a package that can be used by other Linux flavors such as centOS? |
1,632,089,077,000 |
I understand that Linux does not support .exe's, but is adding Linux support as simple as providing a .jar version? This summer I'm going to try to really start programming and contributing to... well anything I can. I think Linux is the future. So what makes or breaks compatibility? What do I need to change about my Java/Python programs to make them compatible?
|
Since you are using languages, which leverage bytecode for platform independece, you have nothing special to do, to run e.g. Java or Python. As long as the runtimes are supported by linux - which is the case for the mentioned languages - you have nothing to do.
The only thing which differs under linux is the way how you actually run (e.g. start) the software. It is common to write start(shell-)scripts.
| What makes a program Linux compatible/incompatible? |
1,632,089,077,000 |
Each new release of openZFS has a range of supported linux kernel versions (for example openZFS v2.1.9 supports kernels versions between 3.10 and 6.1)
But when I run zfs version I get:
root@pve:~# zfs version
zfs-2.1.9-pve1
zfs-kmod-2.1.6-pve1
PVE it's because I'm running proxmox virtual environment distribution, but at the end of the day it's debian (11) with some virtualization glitter on top.
So my question is, what linux kernel versions can I install? Because zfs version returns two different versions that have different linux support. For example, zfs 2.1.6 only supports up to linux 5.19. So, what's the important version, zfs or zfs-kmod?
EDIT: Also, should those two versions, zfs and zfs-kmod, be the same?
|
I have found out.
As zfs-kmod it's a kernel module, it gets embedded into the kernel package. So it's the maintainer of the kernel package who should place a compatible version of the zfs-kmod in their kernel package (if they want to support zfs).
To check the zfs-kmod version of installed kernels without having to boot from them I have used strings /usr/lib/modules/*/zfs/zfs.ko | grep -e ^version= -e vermagic= | grep -v % that returns the kernel versions and their associated zfs kernel module version. In my case:
version=2.1.9-pve1
vermagic=5.15.102-1-pve SMP mod_unload modversions
version=2.1.6-pve1
vermagic=5.15.74-1-pve SMP mod_unload modversions
version=2.1.9-pve1
vermagic=5.15.85-1-pve SMP mod_unload modversions
version=2.1.6-pve1
vermagic=5.19.17-1-pve SMP preempt mod_unload modversions
version=2.1.9-pve1
vermagic=6.1.15-1-pve SMP preempt mod_unload modversions
| OpenZFS and Linux Kernel versions compatibility question |
1,632,089,077,000 |
I can't seem to find anything about getting WINE to use an actual MS-Windows install, instead of emulating a Windows directory system on Gnu/Linux. Is that even a good idea?
I have two SSDs: one with Arch Linux, the other with Microsoft's Windows 10. All the dependencies for the MS-Windows programs are there, since each storage drive is standalone. Can I get Wine to run programs natively from MS-Windows, and just use my Gnu/Linux install as a display server?
|
I don't recommend Wine. But to answer you question. Yes mount the MS-Windows partition, then it will look like a regular directory. Point Wine at this directory. There may be problems caused by Gnu/Linux writing to this partition. So mount it read-only.
If you need to write to it (but not so MS-Windows can see), then use a union-file-system, to layer a write layer on top.
A better solution
If you want to keep MS-Windows, then put it in virtual-box.
| Run MS-Windows programs directly from MS-Windows drive, on Linux |
1,632,089,077,000 |
Suppose I'm writing a CMakeLists.txt file for a project of mine. I would like to use some newer CMake features... but I don't want to end up requiring a CMake version that's not present in many users' distributions.
So, my questions are:
What is the latest CMake version which is no later than the default version included with the current version of the GNU/Linux distributions whose share of the user base exceeds 90%, as of July 2019?
What is the latest CMake version which is no later than the default version included with the Linux distributions (that is, including older distros) installed on at least 90% of GNU/Linux users, as of July 2019?
Also - same question for all Un*x OSes and distributions, if you have data about that.
|
pkgs.org tells me that the available versions of CMake in the Linux distributions it knows about are as follows:
Arch Linux: 3.15.2
CentOS: 2.8.12.2 (CentOS 7 and 6)
Debian: 3.13.4 (Debian 10), 3.7.2 (Debian 9), 3.0.2 (Debian 8)
Fedora: 3.14.5 (Fedora 30 and 29)
Mageia: 3.14.3 (Mageia 7), 3.10.2 (Mageia 6)
OpenMandriva: 3.14.5 (OpenMandriva 4.0), 3.11.4 (OpenMandriva 3.0)
openSUSE Leap: 3.10.2 (this is the release-based distribution version of openSUSE)
openSUSE Tumbleweed: 3.13.4 (this is the rolling release of openSUSE)
Slackware: 3.5.2 (Slackware 14.2), 2.8.12 (Slackware 14.1), 2.8.8 (Slackware 14.0)
Ubuntu: 3.13.4 (Ubuntu 19.04), 3.10.2 (Ubuntu 18.04), 3.5.1 (Ubuntu 16.04), 2.8.12/3.5.1 (Ubuntu 14.04; 3.5.1 is available as the cmake3 package)
In addition to the above, RHEL 8 has 3.11.4; previous versions of RHEL carry the same version as CentOS (as you’d expect). EPEL carries a cmake3 package providing version 3.13.5 for CentOS and RHEL 7, and version 3.6.1 for CentOS and RHEL 6.
For non-Linux distributions:
FreeBSD: 3.14.5
NetBSD: 3.14.5
OpenBSD: 3.15.2
macOS (via Homebrew): 3.15.2
The versions above are the latest version available in each release of the given distribution, not necessarily the default version — I expect most users to be comfortable enough keeping their distribution up to date within a given release.
I don’t know what’s needed to cover 90% of the installed base. If you stick to the latest version of all distributions above, then 3.5.2 covers everything apart from CentOS, and 3.10.2 covers everything apart from CentOS and Slackware. The CentOS situation should be temporary anyway, since CentOS 8 is forthcoming, and can be worked around by using EPEL. If you want to include releases which are still in wide use, then you’re down to 2.8.12.2 since CentOS and RHEL have a large installed base (but again, see EPEL), or 3.5.1 if you want to ignore that but still include popular releases of Debian and Ubuntu.
I suspect the most popular distribution on the desktop is Ubuntu, followed perhaps by Fedora (ignoring macOS and ChromeOS); on servers, RHEL, CentOS and other RHEL derivatives, Debian, Ubuntu, and proprietary distributions used by server hosts, in some order. But it’s impossible to get reliable data. (Distrowatch’s popularity figures reflect the popularity of Distrowatch’s pages on each distribution, not the usage of each distribution).
| What CMake version can I rely on in current popular Linux distributions? [closed] |
1,632,089,077,000 |
yum groupinstall "Compatibility Libraries"
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Warning: Group compat-libraries does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
yum groupinstall "Compatibility Libraries" --setopt=group_package_types=mandatory,default,optional
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Warning: Group compat-libraries does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
uname -a
Linux 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
trying to install intel parallel studio, it complains this product requires the presence of 32-bit compatibility libraries when running on Intel(R) 64 architecture systems... libstdc++ (including libstdc++6); without these libraries the compiler will not function properly.
What is the proper solution to making sure 32-bit everything is available, on an already running RHEL/CentOS 7 system, so I don't have to deal with this nonsense?
the following did NOT help
I have done
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install compat-libstdc++
yum install compat-libstdc++-33
yum install compat-gcc-44
yum install compat-gcc-44-c++
yum install compat-gcc-44-gfortran
|
Intel Parallel Studio needs the 32-bit libraries.
yum install libgcc*i686 libstdc++*i686 glibc*i686 libgfortran*i686
| 32-bit libraries GCC for RHEL/CentOS 7 |
1,632,089,077,000 |
I wrote C that displays info about my hardware on ubuntu. Now I wonder how I can make it more flexible such as querying the hardware directly instead of the file the os updates. So I think I can look what write to /proc/scsi/scsi and do the same so that this code can work also on unices who could have other method than a /proc/scsi/scsi and so that I can learn how to display hardware information.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch, file_name[25] = "/proc/scsi/scsi";
FILE *fp;
fp = fopen(file_name,"r"); // read mode
if( fp == NULL )
{
perror("Error while opening the file.\n");
exit(EXIT_FAILURE);
}
printf("The contents of %s file are :\n", file_name);
while( ( ch = fgetc(fp) ) != EOF )
printf("%c",ch);
fclose(fp);
return 0;
}
For me it looked like this
$ cc driveinfo.c;./a.out
The contents of /proc/scsi/scsi file are :
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: WDC WD2500JS-75N Rev: 10.0
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: ST3250824AS Rev: 3.AD
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: TSSTcorp Model: DVD+-RW TS-H653A Rev: D300
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: Optiarc Model: DVD-ROM DDU1681S Rev: 102A
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: Lexar Model: USB Flash Drive Rev: 1100
Type: Direct-Access ANSI SCSI revision: 00
Host: scsi5 Channel: 00 Id: 00 Lun: 00
Vendor: WD Model: 5000AAKB Externa Rev: l108
Type: Direct-Access ANSI SCSI revision: 00
Can it run on other unices e.g. bsd? How can I make it run on ms-windows? Can I query the hardware directly instead of the file /proc/scsi/scsi ?
|
The /proc filesystem is not real, it is a view into kernel-internal data, exported to look like files. It exists in Linux and in Solaris (from where the idea was shamelessly pilfered), and maybe other Unixy systems. The format is very system-dependent (and has even changed substantially among Linux kernel versions).
There really isn't any halfway portable way of finding out hardware data (and can't be, some Unices and lookalikes run on pretty strange iron).
| Which process updates /proc/scsi/scsi? |
1,632,089,077,000 |
For instance, say hypothetically (or in reality) one was using and needed to continue using Debian Jessie, but wanted to utilize PHP7 from Debian Stretch. They might edit /etc/apt/sources.list to use Stretch and install the new software and then revert /etc/apt/sources.list back to Jessie. But would they also need to do the same for nginx or other packages? If so, how would they know? And would they wish to perform an apt-get update during the time they were configured to use Stretch?
|
Here’s what to look out for when mixing stable releases: don’t.
What’s more, adding a different release to sources.list temporarily is a really bad idea, because you won’t get any updates to the packages you pull in from that different release. If you really do want to go down this route, set up pinning properly and enable the new release permanently.
However, I’ll say it again: don’t do this. If you want PHP 7 from Debian 9, upgrade to Debian 9, or request a proper backport to Debian 8 (and accept that the answer might well be “no”).
Regarding your specific questions, if other packages need to be upgraded, apt & co. will tell you. You need to run apt update after changing sources.list for the changes to take effect; if you’re referring to apt upgrade, if you run that with Debian 9 in your repositories and no pinning, you’ll upgrade to Debian 9 as far as possible without deleting packages (you’d need dist-upgrade for a full upgrade).
| What to look for when mixing software in different releases of a distribution? |
1,632,089,077,000 |
I've been tracking the upstream Linux firmware repo in /lib/firmware on a couple of machines, doing very periodic updates of that tree.
I think I saw a firmware loading error booting an older kernel on the machine where I did a git-pull last week.
Does that repository have a policy about backwards compatibility with older kernels, or is that a non-issue (e.g.) because all the kernel does is load a binary file onto the target device using a standard interface that probably hasn't changed since a long time?
|
You can find the policy/guideline in the kernel source code package as Documentation/driver-api/firmware/firmware-usage-guidelines.rst, or here:
https://docs.kernel.org/driver-api/firmware/firmware-usage-guidelines.html
Firmware Guidelines
Users switching to a newer kernel should not have to install newer firmware files to keep their hardware working. At the same time updated firmware files must not cause any regressions for users of older kernel releases.
Drivers that use firmware from linux-firmware should follow the rules in this guide. (Where there is limited control of the firmware, i.e. company doesn't support Linux, firmwares sourced from misc places, then of course these rules will not apply strictly.)
It then goes on with some details with how to handle the versioning of firmware in various common situations.
| tracking linux-firmware.git and backwards kernel compatibility |
1,632,089,077,000 |
I switched recently to Artix Linux with OpenRC as Init-system. I was using Manjaro before, which uses Systemd. Anyway, I was trying to install some packages I used on Manjaro that I have gotten from the snap-store. But I couldn't install it because of some systemd dependency.
I think was trying to onlyOffice and other stuff.
|
Titular Question
While this is indeed too vague for the specific answer the body of your question is seeming to ask, there is a specific answer to the question being asked in the title.
Packages depending on systemd and requiring such are going to contain service files placed where systemd expects them and uses these files to do things like run daemons, which is the typical means you may (or may not) have interacted with the init system of your specific distro. OpenRC being a different init system that approaches the running of daemons differently, among other differences, is not going to know where systemd init files would be, nor would it know what to do with them as they expect files to conform to different syntax.
Systemd also brings with it a number of other functionalities and features that other init systems avoid, for better or worse. Therefore the answer to your titular question is that packages targeting or one the other generally are written such that they expect a specific environment which is not necessarily the environment another init system is going to provide.
You Definitely Don't Need Snapd
Snapd is a package manager written to be useful across distributions, which is not necessarily a necessary function for the installation of whatever package you intended to install. Because it requires systemd, for what I do not know nor care to investigate, it is outside of the potential candidates for tools to install whatever package you intended to install with it.
Instead you might try the similar, not systemd-specific, flatpak.
It is about the same thing, though it's claimed to be safer and is just as hungry for space on your system as it too installs all the dependencies it needs in a sandboxed environment. OnlyOffice is definitely available via the flathub,
which also describes the installation process and setting ups its repos, etc.
You can also use pacman -Ss [whatever] to check Artix's repository for the package (it just might be there).
On Artix's wiki there are instructions for enabling additional repositories, including some of Arch's, which may provide you with what you need already.
Being based on Arch and using pacman means you can also use the AUR to access the packages in question. You will need to install an AUR helper such as yay or paru, then you can use the AUR helper in a manner similar to pacman to install whatever you want from the AUR.
Or you can find the git repository associated with the project (probably exists) and follow the instructions of its readme.md to build it from the source. Moving into the more niche and specific Linux distributions such as Artix, you should probably become comfortable with this process as it becomes more necessary the deeper into the rabbit hole you go where smaller teams are unable to keep huge repositories maintained for free and without even much in the way of thanks let alone help.
Generally this will amount to a git clone [repo url]
followed by a make in the directory and another sudo make install,
which is not all that daunting
when you have the things you need, like gcc and make, already installed.
| What breaks package compatibility between OpenRC and Systemd |
1,632,089,077,000 |
I'm trying to use auCDtect to check the authenticity of my audio files. I can run the linux binary successfully on my Synology NAS (DS918+) with the addition of libstdc++-libc6.2-2.so.3. I wanted to do this faster on my macbook pro laptop. I repeated the same step in Debian GNU Linux 9 (in Parallels Desktop), which resulted in this error:
Fatal error: glibc detected an invalid stdio handle
fish: 'aucdtect' terminated by signal SIGABRT (Abort)
gdb:
(gdb) run
Starting program: /usr/local/bin/aucdtect
Fatal error: glibc detected an invalid stdio handle
Program received signal SIGABRT, Aborted.
0xf7fd7c89 in __kernel_vsyscall ()
(gdb) bt
#0 0xf7fd7c89 in __kernel_vsyscall ()
#1 0xf7d8fdf0 in raise () from /lib32/libc.so.6
#2 0xf7d912b7 in abort () from /lib32/libc.so.6
#3 0xf7dcb3af in ?? () from /lib32/libc.so.6
#4 0xf7dcb3ec in __libc_fatal () from /lib32/libc.so.6
#5 0xf7dcbd73 in ?? () from /lib32/libc.so.6
#6 0xf7da641b in vfprintf () from /lib32/libc.so.6
#7 0xf7dad7c8 in fprintf () from /lib32/libc.so.6
#8 0x080492d4 in ?? ()
#9 0xf7d7c286 in __libc_start_main () from /lib32/libc.so.6
#10 0x080489b1 in ?? ()
(gdb)
#0 0xf7fd7c89 in __kernel_vsyscall ()
#1 0xf7d8fdf0 in raise () from /lib32/libc.so.6
#2 0xf7d912b7 in abort () from /lib32/libc.so.6
#3 0xf7dcb3af in ?? () from /lib32/libc.so.6
#4 0xf7dcb3ec in __libc_fatal () from /lib32/libc.so.6
#5 0xf7dcbd73 in ?? () from /lib32/libc.so.6
#6 0xf7da641b in vfprintf () from /lib32/libc.so.6
#7 0xf7dad7c8 in fprintf () from /lib32/libc.so.6
#8 0x080492d4 in ?? ()
#9 0xf7d7c286 in __libc_start_main () from /lib32/libc.so.6
#10 0x080489b1 in ?? ()
I guess this is probably because the program is too old (2004) and isn't compatible with the newer libraries. How can I figure out which library caused the problem (probably libc?), and which old version should I get?
|
I've been using auCDtect under wine for as long as I remember myself:
wine ~/bin/auCDtect.exe -v -mS0 '*.wav'
You could also consider https://github.com/alexkay/spek which shows waveforms in a visual form. You can instantly see if the audio file has been processed by a bad encoder though good encoders e.g. Apple AAC even at 256Kbit/sec are often near impossible to detect this way but then auCDtect shows them as CDDA as well.
To see which shared libraries it uses you could run it via ldd /path/to/binary. It will not give you an understanding which versions of the libraries it needs.
| auCDtect: Fatal error: glibc detected an invalid stdio handle |
1,632,089,077,000 |
Is there anything OS-dependent about gcc that would cause a meaningful change between the two versions? Are the two versions even different? Just want to make sure, because I test my code on onlinegdb but paranoidly compile and check it on my school's CentOS server before I submit. I'm wondering if this necessary.
|
Agree with @fox, but additionally there are platform dependent behaviour, and undefined behaviour (GCC tried to define these where it can). These may differ by platform OS and hardware. However Gcc will try to keep things consistent (where it can).
An example of differences, will be the size of the long int and size_t data types may be 32 bit or 64 bit. (on other compilers them may also be 8 bit or 16 bit).
| Will gcc on onlinegdb always agree with gcc on CentOS 7? |
1,494,635,506,000 |
Say I want something like the following in my .conkyrc
NAME PID CPU% MEM%
${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
Do I have to align the columns manually by adding space, or is there a way to tell conky to align things in columns. With fewer columns, I could just use $alignc and $alignr but I can't do that here...
|
As long as you stick to left-aligned columns or a non-proportional font, ${goto N} works.
NAME${goto 100}PID${goto 200} CPU%${goto 300}MEM%
${top name 1}${goto 100}${top pid 1}${goto 200}${top cpu 1}${goto 300}${top mem 1}
For right alignment, you can try playing with alignr and offset.
| conky: proper column alignment |
1,494,635,506,000 |
It's long time I'm trying to fix my .conkyrc configuration file in order to set real transparency.
There are many post out there about it, but none of them helped in my case, it seems the solution depends on many factors(windows manager, desktop environment, conky version and probably others).
Actually it seems that my environment support real transparency since it works for my terminal(see Screenshot), but conky is using fake transparency(files on Desktop are covered/overridden)
As you can see, I use Metacity as window manager, Mate as desktop environment. I installed conky 1.9 :
conky -version
Conky 1.9.0 compiled Wed Feb 19 18:44:57 UTC 2014 for Linux 3.2.0-37-generic (x86_64)
And my distro is Mint 17.2 Rafaela:
lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 17.2 Rafaela
Release: 17.2
Codename: rafaela
My .conkyrc actually is as following:
background yes
use_xft yes
xftfont Roboto:size=9
xftalpha 0.8
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
##############################################
# Compositing tips:
# Conky can play strangely when used with
# different compositors. I have found the
# following to work well, but your mileage
# may vary. Comment/uncomment to suit.
##############################################
## no compositor
#own_window_type conky
#own_window_argb_visual no
## xcompmgr
#own_window_type conky
#own_window_argb_visual yes
## cairo-compmgr
own_window_type desktop
own_window_argb_visual no
##############################################
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
stippled_borders 0
#border_margin 5 #commento non è supportato
border_width 1
default_color EDEBEB
default_shade_color 000000
default_outline_color 000000
alignment top_right
minimum_size 600 600
maximum_width 900
gap_x 835
gap_y 77
alignment top_right
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
short_units yes
text_buffer_size 2048
use_spacer none
override_utf8_locale yes
color1 212021
color2 E8E1E6
color3 E82A2A
own_window_argb_value 0
own_window_colour 000000
TEXT
${goto 245}${voffset 25}${font GeosansLight:size=25} Today
${goto 124}${voffset -}${font GeosansLight:light:size=70}${time %I:%M}${image .conky/line.png -p 350,27 -s 3x189}
${offset 150}${voffset -55}${font GeosansLight:size=17}${time %A, %d %B}
${offset 380}${voffset -177}${font GeosansLight:size=25}Systems${font GeosansLight:size=22}
${offset 400}${voffset 5}${font GeosansLight:size=15}$acpitemp'C
${offset 400}${voffset 10}${cpu cpu0}% / 100%
${offset 400}${voffset 4}$memfree / $memmax${font GeosansLight:size=15}
${offset 400}${voffset 5}${if_up wlan0}${upspeed wlan0} kb/s / ${totalup wlan0}${endif}${if_up eth0}${upspeed eth0} kb/s / ${totalup eth0}${endif}${if_up ppp0}${upspeed ppp0} kb/s / ${totalup ppp0}${endif}
${offset 400}${voffset 5}${if_up wlan0}${downspeed wlan0} kb/s / ${totaldown wlan0}${endif}${if_up eth0}${downspeed eth0} kb/s / ${totaldown eth0}${endif}${if_up ppp0}${downspeed ppp0} kb/s / ${totaldown ppp0}${endif}
${goto 373}${voffset -162}${font Dingytwo:size=17}M$font
${goto 373}${voffset 7}${font Dingytwo:size=17}7$font
${goto 373}${voffset 1}${font Dingytwo:size=17}O$font
${goto 373}${voffset 1}${font Dingytwo:size=17}5$font
${goto 373}${voffset 1}${font Dingytwo:size=17}4$font
I've tried many values for the own_window_type param, but none fixed the issue. Does somebody know how to achieve this, or what are the others environment factors that affect how the .conkyrc param must be set ?
|
-You just define:
own_window yes
own_window_transparent yes
own_window_type conky
own_window_argb_visual yes
own_window_class override
...and you can get the transparency on the desktop.
| .conkyrc - how to set real transparency |
1,494,635,506,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 dzen2 and conky? Is there an easier or more documented approach I could try?
I currently use Openbox, but like to switch WM's once in a while, so WM-agnostic advice would be greatly appreciated.
|
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 time (depending upon how resource intensive you are prepared to accept it being).
If you wanted to tailor something specific to your setup, you could also use simple scripting and dzen.
You could also combine the two and pipe conky to dzen for your status bar; which also means that you can display icons in the bar, if that is what you are after.
There is a long conky thread on the Arch boards that has a myriad of different configurations and approaches to provide some inspiration.
For simple notifications, you could combine dzen and inotifywait (from the inotify-tools package) to achieve this. For example, I use this script to notify me when my nick is highlighted in IRC:
#!/bin/bash
dir="$HOME/Dropbox/Centurion/irssi/"
while inotifywait -qqre attrib "$dir" >/dev/null 2>&1; do
echo "IRC:" "You have been pinged..." | dzen2 -p 5
done
| How do I pipe notifications into my statusbar? |
1,494,635,506,000 |
Is there any way to change the height of a conky window?
.conkyrc
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
#imlib_cache_size 0
# Window specifications #
own_window_class Conky
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
border_inner_margin 0
border_outer_margin 0
minimum_size 200 200
maximum_width 200
alignment tr
gap_x 0
gap_y 25
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftfont Ubuntu:size=8
xftalpha 0.5
uppercase no
temperature_unit celsius
default_color FFFFFF
# Lua Load #
lua_load ~/.conky/draw_bg.lua
lua_draw_hook_pre draw_bg
lua_load ~/.conky/clock_rings.lua
lua_draw_hook_post clock_rings
TEXT
${voffset 8}${goto 25}${color FFFFFF}${font Ubuntu:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %e}${font}
${color FFFFFF}${goto 25}${voffset -30}${color FFFFFF}${font Ubuntu:size=18}${time %b}${goto 75}${font Ubuntu:size=20}${time %Y}${font}${color 0B8904}
${voffset 150}${font Ubuntu:size=10}${font}
${font Ubuntu:size=12}${color FFFFFF}${alignr}${font}
${voffset -20}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %H}${font}
${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %M}${font}
${voffset -95}
${color FFFFFF}${goto 23}${voffset 48}${cpu cpu0}%
${color 0B8904}${goto 23}CPU
${color FFFFFF}${goto 48}${voffset 23}${memperc}%
${color 0B8904}${goto 48}RAM
${color FFFFFF}${goto 73}${voffset 23}${swapperc}%
${color 0B8904}${goto 73}Swap
${color FFFFFF}${goto 98}${voffset 23}${fs_used_perc /}%
${color 0B8904}${goto 98}Disk
${color FFFFFF}${voffset 25}${alignr 62}${downspeed eth1}${goto 135}D
${color FFFFFF}${alignr 62}${upspeed eth1}${goto 135}U
${color 0B8904}${goto 123}Net
${color FFFFFF}${font Ubuntu:size=8}${goto 55}Uptime: ${goto 100}${uptime_short}
${color FFFFFF}${font Ubuntu:size=8}${goto 42}Processes: ${goto 100}${processes}
${color FFFFFF}${font Ubuntu:size=8}${goto 50}Running: ${goto 100}${running_processes}}
draw_bg lua script
-- Change these settings to affect your background.
-- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
corner_r=0
-- Set the colour and transparency (alpha) of your background.
bg_colour=0x000000
bg_alpha=.8
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
cairo_fill(cr)
end
Screenshot of setup
Question
I want to increase the background(drawn by the lua script using conky_window.height) to occupy the entire screen height.
Tried
Changing minimum_size has no effect
Adding lines at the botto has no effect, see https://i.sstatic.net/1aP3O.jpg
Fix
Turns out that conky_window.height used by the lua script is preserved between conky restarts. Logging out and back in resolves this issue. Changing minimum_size works.
|
Just add ${voffset 200} at the end of the .conckyrc file and play with the value.
| Increasing conky height |
1,494,635,506,000 |
I've got a strange issue with my Conky setup:
What I'm looking to get rid of/fix is the fact that my CPU percentages (using ${cpu cpuX}) won't seem to pad properly. I'd like all values to be aligned vertically so that statuses never wiggle. Here's excerpts from my conky file:
# ...
pad_percents 3
# ...
${cpubar cpu1 6,135}$alignr${...}${cpu cpu1}%
How can I right align and pad CPU percentage values so they stop throwing off my layout? The equivalent printf would be %3.0f so that values will appear like this:
$ "%3.0f" % (1,)
' 1'
$ "%3.0f" % (13,)
' 13'
$ "%3.0f" % (100,)
'100'
How can I make this happen in Conky for my CPU percentage?
|
A solution provided by @jasonwryan above:
Create a Lua script for Conky to use. I created mine in a folder I made in ~/.config/conky/scripts, but you can create yours wherever you'd like:
$ mkdir -p ~/.config/conky/scripts/
$ vim ~/.config/conky/scripts/conky_lua_scripts.lua
Fill the file with the following Lua function:
function conky_format( format, number )
return string.format( format, conky_parse( number ) )
end
Import your Lua script file into your Conky configuration file using the lua_load directive
# ...
lua_load ~/.config/conky/scripts/conky_lua_scripts.lua
TEXT
# ...
Whenever you'd like to format a value, call the format function we defined earlier. Note that though we named it conky_format, we access it as format using the lua_parse variable:
# ...
lua_load ~/.config/conky/scripts/conky_lua_scripts.lua
TEXT
# ...
${lua_parse format %3.0f ${cpu cpu1}}%
This nice script allows you to call into Lua formatting engine with any value and format string. The output now looks as expected:
If you're familiar with printf, you can use the utility to do other awesome formatting hacks.
| Creating Conky text variables with zero padding? |
1,494,635,506,000 |
My idea is to use a minimized conky window on the desktop to show basically CPU and memory data all the time. Is this possible with Conky?
|
Yes, that's possible.
In the old times, I run xfwm4 with a fixed margin left on top side, now I just set the window type to panel in conky, the screen margin is no longer required.
| Can conky float over maximized windows? |
1,494,635,506,000 |
I've created a pretty awesome layout in Conky for my desktop machine.
I'm unfortunately having a hard time trying to add padding to the text on the right to separate the right side of the text from the right border.
Here's my configuration:
background yes
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 0.5
total_run_times 0
own_window yes
own_window_type panel
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 270 1080
#maximum_width 450
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color black
alignment top_left
gap_x 0
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
use_spacer left
override_utf8_locale yes
lua_load ~/.config/conky/scripts/conky_lua_scripts.lua
TEXT
${image .conky/mightymoose-sidebar-background.png}${image .conky/mightymoose-logo.png -p 10,10 -s 255x100}${voffset 110}
${offset 10}${font Monospace:bold:size=8}PROCESSORS ${hr 2}
${font Monospace:size=8}${cpugraph cpu0 30,255 333333 FFFFFF}
${offset 10}${cpubar cpu1 6,135}$alignr ${execi 1 get-i7z-value freq -c 0} ${execi 1 get-i7z-value temp -c 0} ${lua_parse format %3.0f ${cpu cpu1}}%
${offset 10}${cpubar cpu2 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu2}}%
${offset 10}${voffset -5}${hr 0.1}
${offset 10}${cpubar cpu3 6,135}$alignr ${execi 1 get-i7z-value freq -c 1} ${execi 1 get-i7z-value temp -c 1} ${lua_parse format %3.0f ${cpu cpu3}}%
${offset 10}${cpubar cpu4 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu4}}%
${offset 10}${voffset -5}${hr 0.1}
${offset 10}${cpubar cpu5 6,135}$alignr ${execi 1 get-i7z-value freq -c 2} ${execi 1 get-i7z-value temp -c 2} ${lua_parse format %3.0f ${cpu cpu5}}%
${offset 10}${cpubar cpu6 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu6}}%
${offset 10}${voffset -5}${hr 0.1}
${offset 10}${cpubar cpu7 6,135}$alignr ${execi 1 get-i7z-value freq -c 3} ${execi 1get-i7z-value temp -c 3} ${lua_parse format %3.0f ${cpu cpu7}}%
${offset 10}${cpubar cpu8 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu8}}%
${offset 10}${font Monospace:bold:size=8}MEMORY ${hr 2}
${offset 10}${font Monospace:size=8}${membar}
${offset 10}$alignc${mem} of ${memmax}: ${lua_parse format %3.0f $memperc}%
${offset 10}${font Monospace:bold:size=8}GPU ${hr 2}
${offset 10}${font Monospace:size=8}Temperature:$alignr${nvidia temp}°C
${offset 10}GPU Frequency:$alignr${nvidia gpufreq} MHz
${offset 10}Memory Frequency:$alignr${nvidia memfreq} MHz
${offset 10}${font Monospace:bold:size=8}NETWORK ${hr 2}
${offset 10}${font Monospace:size=8}eth0: ${addr eth0}$alignr${font :size=8}↑${font Monospace:size=6}${upspeedf eth0}${font :size=8}↓${font Monospace:size=6}${downspeedf eth0}${font :size=8}
${offset 10}${font Monospace:size=8}wlan0: ${addr eth2}$alignr${font :size=8}↑${font Monospace:size=6}${upspeedf eth2}${font :size=8}↓${font Monospace:size=6}${downspeedf eth2}${font :size=8}
${offset 10}${font :size=20}↓${downspeedgraph eth2 25,105 333333 FFFFFF -l}↑${upspeedgraph eth2 25,105 333333 FFFFFF -l}
It seems pretty silly to have to specify an offset on each line to move everything to the right 10px, but if it's the only solution, that's okay.
The main goal here is to add 10px of spacing to the right side to pull the text away from the right border. Is there a way to do this?
|
Conky has an absurdly comprehensive array of settings for displaying your system information.
The two that would be of most interest in this case are:
border_inner_margin
border_outer_margin
In the situation that you have described, I would suggest the former:
Inner border margin in pixels (the margin between the border and text).
| Adding spacing around text in Conky? |
1,494,635,506,000 |
When my laptop gets slow for a moment during somewhat heavier processing I expect to see higher numbers (for CPU use) than what I in fact see in the conky Process Panel that I have on the desktop and in the System Monitor.
Using top in terminal I see numbers that justify that momentary slowness of the computer. For example, while Firefox is running with some addons that use relatively high CPU resources (displayed as "Web Content") the conky script (just like Gnome System Monitor) shows around 25% of CPU resources used, while top shows around 71%, which seems more "real" given the fact that the PC has indeed become slow.
How could I get those "real" numbers in the conky I use? And why is top different from that and from the System Monitor?
The part of the conky script that is significant here is this:
${top name 1} $alignr ${top cpu 1}%
${top name 2} $alignr ${top cpu 2}%
${top name 3} $alignr ${top cpu 3}%
etc.
|
This is because top is showing the value as a percentage of a single CPU core, while conky is showing the percentage of total available CPU power. If you run top and press I you should see the same (almost the same, there will always be a race condition: the time that top polls the CPU won't be the exact same time that conky does) numbers.
This is documented in man top (emphasis mine):
%CPU -- CPU Usage
The task's share of the elapsed CPU time since the last screen
update, expressed as a percentage of total CPU time.
In a true SMP environment, if a process is multi-threaded and
top is not operating in Threads mode, amounts greater than
100% may be reported. You toggle Threads mode with the `H'
interactive command.
Also for multi-processor environments, if Irix mode is Off,
top will operate in Solaris mode where a task's cpu usage will
be divided by the total number of CPUs. You toggle Irix/Solaris modes with the `I' interactive command.
So, what you are seeing in your example is that top is in Irix mode and reporting the %CPU value as a percentage of a single CPU, while conky is reporting it as a percentage of all available CPUs.
And, just to illustrate, this is what top looks like in Irix mode on my 8-core laptop when running pigz which can use multiple threads:
PID USER PR NI VIRT RES %CPU %MEM TIME+ S COMMAND
1090509 terdon 20 0 657.6m 4.5m 605.3 0.0 0:33.18 R pigz
See how the %CPU is well above 100? Now, the same thing in Solaris mode, shows:
PID USER PR NI VIRT RES %CPU %MEM TIME+ S COMMAND
1100171 terdon 20 0 657.6m 4.5m 82.0 0.0 1:24.08 S pigz
The numbers don't match exactly since I ran the command twice to get the output, but you should be able to see the genera idea.
| Why are `top` CPU numbers different from those of System Monitor and Conky Process Panel? |
1,494,635,506,000 |
I have been trying to find the names of these two elements so I can edit/remove them. However, I have failed. What widgets(?) are these and where are their config files? And what placed them on the desktop?
EDIT: Thank you, for naming these, jasonwryan. After spending some more time with google, I ran 'locate conky' and was able to find /usr/share/doc/conky-1.10.6_pre/conky.conf & ./conky_no_x11.conf. And because they are in /doc/ I'm thinking they are examples? I can not locate any other conky.conf files.
The end goal is to merge the two into the bottom left instance, so my less-used (and easy to forget) $mod combinations are listed along with the computer RAM (shown as used/free).
|
The default session of Manjaro 17 (i3 edition) is using the files in /usr/share/conky/.
Pick the ones you want to use and copy them to /home/user/(.config), then edit the options for conky's startup in i3's settings to use those instead.
Now you can edit the new config files to suit your needs.
| Name/Edit/Remove Manjaro i3 Desktop Elements |
1,494,635,506,000 |
Is there some widget that I can put in the panel of my Xubuntu system that will show me a countdown of time? I've tried pystopwatch, but although it minimizes, it doesn't show me how long I have left. I've also tried xfce timer-plugin, but it doesn't really minimize. I just need something that will show how much time left I have for a certain task, as inconspicuously as possible. I'm running Xubuntu 12.04.
|
My answer will be not on panel. Im using conky to make it visible on desktop
Step 1.
Install conky
sudo apt-get install conky
Step 2.
Pearl Package
You may need to install libdate-manip-perl and libtime-modules-perl packages.
sudo apt-get install libdate-manip-perl libtime-modules-perl
Step 3.
Save at home folder
.conkycount
.countdown
Locate ${alignc}Countdown in .conkycount to change Countdown text.
Locate "October 26, 2012" in .countdown to change date.
Step 4.
Give permission to script
chmod +x ~/.countdown
Step 5.
Run your conky
By terminal:
conky -c ~/.conkycount
Make startup application
Open startup application
Name : ConkyCount
Command : conky -p 20 -c ~/.conkycount
Result
| Countdown timer in panel |
1,494,635,506,000 |
I use the following .conkyrc:
The key Question: How can I set the window width, so that I could have a wider "window" for my stuff?
background yes
use_xft yes
xftfont Terminus:size=8
xftalpha 0.8
update_interval 3.0
total_run_times 0
double_buffer yes
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
minimum_size 0 0
draw_shades yes
draw_outline no
draw_borders yes
stippled_borders 8
border_margin 0
border_width 0
default_color ffffff
default_shade_color black
default_outline_color ffffff
alignment top_left
# gap_x - 1280x800 = 1105; 1024x768 = 820
gap_x 1513
gap_y 5
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer yes
text_buffer_size 4096
TEXT
Thanks for any suggestions :\
|
Conky has excellent documentation:
maximum_width Maximum width of window
minimum_size Minimum size of window
| How to set conkys window width? |
1,494,635,506,000 |
I'm using vnstat together with conky. To show the monthly traffic I'm mixing vnstat and grep to find the month. The command to collect the data is
${execi 3600 vnstat -m -i wlan0 | grep "$(date "+%h")" | awk '{print $3 $4}'}
but the problem is that vnstat returns the month in English (Dec for December) and date returns it in Portuguese (Dez for Dezembro).
So my command is not working for the monthly traffic. Any help?
|
You need to export LANG to date. Assuming that execi invokes a POSIX-compliant shell to do the heavy lifting (note: I don't know if it does or not, your mileage may vary), something like the following should work:
${execi 3600 vnstat -m -i wlan0 | grep "$(LC_ALL=C date "+%h")" | awk '{print $3 $4}'}
| How to change the language for date command? |
1,494,635,506,000 |
I want to use this conky script: Conky Vision
But I don't want the days of the week to be displayed in English.
When I change my locale to another language, the day of today is displayed in that language but the 5-day names from the lower part of the image are always in English, even if I change the system language to something different.
I have also changed the system language but those days are still displayed in English.
What changes should I make to that script for it to follow the language I want?
The conkyrc file has this content:
# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes
# Window specifications #
gap_x 0
gap_y 0
alignment middle_middle
minimum_size 600 460
maximum_width 600
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_argb_visual yes
own_window_argb_value 255
#border_margin 0
#border_inner_margin 0
#border_outer_margin 0
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftalpha 0
xftfont Raleway:size=10
override_utf8_locale yes
imlib_cache_size 0
# Color scheme #
default_color FFFFFF
color1 FFFFFF
TEXT
\
#-----WOIED-----#
\
\
${execi 300 curl -s "http://weather.yahooapis.fr/forecastrss?w=615702&u=c" -o ~/.cache/weather.xml}\
\
\
#---Clock+Date---#
\
\
${font Raleway:weight=Light :size=100}${alignc}${time %H}${alignc}:${alignc}${time %M}
${font Raleway:weight=Light:size=32}${voffset -60}${alignc}${time %A %B %d}\
\
\
#---High Temperatures---#
\
\
${font Raleway:size=20}\
${voffset 76}${goto 40}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°
${font Raleway:weight=Light:size=14}\
${voffset -28}${goto 160}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°\
${goto 270}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°\
${goto 380}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°\
${goto 490}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°\
\
\
#---Low Temparatures---#
\
\
${font Raleway:weight=Light:size=10}\
${voffset 48}${goto 210}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°\
${goto 320}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°\
${goto 430}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°\
${goto 540}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°\
\
\
#---Name of the day---#
\
\
${font Raleway:weight=Light:size=14}\
${voffset 30}${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}\
${goto 170}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}\
${goto 280}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}\
${goto 390}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}\
${goto 500}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}\
\
\
#---Weather Icons---#
\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 61,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 171,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 281,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p 391,260 -s 32x32}\
\
${execi 300 cp -f ~/.conky-vision-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p 501,260 -s 32x32}${font}${voffset -46}\
It seems related to the file ~/.cache/weather.xml (more details on that here).
This file contains lines like:
<yweather:forecast day="Fri" date="10 Jul 2015" low="14" high="26" text="Mostly Sunny" code="34" />
<yweather:forecast day="Sat" date="11 Jul 2015" low="15" high="27" text="Mostly Sunny" code="34" />
<yweather:forecast day="Sun" date="12 Jul 2015" low="14" high="22" text="Showers" code="11" />
<yweather:forecast day="Mon" date="13 Jul 2015" low="16" high="24" text="Cloudy" code="26" />
<yweather:forecast day="Tue" date="14 Jul 2015" low="12" high="23" text="AM Showers" code="39" />
I guess, as indicated in a comment, the commands under ---Name of the day---# in .conkyrc are writing and updating the lines in ~/.cache/weather.xml posted above (containing names of days in English). But as I see those commands just relate to the "yweather:forecast", which might mean that the days in English are written as they are grabbed by curl from the yahoo weather English_US website, and that's why they are in English.
But what intrigues me is that when I've first seen this conky was on a Spanish site where all was in Spanish. That PPA does not work anymore it seems.
I'm in elementary OS Freya (based on *ubuntu 14.04)
|
I'm the creator of that conky theme. :)
The names of days are provided in the xml file, and yahoo's API only offers English.
You can use 'execi' and run the date command to show all the days instead, and use the LANG variable to change the output language.
Here is an example:
#---Names of days---#
\
\
${font Raleway:weight=Light:size=14}\
${voffset 30}${goto 60}${execi 300 LANG=es_ES.UTF-8 date +%a | awk '{print toupper($0)}'}\
${goto 170}${execi 300 LANG=es_ES.UTF-8 date -d +1day +%a | awk '{print toupper($0)}'}\
${goto 280}${execi 300 LANG=es_ES.UTF-8 date -d +2days +%a | awk '{print toupper($0)}'}\
${goto 390}${execi 300 LANG=es_ES.UTF-8 date -d +3days +%a | awk '{print toupper($0)}'}\
${goto 500}${execi 300 LANG=es_ES.UTF-8 date -d +4days +%a | awk '{print toupper($0)}'}\
UPDATE:
The above (as well as the question) is related to an older version of this conky script.
The newer version of Conky Visions (that needs conky version 1.10 (here) and jq in order to work, as well as a different font) can easily set a different language by editing the .conkyrc line for locale, template 9:
-------------------------------------
-- Locale (e.g. "es_ES.UTF-8")
-- Leave empty for default
-------------------------------------
template9=""
| How to make this conky (Conky Vision) use other language than English? |
1,494,635,506,000 |
I would like to perform basic, arbitrary maths without writing a lua function for it.
One (non-working) example might be: ${${loadavg 1}*100)}%
If this were possible then many other uses might be imagined.
|
The answer depends on how you look at it. If you consider Conky's built-in Lua support and the associated use of Lua to be part of Conky, then yes. Otherwise, no.
Using Lua to do calculations is fairly straightforward. Here's an example Lua file called temps.lua for doing some calculations (I threw in your example, too)...
function conky_F2C(f)
local c = (5.0/9.0)*(f-32.0)
return c
end
function conky_C2F(c)
local f = c*(9.0/5.0)+32.0
return f
end
function conky_acpitempF()
local c = conky_parse("${acpitemp}")
return conky_C2F(c)
end
function conky_loadavg()
return conky_parse("${loadavg 1}") * 100
end
At the top of the conky.config section of my .conkyrc file, I put the following...
lua_load = '~/bin/lua_scripts/temps.lua',
And in the conky.text section, I put the following lines...
ACPI Temp... ${acpitemp}°C
Conv to F... ${lua conky_acpitempF}°F
Body Temp... 98.6°C
Conv to C... ${lua conky_F2C 98.6}°C
Load Avg... ${loadavg 1}
Multipliled by 100... ${lua conky_loadavg}%
The resulting display on Conky should appear similar to...
ACPI Temp... 43°C
Conv to F... 109.4°F
Body Temp... 98.6°C
Conv to C... 37°C
Load Avg... 0.28
Multipliled by 100... 28.0%
Note that, as far as I've been able to tell, you can't pass a Conky object like ${loadavg 1} to a Lua function. But you can access an object within a Lua function as in the example code above.
| Can Conky perform basic maths nativly? |
1,494,635,506,000 |
I want the output of
stdbuf -i0 -o0 -e0 jack_cpu_load | sed -n 's/[A-Za-z]*//g;s/ //g;s/.\{4\}$//;9,$p'
to be displayed in Conky but, I suspect, Conky is starting the script with every refresh and the script is too slow producing an output for anything to show.
Or, maybe it's something else entirely.
I used ${execp /path/to/script.sh}
Is there a way to let the script run and for Conky to sample the output. Provided my theory is correct. shrugs
Edit: I'm working on sending the output to a file then having Conky read that, but I'm having a hard time getting it to overwrite the file.
The closest I've gotten so far is, stdbuf -i0 -o0 -e0 script.sh > file.log but that just keeps appending the output to the file until I stop and start it again.
|
You should say that this is related to Pipe output of jack_cpu_load through sed
So you wish to extract the float values from this output
jack DSP load 0.163633
jack DSP load 0.159914
jack DSP load 0.159449
jack DSP load 0.164087
jack DSP load 0.159971
Never heard of conky before. Looks cool.
What I would do here:
Do not call the executable each time but have jack_cpu_load write into a "circular buffer" (I multiply by 100 because I'm not sure what conky does to floats)
stdbuf -oL jack_cpu_load | grep --line-buffered "jack DSP load" | stdbuf -oL cut -d' ' -f4 | while read line; do echo "scale=0; $line*100/1" | bc -l > /tmp/buffer; done &
Read the buffer from conky:
${tail /tmp/buffer 1 1}
Or draw a bar
${execbar cat /tmp/buffer}
or
${execibar 1 cat /tmp/buffer}
I have no X here, but I'll let you try :)
PS. Also found this on stack overflow (https://stackoverflow.com/questions/5427936/mpd-lua-conky) which shows other possibilities
| Shell script too slow for output to Conky |
1,494,635,506,000 |
I know conky can monitor my personal computer, but can it monitor the other Linux servers I have on the network? I'd like to see data on CPU and memory usage and some critical processes each server uses. For instance, one server is our MySQL server, so I'd like to display the CPU and memory usage for this server, how much resources the mysqld processes consumes and the network consumption. For another server, some other information should be display according to its use.
|
I wrote a program for this very purpose: Conkw. It stands for web based conky.
This is a program that, like conky, can monitor many vitals on your system but also all sorts of stuff (stocks, weather, etc) and exposes a REST API with all the data. It can also monitor a Windows or a MacOS machine.
There is also a HTML UI to display your stuff on any browser (even quite old). The goal was to find some use to the old ipads/tablets we all have lying around. You can put them next to your screen and have your metrics displayed there. More real estate for the real work on your main screens!
But the network-based communication btw UI and API make it trivial to monitor another computer. In fact, you can build a mesh network and have metrics of plenty of different machines on the same UI.
It's still very much under development but I've been using it constantly for about 6 month now, so it works well.
| Can conky monitor other Linux computers on the network? |
1,494,635,506,000 |
In my .conkyrc file I use some shell-scripts and call it via {execi}.
The problem is it doesn't execute these scripts on startup, e.g. get_public_ip.sh doesn't need to get called every 30 seconds like the get_cpu_temp.sh, so I use:
{exceci 3600 get_public_ip.sh}
with this command I have to wait one hour until I get my public IP because conky doesn't call the script on startup!
How can I configure conky so it will call all {execi} lines on startup?
|
As far as I can tell execi should work, not sure why it doesn't. In any case, I get conkyto show my public IP as follows:
${texeci 3600 wget -qO - http://cfajohnson.com/ipaddr.cgi}
Try replacing execi with texeci, see if that helps.
Another possible problem is that conky may be loaded before your connection is established. If so, it will run your execi command on startup but it will get no result since you are not connected yet. I get around this type of problem by launching conky through a wrapper script that looks like this:
#!/bin/bash
sleep 20
conky
| conky execi doesn't execute on startup |
1,494,635,506,000 |
I'm setting up conky and I would like to add the CPU frequency, but if I put
${freq_g cpu0} Ghz
I get 1.2Ghz. Why is that? My CPU is 2.8Ghz.
|
From the conky man page.
cpu (cpuN)
CPU usage in percents. For SMP machines, the CPU number can
be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu
cpuX} (X >= 1) are individual CPUs.
freq_g (n)
Returns CPU #n's frequency in GHz. CPUs are counted from 1.
If omitted, the parameter defaults to 1.
You most likely have something like SpeedStep enabled which is acting like a governor on a car, regulating the speed of the cores inside your CPU.
You can confirm that this is going on by looking at the output of this command:
% less /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz
stepping : 5
cpu MHz : 1199.000
...
The 2 numbers that matter are the 2.67GHz, that the GHz that my CPU is rated to operate at followed by the number 1199.00, this is what my CPU is allowed to run at by the governor setup on my Linux laptop.
You can see what governor is currently configured like so:
# available governors
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
powersave ondemand userspace performance
# which one am I using?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave
# what's my current frequency scaling?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1199000
# what maximum is available?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
2667000
# what's the minimum?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1199000
# what scaling frequencies can my CPU support?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2667000 2666000 2533000 2399000 2266000 2133000 1999000 1866000 1733000 1599000 1466000 1333000 1199000
You can override your governor by doing the following, using one of the governor's listed above:
% sudo sh -c "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
References
Using CPU Frequency on Linux
| How does CPU frequency work in conky? |
1,494,635,506,000 |
So: I just installed Conky, and it looks very nice. But it's annoying to constantly open it on startup manually. So I've search for a way to autostart Conky
I've tried:
Making a .desktop file and put it in /home/<username>/.config/autostart/, but it wouldn't open, even if I added a 30 seconds delay.
[Desktop Entry]
Type=Application
Exec=/usr/bin/conky -p 30
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=conky
Comment=conky
Create a user service, enabled it on startup and try to restart. But when I checked the log, it returned an error conky: can't open display: , even if I added a 30/60 seconds delay.
$ systemctl --user status conky.service
conky.service - Conky autostart
Loaded: loaded (/home/<username>/.config/systemd/user/conky.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2022-05-20 16:47:00 +07; 4s ago
Process: 1568 ExecStart=/usr/bin/conky --config=/home/anhquan/.conkyrc --daemonize --pause=60 (code=exited, status=1/FAILURE)
CPU: 18ms
May 20 16:46:00 fedora systemd[1550]: Starting conky.service - Conky autostart...
May 20 16:47:00 fedora conky[1568]: conky: can't open display:
May 20 16:47:00 fedora systemd[1550]: conky.service: Control process exited, code=exited, status=1/FAILURE
May 20 16:47:00 fedora systemd[1550]: conky.service: Failed with result 'exit-code'.
May 20 16:47:00 fedora systemd[1550]: Failed to start conky.service - Conky autostart.
It does seem to work for other people, but doesn't for Fedora 36 / GNOME 42. It might be a bug with the OS / DE, or some changes to Conky that I didn't knew, or maybe it's a problem with Wayland. So is there a different way to autostart it in F36 / G42?
P/S: Here is the new log when forcing Xwayland to start:
○ conky.service - Conky autostart
Loaded: loaded (/home/anhquan/.config/systemd/user/conky.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2022-05-20 17:38:23 +07; 17s ago
Process: 1575 ExecStartPre=Xwayland (code=exited, status=1/FAILURE)
CPU: 56ms
May 20 17:38:23 fedora systemd[1556]: Starting conky.service - Conky autostart...
May 20 17:38:23 fedora systemd[1556]: conky.service: Control process exited, code=exited, status=1/FAILURE
May 20 17:38:23 fedora systemd[1556]: conky.service: Failed with result 'exit-code'.
May 20 17:38:23 fedora systemd[1556]: Failed to start conky.service - Conky autostart.
PSS: After running strace, here's what systemctl reported (No logs written to the /tmp directory can be found)
conky.service - Conky autostart
Loaded: loaded (/home/anhquan/.config/systemd/user/conky.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2022-05-20 18:04:11 +07; 21s ago
Process: 1578 ExecStart=strace -f /tmp/conky.log /usr/bin/conky --config=/home/anhquan/.conkyrc -p 30 (code=exited, status=203/EXE>
CPU: 1ms
May 20 18:04:11 fedora systemd[1560]: Starting conky.service - Conky autostart...
May 20 18:04:11 fedora systemd[1578]: conky.service: Failed to locate executable strace: No such file or directory
May 20 18:04:11 fedora systemd[1578]: conky.service: Failed at step EXEC spawning strace: No such file or directory
May 20 18:04:11 fedora systemd[1560]: conky.service: Control process exited, code=exited, status=203/EXEC
May 20 18:04:11 fedora systemd[1560]: conky.service: Failed with result 'exit-code'.
May 20 18:04:11 fedora systemd[1560]: Failed to start conky.service - Conky autostart.
|
So after looking at Issues in the GitHub repo of Conky, more specifically: https://github.com/brndnmtthws/conky/issues/869
and also looking at the log: May 20 16:47:00 fedora conky[1568]: conky: can't open display
I've added a new config into the services file: Environment="DISPLAY=:0"
And now it worked nicely, even with lower delay!
| Cannot autostart Conky in Fedora 36 - GNOME 42 |
1,494,635,506,000 |
I want to set the color of a line to a specific shade of yellow (but not just yellow).
I set it like this:
${font LCDMono:bold:size=20}${color yellow}Uptime:$color $uptime
Where all the line has a font size of 20, and only the word "Uptime" will be yellow. The thing is that I don't want it in that kind of yellow, I want it in a more pale yellow (#FCD862 in hexa).
How can I do that?
|
Conky lets you define your own color:
colorN : Predefine a color for use inside TEXT segments. Substitute N by a digit between 0 and 9, inclusively. When specifying the color value in hex, omit the leading hash (#).
So, add this line before the TEXT part of conkyrc:
color1 FCD862
Then, use $color1 instead of $color:
${font LCDMono:bold:size=20}${color1}Uptime:$color $uptime
| set color of conky |
1,494,635,506,000 |
I'm using Ubuntu 20.04 and I'm looking for a bash script to start Quodlibet (a music application) and conky simultaneously. Edit: The idea is to use the sh script in a .desktop launcher
Start Quodlibet
Start conky 2 seconds later
Close conky if Quodlibet is closed
I made some tests but I believe the following script won't work because I doesn't catch the closing of Quodlibet. Conky is still running when I close Quodlibet.
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
quodlibet &
sleep 2 &&
conky &
wait
EDIT: Standalone .sh solution
Working script, thanks to @berndbausch.
#!/bin/bash
quodlibet & QUODPID=$!
sleep 3 &&
conky & CONKYPID=$!
wait $QUODPID
kill $CONKYPID
EDIT: Using a custom launcher
As explained by @xhienne in his answer, using exec=setsid /path/to/script.sh in the .desktop file as well as his script works well.
|
Just start Quodlibet in the current shell, not in a sub-process:
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
(sleep 2 && conky) &
quodlibet
[update] You mention that you want to run this script from a .desktop file in a graphical environment. @fra-san made me aware that every process run this way are likely to inherit their parent's process group and that, as a consequence, kill 0 will kill that launcher process and (potentially) all the processes it has started. This is certainly not what you want.
The solution to this is to start your script with setsid so as to create a new process group dedicated to it:
setsid /path/to/script.sh
| Starting and closing an application based on an other application |
1,494,635,506,000 |
I had a simple conky script for the Deadbeef audio player:
The part that is concerned with the lines above is this:
TEXT
${color 3399FF}${alignr}db audio is playing:
#${alignr}
${color FFFFFF}${alignr} ${exec deadbeef --nowplaying "%a"}
${color FFFFFF} ${alignr}${exec deadbeef --nowplaying "%t"}
${color FFFFFF}${alignr}${exec deadbeef --nowplaying "%b"}
${color FFFFFF}
${alignr}${color 3399FF}${exec deadbeef --nowplaying "%e"}${offset 2}${alignr} / ${exec deadbeef --nowplaying "%l"}
${alignr}${image ./logo.png -p 0,-1 -s 25x25}${color 3399FF}
How do I add a progress bar, showing the progress through the song?
|
You can draw a default-sized bar using execbar followed by a command that should return a number from 0 to 100 giving what percentage of the bar is filled. For example, if you have the following shell script myscript in your PATH:
#!/bin/bash
deadbeef --nowplaying "%e %l" |
awk '
{ n = split("::" $1,t,":")
elapsed = (t[n-2]*60+t[n-1])*60+t[n]
n = split("::" $2,t,":")
total = (t[n-2]*60+t[n-1])*60+t[n]
printf "%d\n",elapsed*100/total
}'
then you can use the conky line:
${execbar myscript}
The script simply converts the elapsed and total time output from deadbeef into seconds and finally a percentage.
The result looks like this:
| In conky, how can I show a progress-bar for the track playing in Deadbeef? |
1,494,635,506,000 |
I have started using Conky some days ago, and I'm willing to create my own configuration. I have added some colors, cool ASCII art and learned the basics.
However, I don't like the default progress bars coming with Conky, and I would like to create something like a string of 50 '#' signs or 'rectangles' (219th character in the ASCII table), being the first 20 green, the following 20 yellow and the last 10 red.
I'd like to implement it as a fs_bar, being green when having plenty of free space, yellow when it's half full and red when I should free some files, but showing the three colours in the two last cases. I'm attaching an image with a pretty similar result.
I am running AwesomeWM in Arch Linux, and my Conky version is 1.10.5.
|
You can do something simple like this, which uses execpi to run a shell script every 30 seconds that parses the output of df / and converts it into a long string of conky color commands and \# characters (since # is used for comments):
${execpi 30 df --output=pcent / | awk 'NR==2 {
n = ($1+0)/2; yellow = 20; red = 40;
if(n>=red) { r = "${color #ff0000}"; for(;n>=red;n--) r = r "\\#" }
if(n>=yellow){ y = "${color #ffff00}"; for(;n>=yellow;n--)y = y "\\#" }
g = "${color #00ff00}"; for(;n>0;n--) g = g "\\#";
print g y r
printf "%50s"," "
}' }
${color}
My df --output=pcent outputs 2 lines; the second one is a percentage used, eg 69%. I tried this on conky 1.9.
If your ~/.conkyrc file has been converted to format version 1.10 then it will contain a line
conky.text = [[
Make sure you add the above script before the final closing ]].
Also, in 1.10 colours given as numbers (eg #ff0000 above) no longer begin with # so you should use ff0000 and so on in the script.
To simplify, put the following script into a separate file somewhere in your PATH, say ~/mydf, make it executable (chmod +x ~/mydf), and then put that filename in ~/.conkyrc, eg ${execpi 30 ~/mydf /}
#!/bin/bash
df --output=pcent "${1?}" | awk 'NR==2{
n = ($1+0)/2; yellow = 20; red = 40;
if(n>=red) { r = "${color ff0000}"; for(;n>=red;n--) r = r "\\#" }
if(n>=yellow){ y = "${color ffff00}"; for(;n>=yellow;n--)y = y "\\#" }
g = "${color 00ff00}"; for(;n>0;n--) g = g "\\#";
print g y r
printf "%50s"," "
}'
If you want to put the whole script in the ~/.conkyrc file, you will need to increase the default buffer size or the command will be truncated to 256 characters. This leads to errors like
sh: -c: line 0: unexpected EOF while looking for matching `''
To do this, in 1.10 add a line inside the conky.config={...} part, making sure you separate the settings with a comma (,):
text_buffer_size = 400,
In conky 1.9 add a line before the TEXT section:
text_buffer_size 400
To stop the window resizing as the number of characters printed increases, a final printf "%50s"," " adds a second line of spaces of the maximum length. Alternatively, add a configuration setting for the minimum size of the window in pixels, eg minimum_size 500 (or minimum_size=500, for 1.10), where the value to use depends on the font width of the # character.
| How can I create my own custom progress bar in Conky? |
1,494,635,506,000 |
I'm trying to use conky's image variable in a way that it read the image file path from a file or a pipe.
Something like ${image ${execp cat /home/r1y4n/.conky/imagepath.txt} -p 30,0 -s 150x150 }
But it seems conky doesn't support nesting variables.
here says image variable can be modified at runtime using $execp
So how can I change the image argument in each conky loop?
I want to be able to control the image is shown from outside of conky by creating a bash script or something and setting a shortcut for it.
|
I would simply use a symlink and change its target as needed. For example, create a link called conkyimage.png which points to ~/myimages/unicorn.png:
ln -s ~/myimages/unicorn.png ~/conkyimage
Then, in conkyrc, have it show that image (note the -n, which tells conky not to cache the image):
${image ~/conkyimage.png -p 30,0 -s 150x150 -n }
Finally, write a script that changes the link's target:
#!/usr/bin/env bash
## Update the link's target
ln -fs "$1" ~/conkyimage.png
You then run the script giving it the target image as an argument:
script.sh /path/to/new/image.png
| Dynamic conky variable argument |
1,494,635,506,000 |
There is a Linux program I like which is Conky, when I run conky -c mycustomconf.txt it runs fine.
I want this program to run automatically when I start my computer, without having to type in the command again to start it.
How can I do this?
I am using Ubuntu with Xfce4.
|
You can add programs that you wish to start up alongside Xfce to your startup items using xfce4-autostart-editor, which is accessible at Settings, and then "Xfce 4 Autostarted Applications".
| Running a program automatically? |
1,494,635,506,000 |
I redid my i3bar recently with conky. This morning when I woke up the there were un-recognized characters symbols in my bar (where there are spaces in my conkyrc file). Nothing has really changed to my knowledge and I am not sure why this happened overnight. My conkyrc:
background no
out_to_x no
out_to_console yes
update_interval 1
total_run_times 0
use_spacer right
TEXT
${if_mpd_playing}${mpd_artist} ${mpd_title}${endif} \
${wireless_essid wlp7s0} \
${exec amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p'| uniq} \
${cpu cpu}% \
$memperc% \
${time %a %b %d} \
${time %I:%M %P} \
${battery_percent BAT0}% ${exec acpi -b | awk "{print $1}" | sed 's/\([^:]*\): \([^,]*\), \([0-9]*\)%.*/\2/'}
And my i3bar config:
bar {
status_command conky -c $HOME/.i3/conky/conkyrc
mode dock
position top
colors {
background #F1F2F6
statusline #788491
separator #51c4d4
focused_workspace #F1F2F6 #F1F2F6 #4FC0E8
active_workspace #F1F2F6 #F1F2F6 #4FC0E8
inactive_workspace #F1F2F6 #F1F2F6 #C1D1E0
urgent_workspace #F1F2F6 #F1F2F6 #C1D1E0
}
}
|
Found the answer: updating the awesome font seemed to fix it.
pacaur -S awesome-terminal-fonts
| Conky i3bar not recognizing spaces |
1,494,635,506,000 |
I'm using this command, which searches pacman.log for packages updated today and converts them into a conky string:
tail -500 /var/log/pacman.log | grep -e "\[$(date +"%Y-%m-%d") [0-5][0-9]:[0-9][0-9]\] \[ALPM\] upgraded" | sed 's/^.*\([0-2][0-9]:[0-5][0-9]\).*upgraded \([^ ]*\).*/${color2}\2${goto 250}${color1}\1/' | tail -18
With tail -18 the maximum number of lines is 18.
What is the best way to append new lines so that the stream always has 18 lines?
|
You can do (with a shell with support for zsh's {x..y} form of brace expansion like zsh, bash, ksh93 or yash -o braceexpand):
{
printf '%.0s\n' {1..18}
your-command
} | tail -n 18
Note that it prepends newline as opposed to appending them. To append, you could do:
your-command | tail -n 18 | awk '{print};END{while (NR++ < 18) print ""}'
| Append new lines to stream, until certain number is reached |
1,494,635,506,000 |
Conky is a system monitor software. I want to display the directory size of /usr and /var. Unfortunately I did not found any conky command so i made my own.
/usr $alignr${exec du -sch /usr | head -n1 | awk '{print $1}'}
/var $alignr${exec du -sch /var | head -n1 | awk '{print $1}'}
It works as expected for my /usr directory. The same command for the /var directory messes up my syslog:
#cat /var/log/syslog | tail -n 8
Oct 27 15:17:31 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/systemd-private-3f1797004e2e4fceacc1baad91af9e67-cups.service-LhZ0Wi“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:31 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/pulse-PKdhtXMmr18n“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/.xrdp/xrdp-sesman-yqTUiU“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/.xrdp/xrdp-5M2L0E“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/systemd-private-3f1797004e2e4fceacc1baad91af9e67-colord.service-3EtIBW“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/systemd-private-3f1797004e2e4fceacc1baad91af9e67-rtkit-daemon.service-TgoTcd“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/systemd-private-3f1797004e2e4fceacc1baad91af9e67-cups.service-LhZ0Wi“ kann nicht gelesen werden: Keine Berechtigung
Oct 27 15:17:32 Hans gnome-session[1155]: du: das Verzeichnis „/tmp/pulse-PKdhtXMmr18n“ kann nicht gelesen werden: Keine Berechtigung
The Problem is that I need superuser rights to execude the du command. Is there another way to get the directory size of the /var directory without permission problems for no-root-users?
Debian 8.2(jessie) |
Linux 3.16.0 |
GNOME Shell 3.14.4 |
Conky 1.9.0
|
Yes, you can give your user the right to run sudo du /var with no password, I'll show you how later. However, do you really want this? There are very few files and subdirectories that du needs root access to. The difference is reported size between sudo du /var and du /var is tiny (at least on my system):
$ sudo du -s /var/
1830596 /var/
$ du -s /var/
1826040 /var/
Those both resolve to exactly the same number of gigabytes:
$ sudo du -hs /var
1.8G /var
$ du -hs /var
1.8G /var
So, is such a small difference really worth it? It seems to me that a far simpler solution would be to just ignore the error messages by sending them to /dev/null:
/var $alignr${exec du -sh /var 2>/dev/null | awk '{print $1}'}
Note that I removed the head since that was only needed because you were using the -c option to print the total.
Since du is quite heavy and I doubt you really need this run every few seconds, you could also tell conky to only run the command once a minute:
/var $alignr${execi 60 du -sh /var 2>/dev/null | awk '{print $1}'}
If you feel that you really, really need the precise size of /var, run sudo visudo and add this line:
schmiddl ALL=NOPASSWD:/usr/bin/du -ch /var
Once you save the file, the user schmiddl will have the right to run sudo du -ch /var without a password, so you can add this to your .conokyrc:
/var $alignr${execi 60 sudo du -sh /var | awk '{print $1}'}
| directory size in conky |
1,494,635,506,000 |
Summary:
I recently installed Crunchbang and want to change the color of Conky, which is installed by default and shows system status info on the desktop. However, changing the config settings doesn't seem to make a difference, even when I manually restart conky.
Details:
I found two config files:
/etc/conky/conky.conf
/etc/conky/conky_no_x11.conf
They have color settings. If I change the settings and run
$ conky
then a terminal-looking panel appears that DOES reflect my changes. I noticed that in order to refresh the desktop Conky, not this terminal-looking Conky, I have to do
$ sudo killall conky
$ sudo conky -q
Killing it makes Conky disappear off the desktop. Starting it again as root makes it reappear on the desktop. But none of changes I make to the config files show up in the "root desktop" Conky, only when I run it as a "subsystem" Conky.
Please help me understand what is going on, and what I am missing.
|
The default configuration file for conky is ~/.conkyrc. This follows classic *nix convention that wants configuration files to be hidden (dot files) in ~/.
If that file exists, it will be read when you launch conky and the files in /etc will be ignored as you have seen. You can override the default with the -c flag (at least in conky 1.9.0):
-c | --config= FILE
Config file to load instead of $HOME/.conkyrc
| Conky on root desktop doesn't show config file changes |
1,494,635,506,000 |
As I understand, conky_update reloads the whole conky window every time. So, if I have rss fetching there and some scripts running they all rerun every few seconds. Is this right? Can I make the rss fetching part be very infrequent (say, every 10 hours), but other parts with few-seconds updating?
Relevant part from my .conkyrc:
update_interval 2.0
TEXT
${if_match ${desktop_number}==4}
${font GE Inspira:size=12}${color White}${alignc}Recent Blog Posts${color}${font}
${color White}${hr 1}${color}
${execp python ~/Documents/rss.py}
${color White}${hr 1}${color}
${endif}
rss.py merely scans an rss feed and gets blog post titles & dates from it.
|
As the conky documentation notes, there is a rss variable that defaults to a 15 minute interval for checking feeds:
Download and parse RSS feeds. The interval may be a floating point value greater than 0, otherwise defaults to 15 minutes. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles (when using this action and spaces_in_front is given conky places that many spaces in front of each item). This object is threaded, and once a thread is created it can't be explicitly destroyed. One thread will run for each URI specified. You can use any protocol that Curl supports.
The Arch Wiki has an example:
${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }
Where the 1 is a one-minute interval and 10 of the most recent updates are displayed.
If you intend on using a custom script, then there is a conky variable that supports an independent interval, execpi:
Same as execp but with specific interval. Interval can't be less than update_interval in configuration. Note that the output from the $execpi command is still parsed and evaluated at every interval.
| What does Conky update interval update and how to tune it? |
1,494,635,506,000 |
I am using conky 1.10.3 (conky-all) in Ubuntu 16.10 (x86-64), kernel 4.8.0-59-generic, Cinnamon 3.0.7.
How can I create a bar for diskio (actually, one for diskio_read and another for diskio_write)?
Conky has diskio (which gives a number) and diskiograph - no bars.
I tried, but could not find a way, to use something like ${execbar $diskio}.
I also messed a little with a lua script, namely BARGRAPH WIDGET v2.1 by wlourf, http://u-scripts.blogspot.com/2010/07/bargraph-widget.html but, although using
{
name="cpu",
--arg="%S",
max=100,
angle=90,
alarm=50,
bg_colour={0x00ff00,0.25},
fg_colour={0x00ff00,1},
alarm_colour={0xff0000,1},
x=0,y=610,
blocks=1,
height=250,width=25,
smooth=true,
mid_colour={{0.5,0xffff00,1}}
}
works, if I put "diskio" instead of "cpu" I get an empty bar (while conky's diskiograph clearly shows disk IO).
|
The main problem when using name="diskio_read" and diskio_write with the given lua bargraph widget is that these two functions return numbers like 2.33KiB rather than simple integers like 12345. The widget only uses the lua function tonumber() to convert returned values, and this fails on these strings.
The other problem is that of course you need to set max= to some suitable value (eg 100000000) as the disk io is not scaled to 100% like the cpu.
You can get round the first problem, if you are not using any other conky features, by resetting the global variable that requests values to be human readable:
conky.config = {
format_human_readable = false,
...
Alternatively, you can edit the widget file, bargraph.lua, in function setup_bar_graph(), change the line:
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
to something like
local result = conky_parse(string.format('${%s %s}', t.name, t.arg))
value = tonumber(result)
if value==nil then value = my_tonumber(result) end
and add your own tonumber function just before the function conky_main_bars().
-- https://unix.stackexchange.com/a/409006/119298
function my_tonumber(n)
local capture = {string.match(n,"^(%d+\.?%d*)([KMGTPB])")}
if #capture<=0 then return 0 end
local v = tonumber(capture[1])
if #capture==1 then return v end
if capture[2]=="K" then return v*1024 end
if capture[2]=="M" then return v*1024*1024 end
if capture[2]=="G" then return v*1024*1024*1024 end
if capture[2]=="T" then return v*1024*1024*1024*1024 end
return v
end
| How can I create a custom conky bar for diskio in Linux? |
1,511,577,491,000 |
I wanted to add mpd informations to my conky and therefore I created a script which role is to get the cover from ID3 tags
This script is called using the {exec 'path'} command
My probleme is that since I added this feature, my conky refuses to stand on his own :
If I launch it from a terminal using
conky -c `path.conkyrc` &
it will stop when closing the terminal. I tried using the -d option as well
I also tried to launch it at startup with a sh script run at startup : It works well at first but if I open a terminal, conky will close with the terminal i openned ... strange
removing the call to {exec 'path'} solves everything so it is clearly the problem origin
For the record, the script i am using is
#!/bin/sh
MPD_MUSIC_PATH="/media/Media/Music"
TMP_COVER_PATH="/tmp/mpd-track-cover"
exiftool -b -Picture "$MPD_MUSIC_PATH/$(mpc --format "%file%" current)" > "$TMP_COVER_PATH" &
|
The issue wasn't conky closing but it going behind everything, including the wallpaper.
Changing the window settings solved the problem:
own_window yes
own_window_type normal
own_window_transparent no
own_window_argb_visual yes
own_window_type normal
own_window_class conky-semi
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_argb_value 128
own_window_colour 000000
| {exec} cause Conky to stop |
1,511,577,491,000 |
I've been messing around with Conky for a while now and I recently started dabbling in Lua scripting. One of the things that used to bug me about a "flat" conkyrc approach (as opposed to a combined conkyrc and lua script) was that you had to set the position for everything using trial and error.
Using lua and cairo I was hoping to avoid that: I get the screen resolution from xdpyinfo and make all my dimensions relative to the screen resolution. The problem with this approach is that I still need to adjust the Conky window position from within the conkyrc file and (as far as I know) it can't be done programmatically. So my question is, can I use the results from my lua script to set Conky configuration variables like gap_x and gap_y? Or is there maybe another way to set these variables programmatically?
|
Perhaps not the solution I had in mind, but a solution nonetheless:
the Conky Lua API describes a conky_config function that returns "[a] string containing the path of the current Conky configuration file."
So my solution would be to open this file and edit it in place from within my lua script.
| Editing Conky configuration variables from Lua |
1,511,577,491,000 |
i'd like to display the output of lsb_release -ds in my Conky display. ftr, in my current installation that would output Linux Mint 18.3 Sylvia.
i had thought of assigning the output of that command to a local variable but it seems Conky doesn't do local vars.
maybe assigning the output of that command to a global (system) variable? but that's a kludge and it's not at all clear that Conky can access global vars.
sounds like an exec... might do it but the docs stress that that's resource inefficient and since this is a static bit of info (for any given login session) it seems a waste to keep running it over and over.
so, what to do? suggestions most welcome.
|
You should prefer the execi version of exec, with an interval, where you can give the number of seconds before repeating:
${execi 999999 lsb_release -ds}
| how to display lsb_release info in Conky? |
1,511,577,491,000 |
e.g.: my sample conkyrc (the last line is the only important part!):
background yes
use_xft yes
xftfont Terminus:size=8
xftalpha 0.8
update_interval 5.0
total_run_times 0
double_buffer yes
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
minimum_size 0 0
draw_shades yes
draw_outline no
draw_borders no
stippled_borders 8
border_margin 0
border_width 0
default_color ffffff
default_shade_color black
default_outline_color ffffff
alignment top_left
# gap_x - 1280x800 = 1105; 1024x768 = 820
gap_x 1200
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer yes
TEXT
${execpi 15 sleep $[ ($RANDOM % 3 ) ]; sh conkyscripts.sh}
AND
cat conkyscripts.sh
#!/bin/bash
for i in {1..40}; do echo "Welcome $i times"; done
So this should give output as the same as when doing "sh conkyscript.sh"
Welcome 1 times
Welcome 2 times
Welcome 3 times
Welcome 4 times
Welcome 5 times
Welcome 6 times
Welcome 7 times
Welcome 8 times
Welcome 9 times
Welcome 10 times
Welcome 11 times
Welcome 12 times
Welcome 13 times
Welcome 14 times
Welcome 15 times
Welcome 16 times
Welcome 17 times
Welcome 18 times
Welcome 19 times
Welcome 20 times
Welcome 21 times
Welcome 22 times
Welcome 23 times
Welcome 24 times
Welcome 25 times
Welcome 26 times
Welcome 27 times
Welcome 28 times
Welcome 29 times
Welcome 30 times
Welcome 31 times
Welcome 32 times
Welcome 33 times
Welcome 34 times
Welcome 35 times
Welcome 36 times
Welcome 37 times
Welcome 38 times
Welcome 39 times
Welcome 40 times
But nooooOO, because the conky gives this output to the Desktop:
Why? Why does it stop at 16? Is some buffer to small? Or conky can't write scripts output longer the 16 Lines or what? :O
|
Counting the characters, conky is displaying 257 characters, which looks suspiciously like an arbitrary limit for a single line of TEXT in conky. Add in some hidden quotes internally to conky, and the shell expansion, and you loose the "times" characters. Conky used to limit what it displayed to the first 128 characters - they may have doubled this.
(15(+1 newline)=16 characters per line x 16 lines = 256 characters.
Found this googling:
http://lifehacker.com/5067341/customize-conky-for-ambient-linux-productivity
If your to-do file or any other section is getting cut off too soon, that's because Conky has an unseen default text limit for any object. You can tweak it by adding a text_buffer_size 512 to the top section of your .conkyrc, changing that number to fit your needs.
If your TEXT is long enough, you may need to either raise this limit even further, or break your script up into several commands.
| Conky buffer too small? |
1,511,577,491,000 |
I' m trying to setup conky and I saw that I can use from cpu0 to cpu4
CPU0 ${cpu cpu0}% ${cpubar cpu0}
CPU1 ${cpu cpu1}% ${cpubar cpu1}
CPU2 ${cpu cpu2}% ${cpubar cpu2}
CPU3 ${cpu cpu3}% ${cpubar cpu3}
CPU4 ${cpu cpu4}% ${cpubar cpu4}
Why I have 5 cpu % if I go over cpu4, example:
CPU5 ${cpu cpu5}% ${cpubar cpu5}
It doesn' t show any % ??
I have an Intel i5, so I suppose that is a quad-core, right?
CPU0 what shows?
|
cpu0 is the average load, cpuN (where N >=1) is the load only on the Nth Cpu.
Excerpt from conky objects
CPU usage in percents. For SMP machines, the CPU number can be
provided as an argument. ${cpu cpu0} is the total usage, and ${cpu
cpuX} (X >= 1) are individual CPUs.
| How cpu works in conky |
1,511,577,491,000 |
According to the Archlinux wiki, in the "Prevent flickering" section, the line "double_buffer yes" should be placed "below the other options, not below TEXT or XY".
But when I look at Crunchbang default Conky, there are several options (not TEXT or XY) below "double_buffer yes" (line 45).
So is the positioning of "double_buffer yes" not critical (so long as it is above TEXT or XY)?
|
man conky (online here) says:
double_buffer
Use the Xdbe extension? (eliminates flicker) It is
highly recommended to use own window with this one
so double buffer won't be so big.
There is nothing about placing the option below others.
Secondly, the official conky FAQ on sourceforge discusses double-buffering and nothing is said about placing the option below other options.
Third, conky's official list of config settings on sourceforge mentions double buffering but says nothing about placing it after other options.
Fourth, my personal conky files have several option settings after the double buffering setting and it works for me.
I conclude that the Arch documentation is likely out of date.
| Position of "double_buffer yes" in ~/.conkyrc |
1,511,577,491,000 |
I want to build a simple infobar using conky. Take the following example:
dropbox zotero should be aligned to the left.
SSID: Hier Volume... should be aligned to the right.
Currently I am working with {offset 800} to move the second output to the right. However, this is very inflexible when the right output changes. Sometimes it exceeds my screen.
.conkyrc:
background yes
use_xft yes
xftfont Noto Sans:size=10
xftalpha 1
update_interval 1
total_run_times 0
# Run in own window
own_window yes
own_window_transparent yes
own_window_type desktop
# Don't show in window lists and on all desktops
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour white
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color black
alignment tl
maximum_width 1280
minimum_size 1280
gap_x 0
gap_y 2
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
##############################################
# Output
##############################################
TEXT
${exec basename $(ps -efa | grep dropbox |grep -v 'grep ' | awk '{print $NF}')} \
${exec basename $(ps -efa | grep zotero |grep -v 'grep ' | awk '{print $NF}')} \
${offset 800} ${battery BAT0} \
SSID: ${wireless_essid wls1} \
Volume: ${exec amixer -c 0 get Master | grep Mono: | awk '{print $(NF-2)}'} ${exec amixer -c 0 get Master | grep Mono: | awk '{print $NF}'} \
Keyboard: ${exec setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}'} \
${time %H:%M} \
${time %a %d %b %Y}
|
As Ash said in the comments, the way to do this is $alignr/$alignl. Something like:
TEXT
${exec basename $(ps -efa | grep dropbox |grep -v 'grep ' | awk '{print $NF}')} \
${exec basename $(ps -efa | grep firefox |grep -v 'grep ' | awk '{print $NF}')} \
$alignr ${battery BAT0} SSID: ${wireless_essid wlan0} Volume: ${exec amixer -c 0 get Master | grep Mono: | awk '{print $(NF-2)}'} ${exec amixer -c 0 get Master | grep Mono: | awk '{print $NF}'} \
Keyboard: ${exec setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}'} \
${time %H:%M} \
${time %a %d %b %Y}
| Conky infobar alignment left and right |
1,511,577,491,000 |
Environment
Debian Linux 11.5 "bullseye"
Conky 1.11.6 (compiled 2020-08-17, package 1.11.6-2)
Xorg 1.20.11 (package 2:1.20.11-1+deb11u2)
FVWM version 3 release 1.0.5 (built from git 23854ad7)
Problem
I am trying to reduce the Conky window to show just a single graph (chart, plot) with absolutely no other elements. However, it seems Conky keeps adding a gap/border/margin/padding/spacing, above and below the plot area. The gaps appear as horizontal bars in the background color. I've tried every Conky option I can find, but the gap won't go away.
Investigation
I've got gaps, margins, and border width set to zero. I've disabled all borders, ranges, scales, outlines, and shades. I've got the window and graph both set to 64 by 64. If I reduce the graph height, the entire window gets shorter, but the gaps remain in proportion. Likewise for increasing the graph height. If I resize the Conky window smaller with window manager controls, it clips off the graph. I can crop the bottom border this way, but not the top.
Screenshot
In the combined screenshots below, the magenta arrows point to the gaps. The bright green is the plot area. The dark gray surrounds are window manager decorations, and serve to show where the black Conky window background ends. These are both ${cpugraph} charts, with the CPU made artificially busy for test purposes.
Config
The Conky config that produced the above is:
conky.config = {
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = '',
alignment = 'top_middle',
own_window_title = 'conky_gaptest',
double_buffer = true,
disable_auto_reload = true,
top_cpu_separate = false,
update_interval = 0.5,
show_graph_range = false,
show_graph_scale = false,
draw_outline = false,
draw_shades = false,
draw_borders = false,
draw_graph_borders = false,
gap_x = 0,
gap_y = 0,
border_inner_margin = 0,
border_outer_margin = 0,
border_width = 0,
extra_newline = false,
default_color = 'white',
maximum_width = 64,
default_graph_width = 64,
default_graph_height = 64,
}
conky.text = [[${cpugraph cpu0 64,64 00ff00 00ff00}]]
Anyone have any suggestions?
Background
(I am doing this because I want to make the Conky window suitable for swallowing into FvwmButtons. I have a vaguely NeXTstep-esque dock/wharf/panel/sidebar, made of 64x64 pixel buttons. I'd like some of the buttons to be Conky graphs. But as long as those gaps are there, it wastes part of the tiny 64x64 space. wmload doesn't have this problem, but sucks in other ways.)
|
The conky object voffset changes the vertical offset position of the object following it by a given positive or negative number of pixels. A construction like the following may do what you need, where a negative value determined by trial-and-error should be substituted for each of y1 and y2:
conky.text = [[${voffset y1}${cpugraph cpu0 64,64 00ff00 00ff00}${voffset y2}]]
In determining y1 and y2, I'd recommend first using the following construction and determining y1 alone by trial-and-error:
conky.text = [[${voffset y1}${cpugraph cpu0 64,64 00ff00 00ff00}]]
Then, add in the second voffset term and determine y2 by trial-and-error.
| Conky 1.11.6 - Want to eliminate gaps above/below graphs |
1,511,577,491,000 |
Recent system updates have broken Conky manager, well it hasn't been updated on Github 4-5 years, looks abandoned but still maybe anyone knows how to fix it. It happened with the latest updates on Kali and Arch too.
Here's Conky clock code:
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0
double_buffer yes
#minimum_size 250 5
#maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment top_left
gap_x 100
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes
minimum_size 0 0
TEXT
${voffset 10}${color EAEAEA}${font GE Inspira:pixelsize=80}${time %I:%M}${font}${voffset -72}${offset 10}${color FFA300}${font GE Inspira:pixelsize=42}${time %d} ${voffset -15}${color EAEAEA}${font GE Inspira:pixelsize=22}${time %B} ${time %Y}${font}${voffset 24}${font GE Inspira:pixelsize=46}${offset -148}${time %A}${font}
${voffset 1}${offset 12}${font Ubuntu:pixelsize=12}${offset 0}${color FFA300}RAM ${offset 9}$color$mem / $memmax${offset 25}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%
Running conky -c ~/.conky/Gotham/Gotham gives this output:
conky: Syntax error (Gotham:1: syntax error near 'yes') while reading config file.
conky: Assuming it's in old syntax and attempting conversion.
conky: [string "..."]:159: attempt to call a nil value (global 'loadstring')
|
Your config file needs to be updated to the latest version using Lua syntax. The wiki in the conky GitHub repository provides detailed configuration information.
| Fix Conky widgets, not loading |
1,511,577,491,000 |
I would like to list the last 3 logins on conky so it would look something like this
username 1/1/2018 12:15 - 12:21 (00:06)
The format can very.
|
You can run a shell script from conky with execi followed by the time to wait between reruns:
${execi 30 last | awk '
/^wtmp begins/{ print s[(i+1)%3]"\n"s[(i+2)%3]"\n"s[i]; exit }
/^reboot /{ next }
NF>0{ i=(i+1)%3; s[i]=$0;}'
The above, for example, runs the last command every 30 seconds, and keeps the last 3 lines seen which do not begin reboot, and writes them out when we see a line beginning wtmp begins, which marks the end of the output from last.
| Can I list logins on Conky? |
1,511,577,491,000 |
I have this simple .conkyrc config:
own_window yes
own_window_type conky
own_window_argb_visual yes
own_window_argb_value 255
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
use_xft yes
xftfont Sans Regular:size=70
update_interval 1
alignment middle_middle
TEXT
${alignc}Test
${hr 2}
which renders this.
There is a large amount of space between the large text and the horizontal rule. No where in the conky config can I see how this is being introduced, so how can it be removed?
|
Ok I modified your code.try this
own_window yes
own_window_type conky
own_window_argb_visual yes
own_window_argb_value 255
own_window_transparent yes
own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager
double_buffer yes
use_xft yes
xftfont Sans Regular:size=70
#update_interval 1
alignment middle_middle
TEXT
Test${voffset -60}
${hr 2}
You can adjust the voffset value according to your requirements.
| Large space under text above HR in conky |
1,511,577,491,000 |
Here is my conkyrc:
conky.config = {
use_xft = true, -- use xft?
font = 'DejaVuSans:size=9', -- font name
xftalpha = 1,
uppercase = false, -- all text in uppercase?
pad_percents = 0,
text_buffer_size = 2048,
override_utf8_locale = true, -- Force UTF8? note that UTF8 support required XFT
use_spacer = 'none', -- Add spaces to keep things from moving about? This only affects certain objects.
update_interval = 1, -- Update interval in seconds
double_buffer = true, -- Use double buffering (reduces flicker, may not work for everyone)
total_run_times = 0, -- This is the number of times Conky will update before quitting. Set to zero to run forever.
-- Create own window instead of using desktop (required in nautilus)
own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_argb_value = 255,
own_window_type = 'desktop', -- transparency seems to work without this line
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
-- Minimum size of text area
minimum_height = 50,
minimum_width = 210,
draw_shades = false, -- draw shades?
draw_outline = false, -- draw outlines?
draw_borders = false, -- draw borders around text?
draw_graph_borders = false, -- draw borders around graphs
stippled_borders = 0, -- stripled borders?
imlib_cache_size = 0, -- Imlib2 image cache size, in bytes. Increase this value if you use $image lots. Set to 0 to disable the image cache.
-- Gap between borders of screen and text. Same thing as passing -x at command line
gap_x = 90,
gap_y = 5,
alignment = 'middle_right', -- alignment on {y_axis}_{x_axis}
cpu_avg_samples = 2, -- number of cpu samples to average. set to 1 to disable averaging
net_avg_samples = 2, -- number of net samples to average. set to 1 to disable averaging
no_buffers = true, -- Subtract file system buffers from used memory?
default_color = 'e0e0e0',
default_shade_color = '000000',
default_outline_color = '000000',
temperature_unit = 'celsius',
color1 = 'ff55ff', -- heading's color
color2 = 'ffffff', -- normal text's color
lua_load = '.conky/netdevs.lua',
};
conky.text = [[
...
${color1}NET: ${hr 2}${color2}${lua_parse conky_show_netdevs}
...
]]
Here is .config/netdevs.lua:
-- conky_show_netdevs : template for network
-- usage : ${lua_parse conky_show_netdevs}
prev_result = ""
function conky_show_netdevs()
updates = tonumber(conky_parse("${updates}"))
interval = 10
timer = (updates % interval)
if timer == 0 or prev_result == "" then
local netdevs_handle = io.popen("ip -j link show up | jq -r '.[] | select(.operstate == \"UP\" and .ifname != \"lo\") | .ifname'")
local result = ""
for netdev in netdevs_handle:lines() do
result = result .. "\nIP (${color1}" .. netdev .. "${color2}): ${alignr}${addr " .. netdev .. "}\n" ..
"${color2}Up: ${color2}${upspeed " .. netdev .. "}/s${color1}${alignr}${upspeedgraph " .. netdev .. " 10,170}\n" ..
"${color2}Down: ${color2}${downspeed " .. netdev .. "}/s${color1}${alignr}${downspeedgraph " .. netdev .. " 10,170}\n" ..
"${color2}Total Down: ${color2}${totaldown " .. netdev .. "}${alignr}Total Up: ${totalup " .. netdev .. "}\n"
end
netdevs_handle:close()
if result ~= "" then
prev_result = result
else
prev_result = "\n"
end
end
return prev_result
end
Everything works, except for the upspeedgraphs and downspeedgraphs, returned in conky_show_netdevs() function's output.
Here is an image of the graphs I can see (the small lines in the last section of the image; on the lines where the texts "UP" and "DOWN" are present):
As far as I could think, I thought this issue was caused due to lua function's contents getting parsed every time conky reloaded, which could cause the graph to reload. So, I tried to increase the update interval of conky to 10 secs. But still, no luck :( 👎.
Please tell me why is this happening and how to resolve this issue?
Thanks 😊!
|
Unfortunately, lua_parse will run on every update cycle, and so a new
empty graph will be created each time. If you only want to create the
network part of the config once at the start, you can take advantage of the
fact that the .conkyrc file is just a lua file, so you can put lua code
in it.
Use this to call a revised function that generates the configuration
string, and concatenate it onto variable conky.text. (You used to be able
to access this as a global in lua, but that doesn't seem possible anymore).
So terminate the .conkyrc with
conky.text = [[
...
${color1}NET: ${hr 2}${color2}
]]
require 'netdevs'
conky.text = conky.text .. conky_show_netdevs()
and edit the lua to remove any conky calls, and just return the config:
-- conky_show_netdevs : template for network
function conky_show_netdevs()
local netdevs_handle = io.popen(...)
local result = ""
for netdev in netdevs_handle:lines() do
result = result ...
netdevs_handle:close()
return result
end
| {up, down}speedgraphs not shown using `lua_parse lua_func` |
1,511,577,491,000 |
I was wondering how I could remove those information I am showing you in the following images:
As I said, the window manager I am using is i3 and it has been installed through Manjaro Architect, so the config file is generated and customized by the operative system. Any hint on how I can remove this?
EDIT:
As suggested in the comments, a possible cause of this might be conky, so I am posting both the config file of i3 and conky, respectively:
https://drive.google.com/file/d/1sqnpFxxIHACf2vUz9_Y169ceZQ7Kta47/view?usp=sharing
https://drive.google.com/file/d/18a27O8eZAtu8KkAxqUp4UkTeptsYgWav/view?usp=sharing
|
According to the config files you just posted, you could try commenting (adding # in front of the line) the line n°290
exec --no-startup-id start_conky_maia
I found relevant information according to your issue on this forum post.
| How to remove i3wm info on Desktop |
1,511,577,491,000 |
I'm trying to load a .png to display a battery icon in conky. So far I've tried nesting the function call, using eval but I can't seem to find a solution.
Here is my non working conky.text:
conky.text = [[
${image ${lua battery_icon $battery_status $battery_icon}}
]]
Where my battery_icon function looks like this:
function conky_battery_icon(battery_status, battery_percent)
if (battery_status == "charging")
then
icon = "charging-battery.png";
else
...
end
return("/path/to/icons/" .. icon);
end
I checked that the function works and I can get the correct path to the image by adding the following line to my conky.text:
${lua battery_icon $battery_status $battery_percent}
How can I use the returned path of battery_icon to load the file in conky's image?
Related question: Dynamic conky variable argument
|
Rather than returning the path alone, you can return a fully formed conky statement to display the icon. For example, if I have a Lua function that returns an image statement, such as...
function conky_myimg()
local path = "/home/David/System/Icons/StuffedTux.png";
local s = "${image "..path.."}";
return s;
end
...and I call the function in my conky.text with the line...
${lua_parse myimg}
...then the icon is displayed by conky.
| Dynamically loading image based on function output |
1,511,577,491,000 |
Ideally, I could use something like colortail or multitail and have conky configured to pass the color through, if that is possible. If not, then I need a way to do it some other way. Apologies for the cruft. It's a work in progress and theres probably stuff in here that doesn't need to be.
# **********************************************************************
#
# **********************************************************************
text_buffer_size 512
background yes
double_buffer yes
alignment bottom_left
border_width 1
cpu_avg_samples 2
#default_color white
#default_outline_color white
#default_shade_color white
draw_borders no
#draw_graph_borders yes
draw_outline no
draw_shades no
gap_x 0
gap_y 0
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
own_window yes
own_window_type normal
own_window_transparent yes
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
minimum_size 280 230
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no
use_xft yes
xftalpha 0.1
xftfont Droid Sans:size=9
#color0 white
#color1 EAEAEA
#color2 FFA300
#color3 grey
color0 white
color1 slate grey
color2 red
color3 blue
color4 green
TEXT
${color gray}
${exec tail -n 15 /var/log/syslog }
|
You can convert any ansi escape sequences into conky colour commands and use execp instead of exec to then have the output parsed.
For example, (not ansi), you can highlight in red the text systemd: with
${execp tail -n 15 /var/log/syslog |
sed 's/systemd:/${color red}&${color gray}/g'
}
| How can I display ANSI color in a CLI conky display? |
1,511,577,491,000 |
I've set conky to be started after logging in by creating the file conky.sh in /usr/local/bin, and adding the entry conky.sh to the Xfce startup applications list. conky.sh contains the following text:
#!/bin/bash
sleep 10
conky
exit
Conky starts as expected, but I now have two conky-related processes permanently running: conky using 7MB of RAM and conky.sh using 1.4MB of RAM. Also the result of whereis conky is now:
conky: /usr/bin/conky /etc/conky /usr/lib/conky /usr/bin/X11/conky /usr/local/bin/conky.sh /usr/share/man/man1/conky.1.gz
Why has this happened and how can I fix it?
|
You have two processes because one is the actual call to conky.sh and within conky.sh, you are calling the binary conky. You should be able to tell your startup application to call the conky binary 10 seconds after a system boot instead of telling it to call a script, which then calls the conky binary.
I use Gnome and Ubuntu shows it like this:
In Ubuntu/Unity:
Click the gear icon in the upper right hand corner of the top panel. SelectStartup Applications. Click Add. In the resulting dialog box give the name as "Conky" and the command as conky. Click add and close.
In Ubuntu/Gnome Shell
Press Alt+F2 to bring up the Run dialog. Type gnome-session-properties.Click the "Add" button. In the resulting dialog box give the name as "Conky" and the command as conky. Click add and close.
There is an area there for the seconds. Hope this helps you for XFCE
| Autostarting Conky Weird Behaviour |
1,511,577,491,000 |
How does a minimal conky config look like to draw a persistent top bar that stretches horizontally across the entire visible screen?
|
#if screen resolution = 1280x1024
alignment bottom_left
#bigger number = thinner bar
gap_y 950
minimum_size 1280
| Conky top bar that stretches across the whole screen |
1,511,577,491,000 |
I recently started using a bash script to setup terminal workspaces for myself, and everything worked fine for the first couple of days. I run the script, and four or five or seven terminals pop up, all in precisely the right places on the screen, all cd'ed into the proper directories, ready for use.
This morning I installed conky, and the next time I tried to run my script, the oddest thing hapened. Now it will only open the first window. When I close that window, the second one opens. When I close that one, the third, and so on until the end of the script.
So now my script is useless except as a pasteboard for me to copy and paste into the terminal from.
Here is my script:
#!/bin/bash
if [ $1 = "deploy" ]; then
cd ~/
gnome-terminal --geometry=185x41+0+0 --window-with-profile=Colquhoun
cd ~/Utilities/Ad\ Tag\ Generators
gnome-terminal --geometry=85x15+1312+0 --window-with-profile=Generator
cd ~/Utilities
gnome-terminal --geometry=85x28+1312+280 --window-with-profile=Deployer
cd ~/Staging
gnome-terminal --geometry=85x20+1312+730 --window-with-profile=Monitor
fi
if [ $1 = "servers" ]; then
cd ~/
gnome-terminal --geometry=89x20+0+0 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x20+640+0 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x20+0+360 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x20+640+360 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x20+0+700 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x20+640+700 --window-with-profile=Colquhoun
fi
if [ $1 = "logchecks" ]; then
cd ~/
gnome-terminal --geometry=89x65+0+0 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x65+640+0 --window-with-profile=Colquhoun
gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun
fi
Does anyone know why this might be happening? And why it wasn't happening previously but is now?
|
Append an & to the end of each gnome-terminal command to make sure each terminal starts in the background. If you haven't killed them sooner, the terminals will exit when conky exits and kills all child processes.
| Script that spawns terminal windows suddenly waiting for each window to close before opening the next one |
1,511,577,491,000 |
I am trying to use this rings script to make nice rings appear on my desktop. It allows for customization, addition of more rings, or so it says. How do I feed the output of my python script to these rings?
|
I'm not sure whether questions this old need to be answered but since it's returned in search results, it may as well have an answer.
The lua script declares functions that accept parameters, E.G.
function draw_ring(cr,t,pt). The solution is to declare a function that receives your python script values.
function myCustomUI(neededValue)
In your conkyrc, you call that function, passing the python script's output. Something like this:
${lua myCustomUI ${<python call here>}}
Your next question is how to get your output into that variable?
Here you go:
${execi 3600 python script.py}
This makes your conkyrc code look like:
${lua myCustomUI ${execi 3600 python script.py}}
Of course, if your script is executable then you could drop the python from the execi call. The 3600 is just a repetition delay to avoid running the script constantly. More information can be found here
Additionally, conky variables are available within the lua environment so you can make the execi call from there if you want, using the same format.
| Passing custom variable from conky to lua |
1,511,577,491,000 |
I have the exact same issue as Creating Conky text variables with zero padding? for displaying network speed.
Except that I'm piping conky to dzen2. It seems lua_parse is not working within that setup.
I've tried :
Formatting the string directly : ${lua_parse format %2s ${downspeed re0}}
Using goto : ${downspeed re0}${goto 100}
Setting a custom function in ~/.xmonad/conky_lua_script.lua :
function conky_format( format, number )
return string.format( format, conky_parse( number ) )
end
Then in conkyrc:
lua_load = "~/.xmonad/conky_lua_script.lua"
conky.text = [[
${lua_parse format %5.0f ${downspeed re0}}%
]];
Minimal working example :
conky.config = {
background = true,
out_to_console = true,
out_to_x = false,
update_interval = 1.0,
use_spacer = 'none',
use_xft = true
};
conky.text = [[
${downspeed re0}
]];
Run it with conky | dzen2 .
Edit
The following works :
conky.config = {
lua_load = "~/.xmonad/conky_lua_script.lua"
....
};
conky.text = [[
${lua format %7s ${downspeed re0}}
]];
|
I realize this is a pretty stale question, but I recently ran into the same problem and this was high on the search results. Since I was able to uncover the answer, I figured I'd post it for the sake of anyone else that runs into this problem.
The lua_load = ... must be in your conky.config table (and not at the top level of the file the way it was in the old config syntax). Something like this:
conky.config = {
lua_load = 'path_to_script.lua',
...
};
Odd that even with debug enabled through -DD conky doesn't complain about the misplaced line.
| Conky text padding with dzen2 |
1,511,577,491,000 |
I'm setting conky and I'd like to add the usb space, I use:
$font${color DimGray}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}%
${fs_bar /}
for the full hdd, what should I write as path for USB?
|
It should be:
${fs_used /media/Name_You_See} / ${fs_size /media/Name_You_See}
Or, if you use udisks2:
${fs_used /run/media/User/Name_You_See} / ${fs_size /run/media/User/Name_You_See}
Also consider ${if_existing /media/Name_You_See} to check if path exists (which means it's mounted, not accurate but useful)
| Add USB space in conky |
1,511,577,491,000 |
My conky's cpu graph appears to not be functioning properly. It is just a block as per the screenshot that does not respond to actual cpu usage. Kind of annoying. I have also attached my conkyrc. I honestly don't know why this isn't working right. Thanks...
conky.config = {
background = true,
update_interval = 1,
cpu_avg_samples = 2,
net_avg_samples = 2,
temperature_unit = 'celsius',
double_buffer = true,
no_buffers = true,
text_buffer_size = 2048,
gap_x = 80,
gap_y = 70,
minimum_width = 350, minimum_height = 1100,
maximum_width = 375,
own_window = true,
own_window_type = 'desktop',
own_window_transparent = true,
own_window_argb_visual = true,
own_window_type = 'normal',
own_window_class = 'conky-semi',
own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
border_inner_margin = 0,
border_outer_margin = 0,
alignment = 'top_right',
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
override_utf8_locale = true,
use_xft = true,
font = 'Neuropolitical:size=10',
xftalpha = 0.5,
uppercase = false,
-- Defining colors
default_color = '#00FFFF',
-- Shades of Gray
color1 = '#00BEBE',
color2 = '#009696',
color3 = '#007878',
-- Orange
color4 = '#00FFFF',
-- Green
color5 = '#FF3C00',
-- Loading lua script for drawning rings
lua_load = '~/.conky/seamod_rings.lua',
lua_draw_hook_pre = 'main',
};
--${offset 15}${font Neuropolitical:size=10:style=normal}${color1}${pre_exec lsb_release -d | cut -f 2} - $sysname $kernel
conky.text = [[
${font Neuropolitical:size=10:style=bold}${color4}SYSTEM ${hr 2}
${offset 15}${font Neuropolitical:size=10:style=normal}${color1}${execi 6500 lsb_release -d | cut -f 2} - $sysname $kernel
${offset 15}${font Neuropolitical:size=10:style=normal}${color1}Battery: ${color3}${battery_bar 5,150 BAT0} ${color3}${battery_percent BAT0}%
${offset 15}${font Neuropolitical:size=10:style=normal}${color1}Uptime: ${color3}$uptime
# Showing CPU Graph
${voffset 25}
${offset 125}${cpugraph cpu0 40,220 009696 009696 -0.5 -l}${voffset -25}
${offset 90}${font Neuropolitical:size=10:style=bold}${color5}CPU
# Showing TOP 5 CPU-consumers
${offset 105}${font Neuropolitical:size=10:style=normal}${color4}${top name 1}${alignr}${top cpu 1}%
${offset 105}${font Neuropolitical:size=10:style=normal}${color1}${top name 2}${alignr}${top cpu 2}%
${offset 105}${font Neuropolitical:size=10:style=normal}${color2}${top name 3}${alignr}${top cpu 3}%
${offset 105}${font Neuropolitical:size=10:style=normal}${color3}${top name 4}${alignr}${top cpu 4}%
${offset 105}${font Neuropolitical:size=10:style=normal}${color3}${top name 5}${alignr}${top cpu 5}%
#Showing memory part with TOP 5
${voffset 47}
${offset 90}${font Neuropolitical:size=10:style=bold}${color5}MEM
${offset 105}${font Neuropolitical:size=10:style=normal}${color4}${top_mem name 1}${alignr}${top_mem mem_res 1}
${offset 105}${font Neuropolitical:size=10:style=normal}${color1}${top_mem name 2}${alignr}${top_mem mem_res 2}
${offset 105}${font Neuropolitical:size=10:style=normal}${color2}${top_mem name 3}${alignr}${top_mem mem_res 3}
${offset 105}${font Neuropolitical:size=10:style=normal}${color3}${top_mem name 4}${alignr}${top_mem mem_res 4}
${offset 105}${font Neuropolitical:size=10:style=normal}${color3}${top_mem name 4}${alignr}${top_mem mem_res 5}
# Showing disk partitions: root, home and files
${voffset 12}
${offset 180}${color1}${font Neuropolitical:size=10:style=bold}Disk Read: ${alignr}${font Neuropolitical:size=10:style=normal}${color2}${diskio_read}
${offset 180}${color1}${font Neuropolitical:size=10:style=bold}Disk Write: ${alignr}${font Neuropolitical:size=10:style=normal}${color2}${diskio_write}
${voffset -23}
${offset 90}${font Neuropolitical:size=10:style=bold}${color5}DISKS
${offset 120}${diskiograph 33,220 009696 009696}${voffset -30}
${voffset 20}
${offset 15}${font Neuropolitical:size=10:style=bold}${color1}Free: $color3${font Neuropolitical:size=10:style=normal}${fs_free /}${alignr}${font Neuropolitical:size=10:style=bold}${color1}Used: $color3${font Neuropolitical:size=10:style=normal}${fs_used /}
${offset 15}${font Neuropolitical:size=10:style=bold}${color1}Free: $color3${font Neuropolitical:size=10:style=normal}${fs_free /home}${alignr}${font Neuropolitical:size=10:style=bold}${color1}Used: $color3${font Neuropolitical:size=10:style=normal}${fs_used /home}
${offset 15}${font Neuropolitical:size=10:style=bold}${color1}Free: $color3${font Neuropolitical:size=10:style=normal}${fs_free /}${alignr}${font Neuropolitical:size=10:style=bold}${color1}Used: $color3${font Neuropolitical:size=10:style=normal}${fs_used /}
# Network data (my desktop have only LAN). ETHERNET ring is mostly useless but looks pretty, main info is in the graphs
${voffset 40}
${offset 200}${font Neuropolitical:size=10:style=bold}${color1}Lan IP: ${alignr}$color3${addr wlp3s0}
${offset 200}${font Neuropolitical:size=9:style=bold}${color1}Ext IP: ${alignr}$color3${execi 3600 wget -q -O /dev/stdout http://checkip.dyndns.org/ | cut -d : -f 2- | cut -d \< -f -1}
${voffset -36}
${offset 90}${font Neuropolitical:size=10:style=bold}${color5}WIRELESS
${voffset 40}
${offset 15}${color1}${font Neuropolitical:size=10:style=bold}Up: ${alignr}${font Neuropolitical:size=10:style=normal}$color2${upspeed wlp3s0} / ${totalup wlp3s0}
${offset 15}${upspeedgraph wlp3s0 40,320 007878 009696 1280KiB -l}
${offset 15}${color1}${font Neuropolitical:size=10:style=bold}Down: ${alignr}${font Neuropolitical:size=10:style=normal}$color2${downspeed wlp3s0} / ${totaldown wlp3s0}
${offset 15}${downspeedgraph wlp3s0 40,320 007878 009696 1280KiB -l}
${color4}${hr 2}
]];
|
You have
${cpugraph cpu0 40,220 009696 009696 -0.5 -l}
I'm not sure what a scale of -0.5 and logarithm mode means when together, but it seems to work for me (Conky 1.9.1), i.e. not a solid bar. I would have thought you would get a better idea of what the cpu is doing with a simple linear scale which might work, ie
${cpugraph cpu0 40,220 009696 009696}
| CPU graph not functioning properly |
1,511,577,491,000 |
I cannot print my GPU usage I have the following regexp:
${execgraph 16,235 $(nvidia-smi --query-gpu=utilization.gpu --format=csv -l 5 | sed -n '2p' | grep -Po "\\d+")}
Which prints the wanted value but for some reason the graph won´t render.
What am I missing?
|
Conky includes an nvidiagraph argument that seems directed to what you're trying to do. See man conky for details. Unfortunately, I'm unable to test it, as I have an AMD GPU.
| Print GPU usage in conky |
1,511,577,491,000 |
Origanaly posted by RodrigoSQL on StackOverflow. I answered this question on StackOverflow but it was deleted
How do I make this border round?
Hello guys, I'm setting up Conky in the manjaro, but I would like to know if it is possible to leave the rounded corners indicated in the image Below enter image description here
My config:
--[[
# Minimalis Conky 1.3
# Author : archit3x
# Release date : 4 December 2020
# Tested on : Archlinux ARM - XFCE Desktop
# Email : [email protected]
# Feel free to modity this script ;)
]]
conky.config = {
alignment = 'top_right',
background = true,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'gray',
default_outline_color = 'white',
default_shade_color = 'white',
color1 = '#1793d1',
double_buffer = true,
draw_borders = yes,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
extra_newline = false,
xftalpha = 0.5,
draw_shades = true,
default_shade_color = 'black',
gap_x = 6,
gap_y = 38,
minimum_height = 250,
minimum_width = 220,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_x = true,
own_window = true,
own_window_class = 'conky',
own_window_transparent = yes,
own_window_argb_visual = true,
own_window_argb_value = 170,
own_window_type = 'Conky',
own_window_hints ='undecorated,sticky,below, skip_taskbar',
show_graph_range = false,
show_graph_scale = true,
stippled_borders = 1,
update_interval = 0.9,
uppercase = false,
use_spacer = 'false',
use_xft = true,
font = 'Fantasque Sans normal:size=9',
}
|
It does not appear to be possible with Minimalis Conky because conky.conf can't have a border option (all possible config lines).
You can round borders if you use lua, see here for example.
Here is an article on how to get lua working with Conky.
If you don't want to go and find the radius setting your self in the .lua file use the example theme I linked to above.
| How do I make this border round in conky Manjaro KDE? (Repost from "off topic" StackOverflow post) |
1,511,577,491,000 |
I am changing my vertical conky into a horizontal conky bar going across the top of my screen.
For the Name and CPU %, how do I set a max width column? I need to set a fixed width on Name CPU% so I bring the next column out past it with offset. Right now now it automatically expands to the end of the terminal edge.
conky.text = [[
${alignc} Darin's Computer <<<Gentoo>>> on $machine
$stippled_hr
${alignc}${color}Uptime:${color} $uptime ${color}
${voffset 10}${color }${color}CPU Temperature: ${color white}${exec sensors | grep Tctl | cut -c16-17} c
${color yellow}${cpugraph cpu0 40,500ffff00 ffffff}
${voffset -67} ${offset 545}${color }RAM Usage:${color white} $memperc
${offset 550}${color}${color yellow}${membar 8,500 /}
${offset 550}${color}File Systems:${color white} ${fs_used_perc /}
${offset 550}${color yellow}${fs_bar 8,500 /}
$color$stippled_hr
${voffset -105}${offset 1130}${color}Name ${alignr}CPU o/o #HERE IS WHERE I NEED TO SET A HARD WIDTH
${offset 1130}${color white} ${top name 1} ${alignr}${top cpu 1}
${offset 1130}${color yellow} ${top name 2} ${alignr}${top cpu 2}
${offset 1130}${color yellow} ${top name 3} ${alignr}${top cpu 3}
${offset 1130}${color yellow} ${top name 4} ${alignr}${top cpu 4}
${color}$stippled_hr
${offset 1300}${color}Networking:
Down:${color white} ${downspeed enp2s0} k/s${color white}
${color yellow}${downspeedgraph enp2s0 10,150 ffffff}
${color}${offset 5}Up:${color white} ${upspeed enp2s0} k/s
${color yellow}${upspeedgraph enp2s0 10,150 ffffff}
${color}Port(s) and Connections
$color Inbound: ${color white}${tcp_portmon 1 32767 count} ${color} Outbound: ${color white}${tcp_portmon 32768 61000 count} ${color}ALL: ${color white}${tcp_portmon 1 65535 count}
${color}Inbound Con. ${alignr} Port${color white}
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
|
One approach is to use a tab object to position the right-hand heading and use offsets to position the right-hand column top objects.
${offset 15}${color orange}Name${tab 160 15}CPU o/o
${offset 15}${color white}${top name 1}${offset 25}${top cpu 1}
${offset 15}${color yellow}${top name 2}${offset 25}${top cpu 2}
${offset 15}${color yellow}${top name 3}${offset 25}${top cpu 3}
${offset 15}${color yellow}${top name 4}${offset 25}${top cpu 4}
| conky - how to set a hard width limit to |
1,511,577,491,000 |
I am trying to get the distribution name and version number to enter into conky. I am currently using the following
rpm --query centos-release
resulting in
centos-release 7-4.1708.e17.centos.x86_64
How do I pare that down to just centos 7-4.1708.e17?
After trying all the suggestions I ended up entering this into my conky
${font Roboto:bold:size=8}${goto 95}${color1}Distribution $alignr ${execi > 60 a=$(rpm --query centos-release)
a=${a#centos-release }
a=${a%%\.centos.*}
echo "$a"}
with this result
centos-release-7-4.1708.e17
|
With sed:
$ rpm --query centos-release | sed 's/^centos-release//;s/\.centos.*//'
7-4.1708.e17
With only shell:
#!/bin/sh
a=$(rpm --query centos-release)
a=${a#centos-release }
a=${a%%\.centos.*}
echo "$a"
| bash command to get distribution and version only |
1,511,577,491,000 |
I am currently attempting to configure my Conky layout. I would like a very thin panel behind the text to go across a portion of my screen (something like 20 pixels high by 400 pixels wide).
Having fiddled with some settings, I can't seem to get the panel behind the text thin enough in the y-direction (things are fine in the x-direction, with the panel hugging the text closely). There seems to be about a ~5 to 6 pixel buffer above and below the text item. Note the buffer above and below the date text:
I commented out the text item itself, and it still displayed improperly.
I changed the border_inner_margin setting to 0 as well (and tried some other smaller values) to no avail.
Here is the .conkyrc file:
own_window yes
own_window_hints undecorated,below,skip_taskbar
background no
double_buffer yes
use_spacer no
use_xft yes
update_interval 3.0
draw_shades yes
draw_outline no
draw_borders no
uppercase no
border_width 0
border_inner_margin 0
default_color white
default_shade_color black
default_outline_color white
own_window_colour black
own_window_argb_visual yes
own_window_argb_value 80
alignment top_right
gap_x 0
gap_y 0
override_utf8_locale no
xftfont Terminus:size=8
xftalpha 0.8
TEXT
${offset 0}${color }${time %a, } ${color }${time %e %B %G}
|
I think the answer is quite simply that conky is taking literally what you provided in the TEXT section, and that is 3 lines of text! Simply remove the blank lines before and after your wanted output commands.
| Create a very thin conky window? |
1,304,322,391,000 |
I'm trying to write a script which will determine actions based on the architecture of the machine. I already use uname -m to gather the architecture line, however I do not know how many ARM architectures there are, nor do I know whether one is armhf, armel, or arm64.
As this is required for this script to determine whether portions of the script can be run or not, I am trying to find a simple way to determine if the architecture is armhf, armel or arm64. Is there any one-liner or simple command that can be used to output either armhf, armel, or arm64?
The script is specifically written for Debian and Ubuntu systems, and I am tagging as such with this in mind (it quits automatically if you aren't on one of those distros, but this could be applied in a much wider way as well if the command(s) exist)
EDIT: Recently learned that armel is dead, and arm64 software builders (PPA or virtual based) aren't the most stable. So I have a wildcard search finding arm* and assuming armhf, but it's still necessary to figure out a one liner that returns one of the three - whether it's a Ubuntu/Debian command or a kernel call or something.
|
On Debian and derivatives,
dpkg --print-architecture
will output the primary architecture of the machine it’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.
On RPM-based systems,
rpm --eval '%{_arch}'
will output the current architecture name (which may be influenced by other parameters, e.g. --target).
Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it’s possible to run armhf on a 64-bit ARM CPU. It’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel, or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).
| Easy command line method to determine specific ARM architecture string? |
1,304,322,391,000 |
I have a machine with both glibc i686 and x86_64, and a very annoying problem with glibc.
Is it normal to have two libraries of the same name installed on one computer? How can I know which library is executed?
Until recently, I believed that x86_64 was i686. Well, I must be mistaken but why?
[root@machin ~]# yum info glibc
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Excluding Packages in global exclude list
Finished
Installed Packages
Name : glibc
Arch : i686
Version : 2.5
Release : 42
Size : 12 M
Repo : installed
Summary : The GNU libc libraries.
License : LGPL
Description: The glibc package contains standard libraries which are used by
: multiple programs on the system. In order to save disk space and
: memory, as well as to make upgrading easier, common system code is
: kept in one place and shared between programs. This particular package
: contains the most important sets of shared libraries: the standard C
: library and the standard math library. Without these two libraries, a
: Linux system will not function.
Name : glibc
Arch : x86_64
Version : 2.5
Release : 42
Size : 11 M
Repo : installed
Summary : The GNU libc libraries.
License : LGPL
Description: The glibc package contains standard libraries which are used by
: multiple programs on the system. In order to save disk space and
: memory, as well as to make upgrading easier, common system code is
: kept in one place and shared between programs. This particular package
: contains the most important sets of shared libraries: the standard C
: library and the standard math library. Without these two libraries, a
: Linux system will not function.
[root@machin ~]# yum info glibc-common
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Excluding Packages in global exclude list
Finished
Installed Packages
Name : glibc-common
Arch : x86_64
Version : 2.5
Release : 42
Size : 64 M
Repo : installed
Summary : Common binaries and locale data for glibc
License : LGPL
Description: The glibc-common package includes common binaries for the GNU libc
: libraries, as well as national language (locale) support.
|
Technically, i686 is actually a 32-bit instruction set (part of the x86 family line), while x86_64 is a 64-bit instruction set (also referred to as amd64).
From the sound of it, you have a 64-bit machine that has 32-bit libraries for backwards compatibility. That should be totally fine.
| What is the difference between i686 and x86_64 packages? |
1,304,322,391,000 |
Does anyone know of a command that reports whether a system is Big Endian or Little Endian, or is the best option a technique like this using Perl or a string of commands?
Perl
# little
$ perl -MConfig -e 'print "$Config{byteorder}\n";'
12345678
# big
$ perl -MConfig -e 'print "$Config{byteorder}\n";'
87654321
od | awk
# little
$ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'
1
# big
$ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'
0
References
Perl Config documentation - byteorder
|
lscpu
The lscpu command shows (among other things):
Byte Order: Little Endian
Systems this is known to work on
CentOS 6
Ubuntu (12.04, 12.10, 13.04, 13.10, 14.04)
Fedora (17,18,19)
ArchLinux 2012+
Linux Mint Debian (therefore assuming Debian testing as well).
Systems this is known to not work on
Fedora 14
CentOS 5 (assuming RHEL5 because of this)
Why the apparent differences across distros?
After much digging I found out why. It looks like version util-linux version 2.19 was the first version that included the feature where lscpu shows you the output reporting your system's Endianness.
As a test I compiled both version 2.18 and 2.19 on my Fedora 14 system and the output below shows the differences:
util-linux 2.18
$ util-linux-ng-2.18/sys-utils/lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 4
Thread(s) per core: 2
Core(s) per socket: 2
CPU socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 37
Stepping: 5
CPU MHz: 1199.000
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
util-linux 2.19
$ util-linux-2.19/sys-utils/lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
CPU socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 37
Stepping: 5
CPU MHz: 2667.000
BogoMIPS: 5320.02
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
The above versions were downloaded from the kernel.org website.
util-linux-ng-2.18.tar.bz2
util-linux-2.19.tar.gz
| Is there a system command, in Linux, that reports the endianness? |
1,304,322,391,000 |
My goal is to be able to develop for embedded Linux. I have experience on bare-metal embedded systems using ARM.
I have some general questions about developing for different cpu targets. My questions are as below:
If I have an application compiled to run on a 'x86 target, linux OS version x.y.z', can I just run the same compiled binary on another system 'ARM target, linux OS version x.y.z'?
If above is not true, the only way is to get the application source code to rebuild/recompile using the relevant toolchain 'for example, arm-linux-gnueabi'?
Similarly, if I have a loadable kernel module (device driver) that works on a 'x86 target, linux OS version x.y.z', can I just load/use the same compiled .ko on another system 'ARM target, linux OS version x.y.z'?
If above is not true, the only way is to get the driver source code to rebuild/recompile using the relevant toolchain 'for example, arm-linux-gnueabi'?
|
No. Binaries must be (re)compiled for the target architecture, and Linux offers nothing like fat binaries out of the box. The reason is because the code is compiled to machine code for a specific architecture, and machine code is very different between most processor families (ARM and x86 for instance are very different).
EDIT: it is worth noting that some architectures offer levels of backwards compatibility (and even rarer, compatibility with other architectures); on 64-bit CPU's, it's common to have backwards compatibility to 32-bit editions (but remember: your dependent libraries must also be 32-bit, including your C standard library, unless you statically link). Also worth mentioning is Itanium, where it was possible to run x86 code (32-bit only), albeit very slowly; the poor execution speed of x86 code was at least part of the reason it wasn't very successful in the market.
Bear in mind that you still cannot use binaries compiled with newer instructions on older CPU's, even in compatibility modes (for example, you cannot use AVX in a 32-bit binary on Nehalem x86 processors; the CPU just doesn't support it.
Note that kernel modules must be compiled for the relevant architecture; in addition, 32-bit kernel modules will not work on 64-bit kernels or vice versa.
For information on cross-compiling binaries (so you don't have to have a toolchain on the target ARM device), see grochmal's comprehensive answer below.
| Are binaries portable across different CPU architectures? |
1,304,322,391,000 |
I'm familiar with lshw, /proc/cpuinfo, etc. But is there a method for getting at a CPU's CPUID opcode?
|
There's a tool called cpuid that one can use to query for much more detailed information than is typically present in lshw or /proc/cpuinfo. On my Fedora 19 system I was able to install the package with the following command:
$ sudo yum install cpuid
Once installed, cpuid is a treasure trove of details about ones underlying CPU.
Multiple versions
There are at least 2 versions of a tool called cpuid. On Debian/Ubuntu:
$ dpkg -p cpuid
Package: cpuid
Priority: optional
Section: admin
Installed-Size: 68
Maintainer: Ubuntu MOTU Developers <[email protected]>
Architecture: amd64
Version: 3.3-9
Depends: libc6 (>= 2.5-0ubuntu1)
Size: 11044
Description: Intel and AMD x86 CPUID display program
This program displays the vendor ID, the processor specific features,
the processor name string, different kinds of instruction set
extensions present, L1/L2 Cache information, and so on for the
processor on which it is running.
.
Homepage: http://www.ka9q.net/code/cpuid/
Original-Maintainer: Aurélien GÉRÔME <[email protected]>
While on CentOS/Fedora/RHEL:
$ rpm -qi cpuid
Name : cpuid
Version : 20130610
Release : 1.fc19
Architecture: x86_64
Install Date: Wed 29 Jan 2014 09:48:17 PM EST
Group : System Environment/Base
Size : 253725
License : MIT
Signature : RSA/SHA256, Sun 16 Jun 2013 12:30:11 PM EDT, Key ID 07477e65fb4b18e6
Source RPM : cpuid-20130610-1.fc19.src.rpm
Build Date : Sun 16 Jun 2013 05:39:24 AM EDT
Build Host : buildvm-13.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager : Fedora Project
Vendor : Fedora Project
URL : http://www.etallen.com/cpuid.html
Summary : Dumps information about the CPU(s)
Description :
cpuid dumps detailed information about x86 CPU(s) gathered from the CPUID
instruction, and also determines the exact model of CPU(s). It supports Intel,
AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC, NexGen, and Rise
CPUs.
NOTE: The output below will focus exclusively on Todd Allen's implementation of cpuid, i.e. the Fedora packaged one.
Example
The upper section is pretty standard stuff.
$ cpuid -1 | less
CPU:
vendor_id = "GenuineIntel"
version information (1/eax):
processor type = primary processor (0)
family = Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom, AMD Athlon/Duron, Cyrix M2, VIA C3 (6)
model = 0x5 (5)
stepping id = 0x5 (5)
extended family = 0x0 (0)
extended model = 0x2 (2)
(simple synth) = Intel Core i3 / i5 / i7 (Clarkdale K0) / Pentium U5000 Mobile / Pentium P4505 / U3405 / Celeron Mobile P4000 / U3000 (Arrandale K0), 32nm
miscellaneous (1/ebx):
process local APIC physical ID = 0x1 (1)
cpu count = 0x10 (16)
CLFLUSH line size = 0x8 (8)
brand index = 0x0 (0)
brand id = 0x00 (0): unknown
But the lower sections are much more enlightening.
feature information (1/edx):
x87 FPU on chip = true
virtual-8086 mode enhancement = true
debugging extensions = true
page size extensions = true
time stamp counter = true
RDMSR and WRMSR support = true
physical address extensions = true
machine check exception = true
CMPXCHG8B inst. = true
APIC on chip = true
SYSENTER and SYSEXIT = true
memory type range registers = true
PTE global bit = true
machine check architecture = true
conditional move/compare instruction = true
page attribute table = true
page size extension = true
processor serial number = false
CLFLUSH instruction = true
debug store = true
thermal monitor and clock ctrl = true
MMX Technology = true
FXSAVE/FXRSTOR = true
SSE extensions = true
SSE2 extensions = true
self snoop = true
hyper-threading / multi-core supported = true
therm. monitor = true
IA64 = false
pending break event = true
It'll show you details about your cache structure:
cache and TLB information (2):
0x5a: data TLB: 2M/4M pages, 4-way, 32 entries
0x03: data TLB: 4K pages, 4-way, 64 entries
0x55: instruction TLB: 2M/4M pages, fully, 7 entries
0xdd: L3 cache: 3M, 12-way, 64 byte lines
0xb2: instruction TLB: 4K, 4-way, 64 entries
0xf0: 64 byte prefetching
0x2c: L1 data cache: 32K, 8-way, 64 byte lines
0x21: L2 cache: 256K MLC, 8-way, 64 byte lines
0xca: L2 TLB: 4K, 4-way, 512 entries
0x09: L1 instruction cache: 32K, 4-way, 64-byte lines
Even more details about your CPU's cache:
deterministic cache parameters (4):
--- cache 0 ---
cache type = data cache (1)
cache level = 0x1 (1)
self-initializing cache level = true
fully associative cache = false
extra threads sharing this cache = 0x1 (1)
extra processor cores on this die = 0x7 (7)
system coherency line size = 0x3f (63)
physical line partitions = 0x0 (0)
ways of associativity = 0x7 (7)
WBINVD/INVD behavior on lower caches = false
inclusive to lower caches = false
complex cache indexing = false
number of sets - 1 (s) = 63
The list goes on.
References
cpuid - Linux tool to dump x86 CPUID information about the CPU(s)
CPUID - Wikipedia
sandpile.org - The world's leading source for technical x86 processor information
| Is there a way to dump a CPU's CPUID information? |
1,304,322,391,000 |
I don't know anything about CPUs. I have a 32-bit version of ubuntu. But I need to install 64-bit applications. I came to know that it is not possible to run 64-bit apps on 32 bit OS. So I decided to upgrade my os. But a friend of mine told me to check CPU specifications before the new upgrade. I run this command as was suggested on a website.
lscpu command gives the following details
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 23
Model name: Pentium(R) Dual-Core CPU E5300 @ 2.60GHz
Stepping: 10
CPU MHz: 1315.182
CPU max MHz: 2603.0000
CPU min MHz: 1203.0000
BogoMIPS: 5187.07
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 2048K
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm pti tpr_shadow vnmi flexpriority dtherm
In one word what does this mean? I want to know whether I can install 64-bit Ubuntu in my pc.
My installed RAM is 2GB. Since my system is more than 10 years old I expect some expert advice on my CPU status. Should I buy a new pc? Or can I stick with my old one?
I already checked this. But I expect some thing easier.
https://unix.stackexchange.com/a/77724/413713
(I can share any information regarding my hardware, only tell me how to collect them).
Thanks in advance. Sorry for bad english
|
Intel’s summary of your CPU’s features confirms that it supports 64-bit mode, as indicated by
CPU op-mode(s): 32-bit, 64-bit
in lscpu’s output.
This isn’t an Atom CPU either, so the rest of your system is, in all likelihood, capable of supporting a 64-bit operating system.
You can re-install a 64-bit variant of your operating system, or you could use Ubuntu’s multiarch support: install a 64-bit kernel, add the amd64 architecture, and you will then be able to install and run 64-bit software without re-installing everything:
sudo dpkg --add-architecture amd64
sudo apt-get update
sudo apt-get install linux-image-generic:amd64
(followed by a reboot).
| Can I run 64 bit ubuntu on my pc (>10 years old) |
1,304,322,391,000 |
The output from uname:
root@debian:~ # uname -a
Linux 5asnb 2.6.32-5-amd64 #1 SMP Mon Jun 13 05:49:32 UTC 2011 x86_64 GNU/Linux
However the /sbin/init executable shows up as 32-bit:
root@debian:~ # file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
Other aspects of the system seem to contradict things as well:
root@debian:~ # echo $HOSTTYPE
i486
root@debian:~ # getconf LONG_BIT
32
|
The 64bit kernel can be installed on Debian 32bit. You can see that the amd64 kernel is available for 32bit Debian on it's package page. This can be used as an alternative to using a PAE enabled kernel to support more than 4G of total RAM. Note that 32bit binaries still can not access more than roughly 3G of RAM per process.
| 64-bit kernel, but all 32-bit ELF executable running processes, how is this? |
1,304,322,391,000 |
I am trying to learn operating system concepts. Here is two simple python code:
while True:
pass
and this one:
from time import sleep
while True:
sleep(0.00000001)
Question: Why when running first code CPU usage is 100% but when running the second one it is about 1% to 2% ? I know it may sounds stupid but why we can not implement something like sleep in user space mode without using sleep system call ?
NOTE: I have tried to understand sleep system call from linux kernel but TBH I didn't understand what happens there. I also search about NOP assembly code and turns out that it is not really doing nothing but doing something useless (like xchg eax, eax) and maybe this is that cause of 100% CPU usage. but I am not sure.
What exactly assembly code for sleep system call that we can't do it in user space mode? Is it something like HLT
I also tried to use HLT assembly in code like this:
section .text
global _start
_start:
hlt
halter:
jmp _start
section .data
msg db 'Hello world',0xa
len equ $ - msg
but after running this code I see kernel general protection fault like this:
[15499.991751] traps: hello[22512] general protection fault ip:401000 sp:7ffda4e83980 error:0 in hello[401000+1000]
I don't know maybe this is related to protection ring or my code is wrong? The other question here is that OS is using HLT or other protected assembly commands under beneath sleep system call or not?
|
Why when running first code CPU usage is 100% but when running the second one it is about 1% to 2% ?
Because the first is a "busy loop": You are always executing code. The second tells the OS that this particular process wants to pause (sleep), so the OS deschedules the process, and if nothing else is using CPU, the CPU becomes idle.
I also search about NOP assembly code and turns out that it is not really doing nothing
Well, NOP = no operation: It is actively executing code that has no effect. Which you can use to pad code, but not to put the CPU in a low power state.
What exactly assembly code for sleep system call that we can't do it in user space mode?
Modern OS on x86 CPUs use mwait. Other CPU architectures use other commands.
but after running this code I see kernel general protection fault like this
That's because the OS is supposed to do this in supervisor mode. As I wrote above, the OS needs to be able to keep scheduling processes, so a process itself isn't allowed to put the CPU to idle mode.
The other question here is that OS is using HLT or other protected assembly commands under beneath sleep system call
Yes, it does. Though it's not executed during the sleep call, but inside the scheduler loop, when the scheduler detects that there are no processes that want to run.
One question for the first part. If I use very little slot of time i.e: sleep(0.0000000000000001) is scheduler still go to the next process?
For the actual OS syscalls, see man 3 sleep (resolution in seconds), man usleep (resolution in microseconds), and man nanosleep (resolution in nanoseconds`).
No matter what floating point number you use in your python code, you won't get a better resolution than the syscall used by python (whichever variant it is).
The manpages say "suspends execution of the calling thread for (at least) usec microseconds." etc., so I'd assume it gets descheduled even if the delay is zero (and then immediately rescheduled), but I didn't test that, nor did I read the kernel code.
.
| What is difference between sleep and NOP in depth? |
1,304,322,391,000 |
I am getting a series of errors similar to this
file /usr/share/doc/glibc/NEWS from install of glibc-2.25-10.fc26.i686 conflicts with file from package glibc-2.25-7.fc26.x86_64
when I try to dnf update, and a Python exception when I dnf install anything. These are a new errors that appeared at the same time, possibly related to a power failure I suffered yesterday in the middle of a dnf update, although the history log appears to suggest it had finished, with some errors, before the power went out.
Full errors for a current dnf update:
Error: Transaction check error:
file /usr/share/doc/glibc/NEWS from install of glibc-2.25-10.fc26.i686 conflicts with file from package glibc-2.25-7.fc26.x86_64
file /usr/share/man/man1/xmlwf.1.gz from install of expat-2.2.4-1.fc26.i686 conflicts with file from package expat-2.2.1-1.fc26.x86_64
file /usr/share/doc/sqlite-libs/README.md from install of sqlite-libs-3.20.1-1.fc26.i686 conflicts with file from package sqlite-libs-3.19.3-1.fc26.x86_64
file /usr/share/doc/gdk-pixbuf2/NEWS from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/cs/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/de/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/es/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/fr/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/fur/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/gl/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/hu/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/id/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/kk/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/lt/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/pl/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/pt_BR/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/sl/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/sr/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/sr@latin/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/sv/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/locale/tr/LC_MESSAGES/gdk-pixbuf.mo from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/man/man1/gdk-pixbuf-query-loaders.1.gz from install of gdk-pixbuf2-2.36.9-1.fc26.i686 conflicts with file from package gdk-pixbuf2-2.36.7-1.fc26.x86_64
file /usr/share/doc/libidn2/README.md from install of libidn2-2.0.4-1.fc26.i686 conflicts with file from package libidn2-2.0.2-1.fc26.x86_64
file /usr/share/doc/libidn2/NEWS from install of libidn2-2.0.4-1.fc26.i686 conflicts with file from package libidn2-2.0.2-1.fc26.x86_64
file /usr/share/info/libidn2.info.gz from install of libidn2-2.0.4-1.fc26.i686 conflicts with file from package libidn2-2.0.2-1.fc26.x86_64
file /usr/share/man/man1/idn2.1.gz from install of libidn2-2.0.4-1.fc26.i686 conflicts with file from package libidn2-2.0.2-1.fc26.x86_64
file /usr/share/man/man5/cert8.db.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/cert9.db.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/key3.db.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/key4.db.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/pkcs11.txt.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/secmod.db.5.gz from install of nss-3.32.0-1.1.fc26.i686 conflicts with file from package nss-3.30.2-1.1.fc26.x86_64
file /usr/share/man/man5/k5identity.5.gz from install of krb5-libs-1.15.1-25.fc26.i686 conflicts with file from package krb5-libs-1.15.1-17.fc26.x86_64
file /usr/share/man/man5/k5login.5.gz from install of krb5-libs-1.15.1-25.fc26.i686 conflicts with file from package krb5-libs-1.15.1-17.fc26.x86_64
file /usr/share/man/man5/krb5.conf.5.gz from install of krb5-libs-1.15.1-25.fc26.i686 conflicts with file from package krb5-libs-1.15.1-17.fc26.x86_64
file /usr/share/doc/wine-core/AUTHORS from install of wine-core-2.15-1.fc26.i686 conflicts with file from package wine-core-2.12-1.fc26.x86_64
file /usr/share/doc/wine-core/VERSION from install of wine-core-2.15-1.fc26.i686 conflicts with file from package wine-core-2.12-1.fc26.x86_64
file /usr/share/doc/wine-core/ANNOUNCE from install of wine-core-2.15-1.fc26.i686 conflicts with file from package wine-core-2.12-1.fc26.x86_64
file /usr/share/doc/pango/NEWS from install of pango-1.40.11-3.fc26.i686 conflicts with file from package pango-1.40.7-1.fc26.x86_64
file /usr/share/man/man1/pango-view.1.gz from install of pango-1.40.11-3.fc26.i686 conflicts with file from package pango-1.40.7-1.fc26.x86_64
file /usr/share/doc/gtk3/README from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/doc/gtk3/NEWS from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/cs/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/de/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/es/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/fi/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/fr/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/fur/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/gl/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/hr/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/id/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/kk/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/lt/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/ne/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/pl/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/pt_BR/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/sk/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/sl/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/sr/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/locale/sr@latin/LC_MESSAGES/gtk30.mo from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/man/man1/broadwayd.1.gz from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/man/man1/gtk-launch.1.gz from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/man/man1/gtk-query-immodules-3.0.1.gz from install of gtk3-3.22.19-1.fc26.i686 conflicts with file from package gtk3-3.22.17-2.fc26.x86_64
file /usr/share/doc/libsoup/NEWS from install of libsoup-2.58.2-1.fc26.i686 conflicts with file from package libsoup-2.58.1-2.fc26.x86_64
file /usr/share/doc/libgusb/NEWS from install of libgusb-0.2.11-1.fc26.i686 conflicts with file from package libgusb-0.2.10-1.fc26.x86_64
file /usr/share/doc/p11-kit/NEWS from install of p11-kit-0.23.8-1.fc26.i686 conflicts with file from package p11-kit-0.23.5-3.fc26.x86_64
file /usr/share/man/man1/trust.1.gz from install of p11-kit-0.23.8-1.fc26.i686 conflicts with file from package p11-kit-0.23.5-3.fc26.x86_64
file /usr/share/man/man5/pkcs11.conf.5.gz from install of p11-kit-0.23.8-1.fc26.i686 conflicts with file from package p11-kit-0.23.5-3.fc26.x86_64
file /usr/share/man/man8/p11-kit.8.gz from install of p11-kit-0.23.8-1.fc26.i686 conflicts with file from package p11-kit-0.23.5-3.fc26.x86_64
Error Summary
-------------
Error from dnf install [anything]:
Last metadata expiration check: 0:15:05 ago on Tue 05 Sep 2017 11:09:50 AEST.
Traceback (most recent call last):
File "/bin/dnf", line 58, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
errcode = main(args)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
return cli_run(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
cli.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 962, in run
return self.command.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/install.py", line 120, in run
self.base.install(pkg_spec, strict=strict, forms=forms)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 1582, in install
subj._is_arch_specified(self.sack):
File "/usr/lib/python3.6/site-packages/dnf/subject.py", line 71, in _is_arch_specified
q = self._nevra_to_filters(sack.query(), nevra)
File "/usr/lib/python3.6/site-packages/dnf/subject.py", line 49, in _nevra_to_filters
query._filterm(*flags, **{name + '__glob': attr})
File "/usr/lib/python3.6/site-packages/dnf/query.py", line 93, in _filterm
return super(Query, self)._filterm(*args, **nargs)
AttributeError: 'super' object has no attribute '_filterm'
Errors from the end of dnf history info 52 (the update before the power failure):
Scriptlet output:
1 warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-5.b01.fc26.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-5.b01.fc26.x86_64/jre/lib/security/java.security.rpmnew
2 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
3 error: cannot open Packages index using db5 - (-30969)
4 error: cannot open Packages database in /var/lib/rpm
5 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
6 error: cannot open Packages index using db5 - (-30969)
7 error: cannot open Packages database in /var/lib/rpm
8 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
9 error: cannot open Packages index using db5 - (-30969)
10 error: cannot open Packages database in /var/lib/rpm
11 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
12 error: cannot open Packages index using db5 - (-30969)
13 error: cannot open Packages database in /var/lib/rpm
14 restored /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-5.b01.fc26.x86_64/jre/lib/security/java.security.rpmnew to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-5.b01.fc26.x86_64/jre/lib/security/java.security
|
I got past the Python exception by booting from a live USB, and using dnf --installroot=/mnt/fedora; the package conflicts kept coming, including errors when I tried to dnf remove --duplicates or even trying to remove packages one-by-one. So I ended up deciding the system was not fixable, and reinstalling Fedora - along with finally getting around to setting up snapper so there's an easy fix next time something like this happens.
| dnf error conflicting packages between i686 and x86_64 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.