<?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>Forem: Abhay Raj Singh</title>
    <description>The latest articles on Forem by Abhay Raj Singh (@rathod_sahaab).</description>
    <link>https://forem.com/rathod_sahaab</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%2F420524%2F1ef5a0fb-9139-4bac-8b67-244bb34912d6.jpeg</url>
      <title>Forem: Abhay Raj Singh</title>
      <link>https://forem.com/rathod_sahaab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rathod_sahaab"/>
    <language>en</language>
    <item>
      <title>Inkscape: Command Palette merged!</title>
      <dc:creator>Abhay Raj Singh</dc:creator>
      <pubDate>Wed, 03 Feb 2021 07:28:16 +0000</pubDate>
      <link>https://forem.com/rathod_sahaab/inkscape-command-palette-merged-15c2</link>
      <guid>https://forem.com/rathod_sahaab/inkscape-command-palette-merged-15c2</guid>
      <description>&lt;h3&gt;
  
  
  Background
&lt;/h3&gt;

&lt;p&gt;I enrolled in Google Summer of Code this year with Inkscape as my mentor organization. I proposed to implement the Command palette and the Macros (more on that later).&lt;/p&gt;

&lt;h3&gt;
  
  
  About
&lt;/h3&gt;

&lt;p&gt;The 'Command Palette' feature is finally merged in &lt;a href="https://inkscape.org"&gt;Inkscape's&lt;/a&gt; master branch, it has still a long way to go, but now you can easily contribute and try it out. It is currently available in version 1.1-alpha, and it may even land in version 1.1.&lt;br&gt;
So what even is &lt;strong&gt;command palette&lt;/strong&gt;?&lt;/p&gt;

&lt;h2&gt;
  
  
  Command Palette
&lt;/h2&gt;

&lt;p&gt;If I had to summarize it in a sentence&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;em&gt;Command Palette is an Access Point with a text interface.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Woah! No jargon!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You can do things by typing.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What does it do? &lt;strong&gt;Search&lt;/strong&gt; and/or &lt;strong&gt;Execute&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why though?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To Maximize the speed and efficiency of the user and to minimize frustration and boredom.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final goals
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Search for actions and execute them.&lt;/li&gt;
&lt;li&gt;Search for recent files and open/import them.&lt;/li&gt;
&lt;li&gt;Remember previous commands and their parameters.&lt;/li&gt;
&lt;li&gt;Execute Python code.&lt;/li&gt;
&lt;li&gt;Execute shell commands.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  What are actions?
&lt;/h4&gt;

&lt;p&gt;Actions are the backbone of everything you do in Inkscape.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rotating an object is an action.&lt;/li&gt;
&lt;li&gt;Zooming in and out are actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Current status
&lt;/h3&gt;

&lt;p&gt;Don't try to be an oracle, tell me what it can do &lt;strong&gt;now&lt;/strong&gt;!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for actions and execute them.&lt;/li&gt;
&lt;li&gt;Search for recent files and open/import them.&lt;/li&gt;
&lt;li&gt;Remember previous commands and their parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well, that's it for now, more features will be added in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use?
&lt;/h2&gt;

&lt;p&gt;NOTE: &lt;em&gt;only available in Inkscape 1.1-dev or 1.1-alpha&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To open the Command Palette, press ?. You are greeted with a beautiful (&lt;em&gt;not really&lt;/em&gt;) dialog.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f-nACZLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lswo5h3vr1cmfjtqiv72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f-nACZLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lswo5h3vr1cmfjtqiv72.png" alt="Command Palette open screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you can't stand this beauty (&lt;em&gt;not really&lt;/em&gt;), you can close it by&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clicking on canvas or any object on the canvas.&lt;/li&gt;
&lt;li&gt;Pressing esc.&lt;/li&gt;
&lt;li&gt;Pressing ? again.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Testing it out
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Type &lt;code&gt;snap&lt;/code&gt; and now you can easily find the snapping option you want without hovering over every icon.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--re_4SWDM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o7p2nqdppuyyq4ygrhck.png" alt='Searched "snap" in command palette'&gt;
&lt;/li&gt;
&lt;li&gt;Select an object, type &lt;code&gt;rotate&lt;/code&gt;, and then press enter, put in the angle you want to rotate the object by, and press enter again.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dFlDUmbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0iv1840qnlgrzx7sgqk4.gif" alt="Rotate using command-palette demo"&gt;
&lt;/li&gt;
&lt;li&gt;Type a &lt;strong&gt;recent filename&lt;/strong&gt; you worked on (&lt;em&gt;before restart&lt;/em&gt;). There will be two options: &lt;code&gt;open&lt;/code&gt; and &lt;code&gt;import&lt;/code&gt;.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bOrLHzCO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ftj63clprhbvplrfjbbf.gif" alt="Import using command palette demo"&gt;
&lt;code&gt;Open&lt;/code&gt; just opens it in a new document in a new window, while &lt;code&gt;import&lt;/code&gt;, imports the image in the current document.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Scroll through the operations available when you open the command palette.&lt;/p&gt;

&lt;h4&gt;
  
  
  Some operations are missing
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Inkscape is moving from, verbs to actions, and thus not all features of Inkscape are available through the command palette.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  History
&lt;/h3&gt;

&lt;p&gt;The command palette remembers the last commands you performed. To access them press the up key when Command Palette is in focus.&lt;br&gt;
Press the down key when on the most recent command to go back from history mode to search mode.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xscpNvzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/43970mh9fkaoj34wajzc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xscpNvzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/43970mh9fkaoj34wajzc.gif" alt="History demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many actions that you use take input or parameter, for example, &lt;code&gt;rotate&lt;/code&gt; action takes angle, &lt;code&gt;transform&lt;/code&gt; action takes distances to move an object by, in &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; directions.&lt;br&gt;
Parameters of &lt;code&gt;actions&lt;/code&gt; are also remembered (doesn't work in 1.1-alpha), so when you're asked degrees for &lt;code&gt;rotate&lt;/code&gt;, you can just press the up key until you find the previously used value you wanted.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9FYdCIWX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sob5cyp8epnjxjmiinek.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9FYdCIWX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sob5cyp8epnjxjmiinek.gif" alt="Action parameter history demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  TODO
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Porting more verbs to actions.&lt;/li&gt;
&lt;li&gt;Favourites.&lt;/li&gt;
&lt;li&gt;Set shortcuts from the command palette.&lt;/li&gt;
&lt;li&gt;Display the menu location of an action.&lt;/li&gt;
&lt;li&gt;Better searching algorithm.&lt;/li&gt;
&lt;li&gt;Input descriptions&lt;/li&gt;
&lt;li&gt;Cleanliness: many actions aren't useful for GUI users and hence should not appear in the command palette.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;...and many more. It's still a new feature, written by a kid during summer, so there's a lot of room for improvement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contributing
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Make a feature request or report a bug in the &lt;a href="https://gitlab.com/inkscape/inbox/-/issues"&gt;Inbox&lt;/a&gt; bug tracker.&lt;/li&gt;
&lt;li&gt;Help in making it more intuitive in the &lt;a href="https://chat.inkscape.org/channel/team_ux"&gt;UX discussion channel&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Want to code? Get in touch on the &lt;a href="https://chat.inkscape.org/channel/team_devel"&gt;Inkscape Chat&lt;/a&gt;, ping &lt;code&gt;@rathod-sahaab&lt;/code&gt;, maybe I can help you get up to speed, or reach out on Twitter &lt;code&gt;@swayambhu_dev&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cpp</category>
      <category>inkscape</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Inkscape Command Palette: GSoC 2020</title>
      <dc:creator>Abhay Raj Singh</dc:creator>
      <pubDate>Wed, 01 Jul 2020 15:21:03 +0000</pubDate>
      <link>https://forem.com/rathod_sahaab/inkscape-command-palette-gsoc-2020-516p</link>
      <guid>https://forem.com/rathod_sahaab/inkscape-command-palette-gsoc-2020-516p</guid>
      <description>&lt;h2&gt;
  
  
  Command Palette
&lt;/h2&gt;

&lt;p&gt;Command Palette strives to be, in simple terms an &lt;strong&gt;Access Point&lt;/strong&gt;. The &lt;em&gt;interface&lt;/em&gt; it chooses is text.&lt;/p&gt;

&lt;p&gt;Some features that we have included(and planned to include) in the command palette are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Actions Search&lt;/strong&gt;: Inkscape has a plethora of features and it becomes hard to remember where they are in deeply nested menus. A large number of operations also create difficulty in assigning shortcuts for all of them. This feature helps to search and execute all actions(operations) specifically &lt;code&gt;Gio::Actions&lt;/code&gt;, search files, preferences, and others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python execution:&lt;/strong&gt; This feature depends(blocking) on &lt;a href="https://gitlab.com/inkscape/inkscape/-/merge_requests/417/"&gt;Integrating Python into Inkscape, Merge Request&lt;/a&gt;. This useful for the times when you need some programming goodness for technical accuracy in your designs. For example: Plotting 2D density of an equations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shell execution&lt;/strong&gt;: This is more of a developer and CLI users oriented feature, to test that commands have the desired effect.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Progress
&lt;/h2&gt;

&lt;h5&gt;
  
  
  30 June 2020
&lt;/h5&gt;

&lt;p&gt;Command Palette is now capable of searching and executing actions. Actions are the future of how Inkscape will do things/operations. There are close to 100 as I write. Though it's still a long way to go converting all verbs to actions we will get there.&lt;/p&gt;

&lt;p&gt;Let me give you a tour of how to use Command Palette.&lt;/p&gt;

&lt;p&gt;The default key to toggle CP is &lt;code&gt;?&lt;/code&gt; (question mark). Thanks to Maren Hachmann for the idea.&lt;/p&gt;

&lt;p&gt;Once you press &lt;code&gt;?&lt;/code&gt;. A rectangular box with rounded corners appears on the canvas. (comment below if you like/dislike this design also suggest other locations/design for CP)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GJ6UUOYy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zvwvjrh9nfe5c39r4jxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GJ6UUOYy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zvwvjrh9nfe5c39r4jxo.png" alt="Command Palette Open SS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's start with anatomy. &lt;/p&gt;

&lt;h3&gt;
  
  
  Anatomy
&lt;/h3&gt;

&lt;p&gt;The most annoying part &lt;code&gt;(Ctrl + `)&lt;/code&gt; is a placeholder for shortcuts of the actions. Placeholder because currently, only &lt;code&gt;verbs&lt;/code&gt; predecessors to actions have shortcuts.&lt;/p&gt;

&lt;p&gt;In the bold fonts are action names. Currently, an action's name is a verb name of that action. They aren't translatable but I am working and soon will be replaced.&lt;/p&gt;

&lt;p&gt;Action name is preceded by the group that action belongs to. Example, File, Dialog, Transform, etc.&lt;/p&gt;

&lt;p&gt;Below the action name is the description for what action does.&lt;/p&gt;

&lt;p&gt;That's not all let's see what invisible.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VTsYWOZ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xr7qgbi7lgmeu5ml2m4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VTsYWOZ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xr7qgbi7lgmeu5ml2m4y.png" alt="CP Preferences"&gt;&lt;/a&gt;&lt;br&gt;
Let's enable the options&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FGuIkUkF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8rtoezwq5hz2ro9ikfnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FGuIkUkF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8rtoezwq5hz2ro9ikfnk.png" alt="CP Preferences checked"&gt;&lt;/a&gt;&lt;br&gt;
After restarting Inkscape this is how Command Palette looks like.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w1FP733i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e2562ueiknm0kxgxf3y0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w1FP733i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e2562ueiknm0kxgxf3y0.png" alt="CP Open all enabled"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The name in small size letters will always be in English, this is to enable tutors of different Interface language to help others.&lt;/p&gt;

&lt;p&gt;The cryptic name in far-right is the full action name helpful for CLI users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;You type to search and click to execute. Press &lt;code&gt;Esc&lt;/code&gt; key at any time to close CP. Currently, searching relies on a substring search algorithm.&lt;br&gt;
&lt;strong&gt;TODO&lt;/strong&gt;: I'm working on a fuzzy search algorithm for this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tCW36Nh---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2p19k00ntm2zoo8z1zoh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tCW36Nh---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2p19k00ntm2zoo8z1zoh.png" alt="CP Searched"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can navigate between suggestions with &lt;code&gt;Tab&lt;/code&gt; and &lt;code&gt;Shift + Tab&lt;/code&gt; or arrow key and press enter to execute.&lt;/p&gt;

&lt;p&gt;The top row is automatically highlighted when searching so when you press enter/return/linefeed. &lt;br&gt;
&lt;strong&gt;NOTE:&lt;/strong&gt; some bug causes this feature to require 2 presses and highlighting only work if the same row is on top for 2 letters pressed during a search.&lt;/p&gt;

&lt;h4&gt;
  
  
  Arguments
&lt;/h4&gt;

&lt;p&gt;We ask action parameters/data as depicted below&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pqGx8ZF8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4x6o1qirunr0slqdxkts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pqGx8ZF8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4x6o1qirunr0slqdxkts.png" alt="How we ask for data"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Due to restriction of Gio::Actions we, for now, can only ask for one parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TODO:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add better(snippet like) support for multiple params&lt;/li&gt;
&lt;li&gt;Better descriptions/context of parameter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/inkscape/inkscape/-/merge_requests/2072"&gt;GitLab Merge Request&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/inkscape/ux/-/issues/31"&gt;GitLab UX issue&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/inkscape/inkscape/-/issues/1567"&gt;GitLab Technical issue&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theme:&lt;/strong&gt; Flat Remix&lt;/p&gt;

&lt;p&gt;Please comment below any Ideas/Questions you can think of. &lt;br&gt;
Decency level: *&lt;em&gt;Roast me&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>opensource</category>
      <category>design</category>
    </item>
  </channel>
</rss>
