<?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: Raymel Francisco</title>
    <description>The latest articles on DEV Community by Raymel Francisco (@raymelon).</description>
    <link>https://dev.to/raymelon</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%2F13861%2Fc6ff6369-ce5c-4b5c-92dc-2fac8e12e67f.png</url>
      <title>DEV Community: Raymel Francisco</title>
      <link>https://dev.to/raymelon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raymelon"/>
    <language>en</language>
    <item>
      <title>Work with a dev agency! Better yet, start one!</title>
      <dc:creator>Raymel Francisco</dc:creator>
      <pubDate>Tue, 16 Apr 2024 05:00:00 +0000</pubDate>
      <link>https://dev.to/raymelon/work-with-a-dev-agency-better-yet-start-one-5gp4</link>
      <guid>https://dev.to/raymelon/work-with-a-dev-agency-better-yet-start-one-5gp4</guid>
      <description>&lt;p&gt;Running a dev agency allows you to experience both corporate and startup cultures, but..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jz6myws2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1523240795612-9a054b0db644%3Fq%3D80%26w%3D2070%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jz6myws2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1523240795612-9a054b0db644%3Fq%3D80%26w%3D2070%26auto%3Dformat%26fit%3Dcrop%26ixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D" alt="image" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;br&gt;
Photo by &lt;a href="https://unsplash.com/@priscilladupreez?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Priscilla Du Preez 🇨🇦&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/three-men-laughing-while-looking-in-the-laptop-inside-room-XkKCui44iM0?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Unsplash&lt;/a&gt;&lt;br&gt;
&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post is originally posted on &lt;a href="https://levelup.news/blog/what-i-learned-working-for-a-dev-agency/"&gt;Level Up! Founders&lt;/a&gt; and also posted on &lt;a href="https://raymel.hashnode.dev/work-with-a-dev-agency-better-yet-start-one"&gt;Hashnode&lt;/a&gt; and &lt;a href="https://www.linkedin.com/pulse/work-dev-agency-better-yet-start-one-raymel-francisco-d5itc"&gt;LinkedIn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Maybe you're a new dev, or an aspiring one, or simply deciding which path to take.&lt;/p&gt;

&lt;p&gt;Is it really true that working on a dev agency allows you to experience it all? Is that enough to consider it a legitimate path?&lt;/p&gt;

&lt;p&gt;Let me share my experience with you:&lt;/p&gt;

&lt;h3&gt;
  
  
  Working with a dev agency
&lt;/h3&gt;

&lt;p&gt;For six years, I worked as a software developer — for a dev agency.&lt;/p&gt;

&lt;p&gt;Working with a dev agency has exposed me to various types of working environment: remote, occasional field work, and of course, the usual office setting.&lt;/p&gt;

&lt;p&gt;Field work is one of my favorites.&lt;/p&gt;

&lt;p&gt;One memorable moment I had was visiting the students of an indigenous institution. It's when our dev agency helped our client launch a literacy app in partnership of the indigenous institution itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tLr1ScVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713339726/P_20180913_170734_nispjc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tLr1ScVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713339726/P_20180913_170734_nispjc.jpg" alt="img" width="473" height="840"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wXNWkJYr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713339713/P_20180914_112223-01_aq60ii.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wXNWkJYr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713339713/P_20180914_112223-01_aq60ii.jpg" alt="img" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wywasg3F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713278879/V_20180914_102016-ezgif.com-video-to-gif-converter_bifb9b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wywasg3F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://res.cloudinary.com/dxsornfee/image/upload/v1713278879/V_20180914_102016-ezgif.com-video-to-gif-converter_bifb9b.gif" alt="gif" width="600" height="1067"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of these exposure came from the nature of a dev agency — offering dev services. This allows a dev agency to service clients from different types of businesses. Everything is digital and online these days, right?&lt;/p&gt;

&lt;h3&gt;
  
  
  Dev agency setup and culture
&lt;/h3&gt;

&lt;p&gt;Not all agencies operate like a single team of a business unit, but the small ones do. We were a team of five at peak, so the environment is very similar of a startup, a startup on its early days.&lt;/p&gt;

&lt;p&gt;We brainstorm on a small room, through Google Meet during remote days, do one-on-one calls, pair / peer programming, you name it. We eat out when we go the office, or travel for field work. During the pandemic, we at least try to do online drinking sessions even if it felt weird at first.&lt;/p&gt;

&lt;p&gt;Fun, very fun.&lt;/p&gt;

&lt;p&gt;Heck, we even plan side projects on Mondays like a startup. Yes, we also do side projects together. The culture says it all — we support each other like a cohort.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiencing both corporate and startup cultures
&lt;/h3&gt;

&lt;p&gt;I mentioned earlier that the nature of a dev agency allows it to service clients from different types of businesses.&lt;/p&gt;

&lt;p&gt;Our dev agency has taken the usual route: whether it's a startup needing a dev team, or huge companies with deep levels of corporate bureaucracy who just wanted to outsource, we provide help when we can.&lt;/p&gt;

&lt;p&gt;This exposure allowed us to experience different work cultures, which come with woes and beauty.&lt;/p&gt;

&lt;h4&gt;
  
  
  Seeing the woes
&lt;/h4&gt;

&lt;p&gt;There was a time we are tasked to build an MVP of an EdTech platform. But it lasted 24 months.&lt;/p&gt;

&lt;p&gt;There was also a time when we are tasked to build a talent marketplace MVP. It started as a web app, then an Android app, and then React Native.. The project ran for almost 3 years.&lt;/p&gt;

&lt;p&gt;Another is a updating a website that lasted for 2 years because of multiple decision makers, all for the name of corporate bureaucracy.&lt;/p&gt;

&lt;p&gt;I'll let you guess which one is a startup and which one is not. But the point is, woes can happen regardless of the work culture.&lt;/p&gt;

&lt;p&gt;These experiences show that software projects can go as long they can. Lack of intricacies and inefficiencies in communication came to play as well. Benefits the agency to some degree I would say, but you can only imagine how many sprints it took because we have to rebuild those "MVPs", or how long meetings can get with 10-15 decision makers on board.&lt;/p&gt;

&lt;p&gt;I witnessed so many pivots and 6 hour meetings, unnecessary work rendered and time wasted. Cheap rates do not help, so we try to compensate by letting the projects go as long they can, and take extra clients even if it's beyond our capacity. It is a way to become competitive and hit revenue targets, especially being in the local market of one of the outsourcing capitals of the world.&lt;/p&gt;

&lt;h4&gt;
  
  
  The beauty
&lt;/h4&gt;

&lt;p&gt;Of course, there are fun startups to work with. Same goes for large companies despite the corporate bureaucracy.&lt;/p&gt;

&lt;p&gt;The best part of working with startups is the level of freedom on brainstorming process. On the EdTech platform, we handled technical decisions. This is where I learned how to architect cloud infrastructure, and set it up ourselves, which is not simple to do back then. Pre-Vercel days, I would say. This is also the first app where I implemented different backend processes, outside of REST APIs.&lt;/p&gt;

&lt;p&gt;Meanwhile, the talent marketplace app accelerated my mobile development skills. From zero experience in web development to building my first full stack Android app, up to exploring React Native when Expo is not as refined as it is now, this experience was a rollercoaster one, but very valuable.&lt;/p&gt;

&lt;p&gt;Yup, zero experience. I still remember the day when one of our clients, who is an IT Manager, asked me about JWT and me looking it up after the meeting. That afternoon, I learned how to implement OAuth.&lt;/p&gt;

&lt;p&gt;We also get a chance to see a glimpse of the decisions behind the intricacies of a business — whether it's marketing, sales, technical, budgets, you name it.&lt;/p&gt;

&lt;p&gt;We also get to see professionals in action. One of my favorites are the creatives, primarily because I find their work super cool, and it's always amazing to see how they collaborate.&lt;/p&gt;

&lt;p&gt;Heck, we even dealt with managing Google Ads, handling Social Media accounts, editing marketing materials, and overseeing media production such as voice overs.&lt;/p&gt;

&lt;p&gt;Yes, we literally wore as many hats as we can. For the devs, it's all for the learning experience. Especially for me who always wanted to build a startup myself. For the dev agency, it's the revenue targets.&lt;/p&gt;

&lt;h4&gt;
  
  
  Hardwork pays off
&lt;/h4&gt;

&lt;p&gt;Well, it turned out great. The agency experience equipped me with skills and experience. It even accelerated my knowledge on fields outside my domain.&lt;/p&gt;

&lt;p&gt;However, do not expect to get paid well simply because you are an employee. Unless you own the agency or a shareholder.&lt;/p&gt;

&lt;p&gt;Well, you can increase your luck by becoming a subcontractor for one, or if you want to remain an employee, negotiate a profit share arrangement so you at least can get a piece out of the extra grind.&lt;/p&gt;

&lt;p&gt;This is where starting your own agency becomes appealing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should you start a dev agency?
&lt;/h3&gt;

&lt;p&gt;Now that I told you about my experiences in joining a dev agency, it is clear that working for one accelerates your skills and knowledge.&lt;/p&gt;

&lt;p&gt;But, should you start one?&lt;/p&gt;

&lt;p&gt;The upside is obvious: if you own the agency you are in control of the cashflow. Not only that, you are in control of multiple levers that will allow you to scale your agency to revenue targets that exceed your previous salaries and shares from profit sharing arrangements — if done right.&lt;/p&gt;

&lt;p&gt;This is where knowledge comes in..&lt;/p&gt;

&lt;h4&gt;
  
  
  which you can get by working for someone else..
&lt;/h4&gt;

&lt;p&gt;I remember &lt;a href="https://x.com/pxue"&gt;Paul Xue&lt;/a&gt;, who is a fellow maker and a dev agency owner himself, talking about working for great people to maximize your experience, skills, and knowledge.&lt;/p&gt;

&lt;p&gt;It makes sense. If you think you can't start on your own (yet), then it's perfectly fine to work for someone else — someone who's doing it already.&lt;/p&gt;

&lt;p&gt;Better yet, work for someone who made it already, just like Paul who scaled his solo dev agency to 500k/year.&lt;/p&gt;

&lt;h4&gt;
  
  
  or, by starting on your own..
&lt;/h4&gt;

&lt;p&gt;Most people start as freelancers, so this is a great option too.&lt;/p&gt;

&lt;p&gt;Learning by doing they say. Well, just be prepared to face challenges. But you can de-risk by equipping yourself with knowledge from people who made it.&lt;/p&gt;

&lt;p&gt;You don't need to work for them, sometimes you can simply ask them for advice. This is where community comes in.&lt;/p&gt;

&lt;p&gt;Yes, a community of dev agency owners exist.&lt;/p&gt;

&lt;p&gt;In fact, Paul has built a community of agency owners since last year, and it is growing fast. To date, the community has 400+ members of agency owners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no black and white answer to this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start an agency if you are confident of your experience and skills, and when I say experience, I mean practical knowledge.&lt;/p&gt;

&lt;p&gt;Practical knowledge like finding projects, getting and charging clients, how you deal with projects dragging longer than it should, how to do follow-ups, etc..&lt;/p&gt;

&lt;p&gt;If you are not confident yet, then work for an agency owner and build your knowledge up by joining communities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Speaking of practical knowledge and communities,
&lt;/h4&gt;

&lt;p&gt;Our fellow maker and agency owner in &lt;a href="https://x.com/pxue"&gt;Paul Xue&lt;/a&gt; has scaled his solo dev agency to 500k/year. For the past few months, he talked to agency owners, where they exchanged their own experiences and practical advices, which helped him validate his own experience in running his own dev agency.&lt;/p&gt;

&lt;p&gt;He did all of these so that he can deliver a &lt;a href="https://500k.agency/?ref=levelup"&gt;dev agency playbook&lt;/a&gt; that is accurate and up to date.&lt;/p&gt;

&lt;p&gt;Let me tell you, his vision is great: To onboard as much people as he can in the dev agency life.&lt;/p&gt;

&lt;p&gt;So far, he is doing a solid job: He, along with countless agency people that he talked with, has built a community of agency owners.&lt;/p&gt;

&lt;p&gt;The community will act as a space where everyone can share and exchange their experiences and knowledge.&lt;br&gt;
One of the community's goals is to help devs who wanted to run their dev agencies get their feet set.&lt;/p&gt;

&lt;p&gt;So, if you want to start your own dev agency, or you are a seasoned agency owner wanting to discover likeminded people, the community has your back.&lt;/p&gt;

&lt;p&gt;You can check the playbook and the community below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://500k.agency/?ref=levelup"&gt;500k.agency&lt;/a&gt; is your practical guide in building Solo Dev Agencies. Use code &lt;em&gt;MICROLAUNCH&lt;/em&gt; for 20% off your purchase. 🚀&lt;/p&gt;

&lt;p&gt;Head to &lt;a href="https://500k.agency/?ref=levelup"&gt;500k.agency&lt;/a&gt; to learn more. 🚀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Raymel&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you find this helpful, feel free to share to your friends!&lt;/p&gt;




&lt;p&gt;This article was originally posted on:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://levelup.news/blog/what-i-learned-working-for-a-dev-agency/"&gt;&lt;strong&gt;Level Up, Founders!&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>agency</category>
      <category>freelance</category>
      <category>culture</category>
    </item>
    <item>
      <title>Automating your keyboard's backlit with Bash</title>
      <dc:creator>Raymel Francisco</dc:creator>
      <pubDate>Sun, 27 Aug 2017 15:08:06 +0000</pubDate>
      <link>https://dev.to/raymelon/automating-your-keyboards-backlit-with-bash</link>
      <guid>https://dev.to/raymelon/automating-your-keyboards-backlit-with-bash</guid>
      <description>&lt;p&gt;You have a keyboard, it backlits at night, but not in day. You save a bit of energy, and your keyboard looks cool at night. Great!&lt;/p&gt;

&lt;h3&gt;
  
  
  But... wait a minute.
&lt;/h3&gt;

&lt;p&gt;I'm learning Bash lately, and I guess sharing my learning experience with you will be fruitful on my writing experience as well. Bear with me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Going back...
&lt;/h3&gt;

&lt;p&gt;So I used a simple algorithm in making my keyboard a little bit smarter with Bash. Bash's syntax is a bit strange for me, and took me a day before getting used to it. But why Bash when I can do it with a language I'm comfortable with, like Python? Well, exposing yourself to new habits from time to time exercises your brain's neuroplasticity, which is good.&lt;/p&gt;

&lt;p&gt;So here's how the backlit's simple algorithm works,&lt;/p&gt;

&lt;p&gt;Living near the equator gives us full 12 hours of daylight/darkness everyday.&lt;br&gt;
Therefore I shall conclude, that my keyboard must be cool in between 6pm and 6am, and eco-friendly between 6am and 6pm.&lt;/p&gt;

&lt;p&gt;Thus, giving us this logic flow:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time of day&lt;/th&gt;
&lt;th&gt;Switch backlit to&lt;/th&gt;
&lt;th&gt;When to switch backlit again?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;6am to 5:59pm&lt;/td&gt;
&lt;td&gt;OFF&lt;/td&gt;
&lt;td&gt;Next 6 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6pm to 5:59am&lt;/td&gt;
&lt;td&gt;ON&lt;/td&gt;
&lt;td&gt;Next 6 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Okay then, so how do we compute the next 6 hours?&lt;/p&gt;

&lt;p&gt;We need to use military time, in order to simplify things. Calculating up to 24th hour is easier to do. But since time is presented in 12hr format in my computer, I adjusted my formulas...&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time of day&lt;/th&gt;
&lt;th&gt;Next backlit switch&lt;/th&gt;
&lt;th&gt;Formula to next backlit switch (where &lt;code&gt;h&lt;/code&gt; is the time of day)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;6am to 5:59pm&lt;/td&gt;
&lt;td&gt;6pm&lt;/td&gt;
&lt;td&gt;18 - &lt;code&gt;h&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6pm to 11:59pm&lt;/td&gt;
&lt;td&gt;6am&lt;/td&gt;
&lt;td&gt;(12 - &lt;code&gt;h&lt;/code&gt;) + 6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12am to 6am&lt;/td&gt;
&lt;td&gt;6am&lt;/td&gt;
&lt;td&gt;6 - &lt;code&gt;h&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;But wait, why those formulas?&lt;/p&gt;

&lt;p&gt;Because 6pm is the 18th hour of day. The second formula is the same as the first, I just put it into the context of time resetting back to 0 at 12am. I guess, for the sake of a clearer view of the algorithm.&lt;/p&gt;

&lt;p&gt;Okay, so now the keyboard knows when it should switch. Great.&lt;/p&gt;

&lt;p&gt;But wait...&lt;/p&gt;

&lt;p&gt;How should it switch... the scroll lock?&lt;/p&gt;

&lt;p&gt;Well, for some keyboards, pressing the Scroll Lock key triggers backlit.&lt;/p&gt;

&lt;p&gt;And for most Linux machines, you can control your keyboard LEDs using &lt;code&gt;xset&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;From &lt;a href="//ftp://www.x.org/pub/X11R7.5/doc/man/man1/xset.1.html"&gt;&lt;code&gt;xset&lt;/code&gt; man page&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;led&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The led option controls the keyboard LEDs. This controls the turning on or off of one or all of the LEDs. It accepts an optional integer, a preceding dash(-) or an 'on/off' flag... &lt;/p&gt;

&lt;p&gt;...For example, to turn on the Scroll Lock LED:&lt;br&gt;
&lt;code&gt;xset led named "Scroll Lock"&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cool.&lt;/p&gt;

&lt;p&gt;So now we have all we need, we can now write the code.&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="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do

    &lt;/span&gt;&lt;span class="nv"&gt;current_hr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$(date +'%H')))&lt;/span&gt;
    &lt;span class="nv"&gt;current_min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$(date +'%M')))&lt;/span&gt;
    &lt;span class="nv"&gt;six_am&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;
    &lt;span class="nv"&gt;six_pm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;18&lt;/span&gt;

    &lt;span class="c"&gt;# sunrise&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; current_hr &lt;span class="o"&gt;-&lt;/span&gt;eq six_am &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then

        &lt;/span&gt;&lt;span class="nv"&gt;next_check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;43200&lt;/span&gt; &lt;span class="c"&gt;# 12 hrs in s&lt;/span&gt;
        xset &lt;span class="o"&gt;-&lt;/span&gt;led named &lt;span class="s1"&gt;'Scroll Lock'&lt;/span&gt;

        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Next check at'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"now + &lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;'approx'&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="s1"&gt;'hrs from now.'&lt;/span&gt;
        &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="nv"&gt;$next_check&lt;/span&gt;


    &lt;span class="c"&gt;# sunset&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; current_hr &lt;span class="o"&gt;-&lt;/span&gt;eq six_pm &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then

        &lt;/span&gt;&lt;span class="nv"&gt;next_check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;43200&lt;/span&gt; &lt;span class="c"&gt;# 12 hrs in s&lt;/span&gt;
        xset led named &lt;span class="s1"&gt;'Scroll Lock'&lt;/span&gt;

        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Next check at'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"now + &lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;'approx'&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="s1"&gt;'hrs from now.'&lt;/span&gt;
        &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="nv"&gt;$next_check&lt;/span&gt;

    &lt;span class="c"&gt;# midnight till before sunrise&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; current_hr &lt;span class="o"&gt;-&lt;/span&gt;lt six_am &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then

        &lt;/span&gt;&lt;span class="nv"&gt;min_to_six&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(($((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$six_am*60 + 10#0)) - $((10#$current_hr*60 + 10#$current_min))))&lt;/span&gt;
        &lt;span class="nv"&gt;next_check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$min_to_six&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
        xset led named &lt;span class="s1"&gt;'Scroll Lock'&lt;/span&gt;

        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Next check at'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"now + &lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;'approx'&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="s1"&gt;'hrs from now.'&lt;/span&gt;
        &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="nv"&gt;$next_check&lt;/span&gt;

    &lt;span class="c"&gt;# after sunrise till sunset&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; current_hr &lt;span class="o"&gt;-&lt;/span&gt;lt six_pm &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then

        &lt;/span&gt;&lt;span class="nv"&gt;min_to_six&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(($((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$six_pm*60 + 10#0)) - $((10#$current_hr*60 + 10#$current_min))))&lt;/span&gt;
        &lt;span class="nv"&gt;next_check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$min_to_six&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
        xset &lt;span class="o"&gt;-&lt;/span&gt;led named &lt;span class="s1"&gt;'Scroll Lock'&lt;/span&gt;

        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Next check at'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"now + &lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;'approx'&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="s1"&gt;'hrs from now.'&lt;/span&gt;
        &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="nv"&gt;$next_check&lt;/span&gt;

    &lt;span class="c"&gt;# after sunset till before sunrise&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; current_hr &lt;span class="o"&gt;-&lt;/span&gt;gt six_pm &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then

        &lt;/span&gt;&lt;span class="nv"&gt;hrs_to_twelve_am&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(($((&lt;/span&gt;&lt;span class="m"&gt;10#24&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;10#0&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$current_hr*60 + 10#$current_min))))&lt;/span&gt;
        &lt;span class="nv"&gt;min_to_six&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(($((&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="c"&gt;#$hrs_to_twelve_am + 10#0)) + $((10#6*60 + 10#0))))&lt;/span&gt;

        &lt;span class="nv"&gt;next_check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$min_to_six&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
        xset led named &lt;span class="s1"&gt;'Scroll Lock'&lt;/span&gt;

        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Next check at'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"now + &lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;'approx'&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$next_check&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="s1"&gt;'hrs from now.'&lt;/span&gt;
        &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="nv"&gt;$next_check&lt;/span&gt;
    &lt;span class="k"&gt;fi

done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to correct me or suggest simpler ways. I'll be glad and grateful to learn from you. ;)&lt;/p&gt;

&lt;p&gt;This script is hosted in Github as well, as part of my personal and personalized Bash scripts.&lt;br&gt;
&lt;a href="https://github.com/raymelon/bash-wrappers/blob/master/auto-scrlck"&gt;https://github.com/raymelon/bash-wrappers/blob/master/auto-scrlck&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article is posted in &lt;a href="https://medium.com/@raymelon/automating-your-keyboards-backlit-with-bash-e232cb100150"&gt;Medium&lt;/a&gt; as well.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>unix</category>
      <category>bash</category>
      <category>keyboard</category>
    </item>
    <item>
      <title>Hi, I'm Raymel.</title>
      <dc:creator>Raymel Francisco</dc:creator>
      <pubDate>Sat, 29 Apr 2017 08:36:15 +0000</pubDate>
      <link>https://dev.to/raymelon/hi-im-raymel</link>
      <guid>https://dev.to/raymelon/hi-im-raymel</guid>
      <description>&lt;p&gt;I have been coding since 2012.&lt;/p&gt;

&lt;p&gt;You can find me on GitHub as &lt;a href="https://github.com/raymelon" rel="noopener noreferrer"&gt;raymelon&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I currently work as a Full Stack Developer for &lt;a href="http://orangefix.net/" rel="noopener noreferrer"&gt;Orangefix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: C, Java, Python, C#, Javascript.&lt;/p&gt;

&lt;p&gt;Programming languages, machine learning, user interface and user experience interests me a lot.&lt;/p&gt;

&lt;p&gt;Right now, I am bootstrapping my own products.&lt;/p&gt;

&lt;p&gt;Nice to meet you folks!&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
