r/linux_programming • • Sep 10 '19

Getting, modifying, and setting ICC profiles

9 Upvotes

I'm trying to find a way to get a monitors ICC profile, modify it (in this case color saturation), and then set the monitor to use the new ICC profile programmatically.

The reason I'm trying to do this is to create a replacement for a windows only application called VibranceGUI which changes the current color saturation automatically when certain programs are started by interfacing with the currently used GPU, but I've not been able to find a way to do this with anything but nvidia gpus, and only by using system calls to call `nvidia-settings`. I've been looking for a way to do this with other GPUs but the only way I can come up with is to just directly set the ICC profile. Any idea on how this can be done?

Note: If anyone is interested this is the repo for the project

https://gitlab.com/zee220/vibrantlinux


r/linux_programming • • Jun 13 '19

Help with syntax

9 Upvotes

Hi. Since some time i wanted to organize my files in Google Drive. I'm using the CLI programm gdrive. It is a quite powerful tool. I'm asking here because it seems more or less to be a syntax error on my side. I found that code and tried to understand it. Atleast the part which isn't on linux. Here is the code:

gdrive.exe list -q "'FOLDER_ID' in parents" | cut -d" " -f1 - | xargs -n 1 gdrive.exe update "-p PARENT_ID"

gdrive.exe (i'm on windows using linux bash) is the application.

list = list all files/folders inside the choosen folder. -q = query

"'FOLDER_ID' in parents" = in "FOLDER_ID" i need to insert the folder id from GDrive and 'in parents' means all files inside.

gdrive.exe list -q "'FOLDER_ID' in parents" = Basically list all files inside the folder.

cut -d" " -f1 - = some cutting

xargs -n 1 gdrive.exe update "-p PARENT_ID" I'm trying to "paste" the file ids into the section after gdrive.exe update. Here normally i need to insert the file id which i want to edit.

gdrive.exe update "-p PARENT_ID" = update is a command to update some meta and "-p PARENT_ID" here i need to insert the folder id i want the folder to exist. Google Drive allows files/folders to have multiple locations and with update -p i can add a "parent folder" that is how it called. I hope you understood what i mean. Basically i want all files from a folder to appear also in a different folder.

I'm getting an error where it says "File not dound: FILE_ID" - The ID of the file is been shown, that's what i mean. So in some way it is working. Thanks if someone understood it. Here is where i got the idea from: https://github.com/gdrive-org/gdrive/issues/422


r/linux_programming • • May 26 '19

What things do I need to complete this?

9 Upvotes

I am learning a bit of programming, with Python, Bash scripting, etc. I want to create a program for Linux, and I have the basic idea for it. It will be a diary, journal-writing program, with some features like, adding photos, encryption for entries, and maybe even Markdown.

Since I have had no experience with this, I would really appreciate it if you guys could tell me what are the things I would require to create this program. I know I can write the basic program in Python, but the main part I am concerned about is the GUI. I have not much idea how to make that work.

Thanks in advance!


r/linux_programming • • Nov 01 '18

How to write cross-platform packet capture tool from scratch in 1000LOC.

Thumbnail
medium.com
9 Upvotes

r/linux_programming • • Dec 16 '17

PIXterm: Draw images in your ANSI terminal with true color [v1.2.0 => New Dithering Mode]

Thumbnail
github.com
9 Upvotes

r/linux_programming • • Mar 11 '17

CTF competition tomorrow any experience/advice?

Thumbnail
pastebin.com
9 Upvotes

r/linux_programming • • Oct 30 '16

An Enigma machine implemented as a char device

Thumbnail
github.com
9 Upvotes

r/linux_programming • • Jul 09 '16

i created a new debugger for osdev, it support asm/c/c++ level debugging with advanced features such as exception/call/full instrumentation profiling

Thumbnail github.com
9 Upvotes

r/linux_programming • • Apr 01 '16

A new tool of choice for your C++ Linux development

Thumbnail
blogs.msdn.microsoft.com
9 Upvotes

r/linux_programming • • Oct 23 '15

release rr (record-and-replay debugging tool) 4.0 Released With Reverse Execution

Thumbnail
robert.ocallahan.org
9 Upvotes

r/linux_programming • • Mar 10 '15

Using System Tap to test the GNU C Library

Thumbnail
developerblog.redhat.com
9 Upvotes

r/linux_programming • • Jan 14 '15

The "too small to fail" memory-allocation rule

Thumbnail
lwn.net
9 Upvotes

r/linux_programming • • Aug 21 '14

Linux Performance (collection of useful material)

Thumbnail
brendangregg.com
9 Upvotes

r/linux_programming • • Nov 01 '25

Looking for feedback : a GUI around ptrace to teach the basics of system calls

Thumbnail
reddit.com
8 Upvotes

r/linux_programming • • Jul 16 '25

What logging library do you use in C++ applications?

8 Upvotes

I'm currently using syslog. I'm thinking about trying something that doesn't integrate logs from multiple applications. Did you switch away from or to syslog and can you share why? Thank you


r/linux_programming • • Jun 15 '25

How can I do low level access to game controllers on Linux?

8 Upvotes

So, here is the thing. I bought a controller called PXN P5. Now, this controller has 2 back buttons and a gyro sensor. The thing is, when connected to Xinput mode, it is recognized as a Microsoft Xbox 360 controller which, has none of those features. In order to be able to use the gyro, we have to use it's switch mode (because as much as I HATE Nintendo, their controllers have gyro) to make the controller be recognized an a Switch Pro controller.

So, here is the question. Is there a way to get a low level access to the gamepad and get its signals? If that's possible, this should in theory allow me to use the whole feature set of the controller, with the good latency (beacuse the switch mode has a worse one). Any ideas?


r/linux_programming • • Jan 20 '24

How might I replace the desktop with a full screen terminal?

8 Upvotes

Let me start by being very clear: I do not want to simply maximize my terminal window or use a full screen terminal like you get with Ctrl+Alt+F1. I want to replace the desktop with a full screen terminal.

I want to be able to run GUI apps and have a dock, but I want an honest to god terminal behind all of it, not a desktop.

I'm also not interested in maximizing a terminal and configuring it to always be below other windows.

Partly this is a UX experiment and partly I want to learn how to mess around in the code for Desktop Environments.

I'm hoping someone can give me suggestions as to which DE's might be easiest to modify for this purpose and how I might go about it.


r/linux_programming • • Sep 26 '23

barco: Linux Containers From Scratch in C.

Thumbnail
cavall.in
8 Upvotes

r/linux_programming • • May 21 '23

Terminal widget toolkit FINAL CUT 0.9.0 released – performance improvements and new features

Thumbnail self.linux
8 Upvotes

r/linux_programming • • May 13 '23

A whirlwind tour of the LLVM optimizer

Thumbnail
slideshare.net
8 Upvotes

r/linux_programming • • Apr 13 '23

The early days of Linux [LWN.net]

Thumbnail lwn.net
8 Upvotes

r/linux_programming • • Apr 11 '23

Nolibc: a minimal C-library replacement shipped with the kernel [LWN.net]

Thumbnail lwn.net
8 Upvotes

r/linux_programming • • Feb 13 '23

How to create portable Linux binaries (even if you need a recent compiler)

Thumbnail
blog.gibson.sh
8 Upvotes

r/linux_programming • • Dec 03 '22

Cheap SSD: Slow Speed Issue

8 Upvotes

In the beginning of the year I've bought a cheap SSD SomnAmbulist 120GB. After a couple of benchmarks, I've noted some strange throughput measurements. Briefly:

  • Initial Benchmark | image
    Just after format, the throughput is according to the advertised specifications at 510MB/s read and 440MB/s write.
    It starts to drop at 35% capacity written and stabilizes at 200~300MB/s read and 40MB/s write.
    Although this drop is not mentioned by the seller's ads, it is indeed an expected behavior and should return to normal after a couple of minutes in idle (flush the cache into the permanent area).

  • Benchmark after 1 hour in idle | image
    Unfortunately, the throughput has not returned to normal (yet?).
    315MB/s read and 440MB/s write, and the speed drop started earlier at 10% capacity written.

  • Benchmark after 12 hours in idle | image
    The throughput still has not returned to normal.

Questions

  1. Is this the expected behavior for such cheap SSD or indeed there is something strange?

  2. What might be going wrong here?

  3. Any idea how to fix this throughput?


Debug Info

  • SSD/TRIM Supported

  • fstrim enabled

  • SSD APM (Advanced Power Management) not supported

  • f3 (Fight Flash Fraud) OK

## SSD/TRIM SUPPORTED
root@debian:~# hdparm -I /dev/sda | grep -i "trim\|power"
       *	Power Management feature set
       *	Data Set Management TRIM supported (limit 8 blocks)
       *	Deterministic read data after TRIM


## SSD/TRIM AVAILABLE (DISC-MAX NON ZERO)
root@debian:~# lsblk -D /dev/sda
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda         0      512B       2G         0


## ADVANCED POWER MANAGEMENT NOT SUPPORTED
root@debian:~# hdparm -B /dev/sda

/dev/sda:
 APM_level	= not supported



## FSTRIM ENABLE

root@debian:~# systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
     Active: active (waiting) since Sat 2022-12-03 03:36:10 UTC; 35min ago
    Trigger: Mon 2022-12-05 00:51:25 UTC; 1 day 20h left
   Triggers: ● fstrim.service
       Docs: man:fstrim

Dec 03 03:36:10 debian systemd[1]: Started Discard unused blocks once a week.


root@debian:~# systemctl status fstrim
● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
     Loaded: loaded (/lib/systemd/system/fstrim.service; static)
     Active: inactive (dead)
TriggeredBy: ● fstrim.timer
       Docs: man:fstrim(8)


root@debian:~# fstrim -av