<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saramsh Shrestha</title>
    <description>The latest articles on DEV Community by Saramsh Shrestha (@troublesomesaramsh789).</description>
    <link>https://dev.to/troublesomesaramsh789</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F783632%2F9b9a7b28-55ac-437c-bfb8-65678cd298ca.jpeg</url>
      <title>DEV Community: Saramsh Shrestha</title>
      <link>https://dev.to/troublesomesaramsh789</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/troublesomesaramsh789"/>
    <language>en</language>
    <item>
      <title>Fix brightness not working in linux | Gamming laptop | AMD + nVidia (hybrid gpu).</title>
      <dc:creator>Saramsh Shrestha</dc:creator>
      <pubDate>Thu, 17 Jul 2025 14:50:44 +0000</pubDate>
      <link>https://dev.to/troublesomesaramsh789/linux-fix-brightness-not-working-in-gaming-laptops-hybrid-gpu-3k8a</link>
      <guid>https://dev.to/troublesomesaramsh789/linux-fix-brightness-not-working-in-gaming-laptops-hybrid-gpu-3k8a</guid>
      <description>&lt;p&gt;There was a moment in your life that you want to make a switch to linux but no matter which kernal or distro you used. Brightness sliders does not work properly. I was facing the same issue too. I have fixed this issues after few hours of debugging and now you can too without loosing hours or days. &lt;/p&gt;

&lt;p&gt;My config: &lt;/p&gt;

&lt;p&gt;Laptop: Asus TUF A15, Ryzen 6800HS with RTX2050&lt;/p&gt;

&lt;p&gt;OS: Fedora 42 KDE&lt;/p&gt;

&lt;p&gt;Steps 1: Check what controller your display backlight is using.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /sys/class/backlight

//output
nvidia_wmi_ec_backlight
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can have other output: &lt;code&gt;intel_backlight&lt;/code&gt;, &lt;code&gt;acpi_video0&lt;/code&gt; or &lt;code&gt;nvidia_wmi_ec_backlight&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Step 2: Lets first identify you GPUs first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lspci | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"VGA|3D"&lt;/span&gt;

//output
01:00.0 VGA compatible controller: NVIDIA Corporation GA107 &lt;span class="o"&gt;[&lt;/span&gt;GeForce RTX 2050] &lt;span class="o"&gt;(&lt;/span&gt;rev a1&lt;span class="o"&gt;)&lt;/span&gt;

05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. &lt;span class="o"&gt;[&lt;/span&gt;AMD/ATI] Rembrandt &lt;span class="o"&gt;[&lt;/span&gt;Radeon 6
80M] &lt;span class="o"&gt;(&lt;/span&gt;rev c8&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have AMD Radeon build in and Nvidia graphics. My screen backlight is controlled by AMD Radeon graphics so I have to change the backlight controller. This is done by changing the GRUB Configuration.&lt;/p&gt;

&lt;p&gt;Step 3: Lets modify the GRUB config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/default/grub

// Search and Replace this config
&lt;span class="nv"&gt;GRUB_CMDLINE_LINUX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"rhgb quiet acpi_backlight=native amdgpu.backlight=0 nvidia-drm.modeset=1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see I have change the config based on my internal GPU as its AMD. You can this based on you config.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;// First Try This:
&lt;span class="nv"&gt;GRUB_CMDLINE_LINUX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"quiet splash acpi_backlight=native"&lt;/span&gt;

// Second Try This:
&lt;span class="nv"&gt;GRUB_CMDLINE_LINUX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"quiet splash acpi_backlight=vendor"&lt;/span&gt;

// These are final options to force use built &lt;span class="k"&gt;in &lt;/span&gt;graphics

// For intel forced intel &lt;span class="nb"&gt;builtin &lt;/span&gt;graphics
&lt;span class="nv"&gt;GRUB_CMDLINE_LINUX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"quiet splash acpi_backlight=native i915.enable_dpcd_backlight=1"&lt;/span&gt;

// For Intel Nvidia Hybrid
&lt;span class="nv"&gt;GRUB_CMDLINE_LINUX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"quiet splash acpi_backlight=vendor nvidia.NVreg_EnableBacklightHandler=1"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should try multiple times which one works for you.&lt;/p&gt;

&lt;p&gt;Step 4: Save the config and reboot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;update-grub       &lt;span class="c"&gt;# Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;grub2-mkconfig &lt;span class="nt"&gt;-o&lt;/span&gt; /boot/grub2/grub.cfg   &lt;span class="c"&gt;# Fedora/RHEL&lt;/span&gt;

// For Reboot
reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should apply appropriate command to update the GRUB then reboot the system.&lt;/p&gt;

&lt;p&gt;Try each config until one works for you. Then each iteration that correct backlight drivers are used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /sys/class/backlight

//output
amdgpu_bl2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mine is changed from &lt;code&gt;nvidia_wmi_ec_backlight&lt;/code&gt; to &lt;code&gt;amdgpu_b12&lt;/code&gt;. Now my laptop display brightness slider is working fine. &lt;/p&gt;

&lt;p&gt;You can use tools like &lt;code&gt;brightnessctl&lt;/code&gt; and &lt;code&gt;xrand&lt;/code&gt; if they works out for you. Sometimes they might work any config.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>fedora</category>
      <category>asuslaptop</category>
      <category>brightnessfix</category>
    </item>
    <item>
      <title>Increase your Code Quality “Blazing Fast”</title>
      <dc:creator>Saramsh Shrestha</dc:creator>
      <pubDate>Fri, 04 Nov 2022 14:10:29 +0000</pubDate>
      <link>https://dev.to/troublesomesaramsh789/increase-your-code-quality-blazing-fast-3437</link>
      <guid>https://dev.to/troublesomesaramsh789/increase-your-code-quality-blazing-fast-3437</guid>
      <description>&lt;p&gt;I have been coding for the past 2 yrs and these are some simple things I have observed to increase readability “blazing fast”. Code readability increases maintainability and code quality.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Decrease the Code Size
&lt;/h3&gt;

&lt;p&gt;We have all been through some code where we have to scroll to the infinite to find that one function. So to avoid that keep your code between 100–500 lines of code per file. Split the file into multiple files and separate the files into their proper directory and filename. Any code with more than 500 lines is really hard to read, scroll and understand.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Split the files and keep 100–500 lines of code per file.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Name Variables Properly
&lt;/h3&gt;

&lt;p&gt;There is no strict rule for naming a variable but there are some most used methods for consistency. Make functions, classes, constants, and Interface properly based on functionality.&lt;/p&gt;

&lt;p&gt;Don’t name variables like (a,b, i, j,k, one, s1, p1) or something similar, and use camelCase for variable names compose of multiple words.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Constants:&lt;/strong&gt; Use all uppercase names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const DATABASE = "ANIME";
const _USERNAME = "BLEACH";
const PASSWORD_FOR_BLEACH = "RANGIKU";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For Interface:&lt;/strong&gt; The interface name starts with I (for interface).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface IShape {
    area: number
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For Classes:&lt;/strong&gt; Class names should start with a capital letter. I use the same method for functions that are exported.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Shape extends IShape {
    //...
}

export function GetAll() {
    //...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Keep variable’s name meaningful and consistent.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. DRY (Do Not Repeat Yourself)
&lt;/h3&gt;

&lt;p&gt;Programming at its core is to solve repetitive problems. Reduce the copy paste past as much as possible. “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.” We can achieve DRY by creating functions and classes to make sure that any logic should be written in only one place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not repeat yourself, use functions or classes to reduce code repetition.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. KISS (Keep It Simple, Stupid)
&lt;/h3&gt;

&lt;p&gt;A simple design makes service and maintenance a lot easier. Try not to make the code any more complex than necessary.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Keep your code as simple as possible.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  5. Be Empathetic
&lt;/h3&gt;

&lt;p&gt;Try to write the code from the maintainer's point of view. We should help each other out by increasing the code by making it better than you found.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Contribute to making code better than you found it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  6. Comments.
&lt;/h3&gt;

&lt;p&gt;Good code is code that does not need any documentation. Try not to comment everywhere and let the variable names and function names document themselves but there are exceptions. Add comments for places where it’s complex to understand. Better Comments Extension can help on this one.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Less amount of comments the better.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  7. Use Prettier or Code Formatter’s.
&lt;/h3&gt;

&lt;p&gt;Consistently using the same style throughout your code makes it easier to read. Code that is easy to read is easier to understand by you as well as by potential collaborators. Therefore, adhering to a coding style reduces the risk of mistakes and makes it easier to work together on software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use code formatter.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Using a readme.md file to add more detail about your project is a really good way to increase the maintainability of the code.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Want to learn more
&lt;/h3&gt;

&lt;p&gt;Learn more about SOLID design principles and the book clean code by uncle bob.&lt;/p&gt;

&lt;p&gt;Article on SOLID Principles: [&lt;a href="https://blog.bitsrc.io/solid-principles-in-typescript-153e6923ffdb" rel="noopener noreferrer"&gt;https://blog.bitsrc.io/solid-principles-in-typescript-153e6923ffdb&lt;/a&gt;]&lt;/p&gt;

</description>
      <category>cleancode</category>
      <category>kiss</category>
      <category>dry</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
