Kamis, 18 Februari 2021

Starship: Open-Source Customizable Prompt for Any Shell

Brief: A cross-shell prompt that makes it easy to customize and configure the Linux terminal prompt, if you care too much about the looks of your terminal.

While I’ve already covered a few tips to help you customize the looks of your terminal, I also came across suggestions for an interesting cross-shell prompt.

Starship: Tweak your Linux Shell Prompt Easily

starship screenshot

Starship is an open-source project that’s written in Rust to help you set up a minimal, fast, and customizable shell prompt.

No matter whether you’re using bash, fish, PowerShell on Windows or any other shell, you can utilize Starship to customize the appearance.

Do note that you do have to go through its official documentation to be able to perform advanced configuration for everything you like but here I will include a simple sample configuration to get a head start along with some key information about Startship.

Starship focuses on giving you a minimal, fast, and useful shell prompt by default. It even records and shows the time taken to perform a command as well. For instance, here’s a screenshot:

starship time

Not just limited to that, it is also fairly easy to customize the prompt to your liking. Here’s an official GIF that shows it in action:

starship demo

Let me help you set it up. I am using bash shell on Ubuntu to test this out. You can refer to the steps I mention, or you can take a look at the official installation instructions for more options to install it on your system.

Key Highlights of Starship

  • Cross-platform
  • Cross-shell support
  • Ability to add custom commands
  • Customize git experience
  • Customize the experience while using specific programming languages
  • Easily customize every aspect of the prompt without taking a hit on performance in a meaningful way

Installing Starship on Linux

Note

Installing Starship requires downloading a bash script from the internet and then run the script with root access.|
If you are not comfortable with that, you may use snap here:
sudo snap install starship

Note: You need to have Nerd Font installed to get the complete experience.

To get started, ensure that you have curl installed. You can install it easily by typing in:

sudo apt install curl

Once you do that, type in the following to install Starship:

curl -fsSL https://starship.rs/install.sh | bash

This should install Starship to usr/local/bin as root. You might be prompted for the password. Here’s how it would look:

install starship

Add startship to bash

As the screenshot suggests, you will get the instruction to set it up in the terminal itself. But, in this case, we need to add the following line at the end of our bashrc user file:

eval "$(starship init bash)"

To add it easily, simply type in:

nano .bashrc

Now, navigate to the end of the file by scrolling down and add the line at the end of the file as shown in the image below:

startship bashrc file

Once done, simply restart the terminal or restart your session to see the minimal prompt. It might look a bit different for your shell, but more or less it should be the same by default.

starship prompt

Once you set it up, you can proceed customizing and configuring the prompt. Let me show you an example configuration that I did:

Configure Starship Shell Prompt: The Basics

To get started, you just need to make a configuration file (TOML file) inside a .config directory. If you already have one, you should simply navigate to the directory and just create the configuration file.

Here’s what you have to type to create the directory and the config file:

mkdir -p ~/.config && touch ~/.config/starship.toml

Do note that this is a hidden directory. So, when you try to access it from your home directory using the file manager, make sure to enable viewing hidden files before proceeding.

From this point onwards, you should refer to the configuration documentation if you want to explore something you like.

For an example, I configured a simple custom prompt that looks like:

starship custom

To achieve this, my configuration file looks like this:

starship custom config

It is a basic custom format as per their official documentation. But, if you do not want a custom format and simply want to customize the default prompt with a color or a different symbol, that would look like:

starship different symbol

And, the configuration file for the above customization looks like:

starship symbol change

Of course, that’s not the best-looking prompt one can make but I hope you get the idea.

You can customize how the directory looks by including icons/emojis, you can tweak the variables, format strings git commits, or while using specific programming languages.

Not just limited to that, you can also create custom commands to use in your shell to make things easier or comfortable for yourself.

You should explore more about in their official website and its GitHub page.

Concluding Thoughts

If you just want some minor tweaks, the documentation might prove to be too overwhelming. But, even then, it lets you achieve a custom prompt or a minimal prompt with little effort that you can apply on any common shell and any system you’re working on.

Perosnally, I don’t think it’s very useful but several readers suggested it and it seems people do love it. I am eager to see how you customize the Linux terminal for different kinds of usage.

Feel free to share what you think about it and if you like it, in the comments down below.



from It's FOSS https://ift.tt/37qq54I
via IFTTT

Rabu, 17 Februari 2021

7 Ways to Customize Cinnamon Desktop in Linux [Beginner’s Guide]

Linux Mint is one the best Linux distributions for beginners. Especially Windows users that want to switch to Linux, will find its flagship Cinnamon desktop environment very familiar.

Cinnamon gives a traditional desktop experience and many users like it as it is. It doesn’t mean you have to content with what it provides. Cinnamon provides several ways for customizing the desktop.

Reading about MATE and KDE customization guides, many readers requested similar tutorial for Linux Mint Cinnamon as well. Hence, I created this basic guide on tweaking the looks and feel of Cinnamon desktop.

7 Different Ways for Customizing Cinnamon Desktop

For this tutorial, I’m using Linux Mint Debian Edition (LMDE 4). You can use this on any Linux distribution that is running Cinnamon. If you are unsure, here’s how to check which desktop environment you are using.

When it comes to changing the cinnamon desktop appearance, I find it very easy to do so as it is just 2 clicks away. Click on the menu icon and then on settings as shown below.

Cinnamon Settings

All the appearance settings are placed on the top of the window. Everything on “System Settings” window looks neat and tidy.

Cinnamon Settings

1. Effects

The effects options are simple, self-explanatory and straightforward. You can turn on and off the effects for different elements of the desktop or change the window transitioning by changing the effects style. If you want to change the speed of the effects, you can do it through the customise tab.

8 Cinnamon Effects

2. Font Selection

In this section, you can differentiate the fonts you use throughout the system in size and type, and through the font settings you can fine-tune the appearance.

Font Selection in Cinnamon desktop

3. Themes and icons

A reason that I used to be a Linux Mint user for a few years, is that you don’t need to go all over the place to change what you want. Window manager, icon and panel customization all in one place!

You can change your panel to a dark or light colour and the window borders to suit your changes. The default Cinnamon appearance settings look the best in my eyes, and I even applied the exact same when I was testing the Ubuntu Cinnamon Remix but in orange colour.

Cinnamon Themes And Icons

4. Cinnamon Applets

Cinnamon applets are all the elements included at your bottom panel like the calendar or the keyboard layout switcher. At the manage tab, you can add/remove the already installed applets.

You should definitely explore the applets you can download, the weather and CPU temperature Indicator applets were my choices from the extras.

Cinnamon Applets

5. Cinnamon Desklets

Cinnamon Desklets are applications that can be placed directly to your desktop. Like all the other customization option, Desklets can be accessed from the settings menu and the wide variety of choices can attract anyone’s interest. Google calendar is a handy app to keep track of your schedule directly on your desktop.

Cinnamon Desklets

6. Desktop wallpaper

To change the desktop background on Cinnamon desktop, simply right click on the desktop and choose “Change Desktop Background. It will open an easy to use window, where on the left side the available background system folders are listed and on the ride pane there is a preview of the images within each folder.

Cinnamon Change Desktop Background

You can add your own folders by clicking the plus (+) symbol by navigating to its path. At the Settings tab you can choose if you background will be static or slideshow and how the background is being positioned on the screen.

2 Cinnamon Change Desktop Background

7. Customize what’s on your desktop screen

The background is not the only desktop element that you can change. You can find more options if you right click on the desktop and click on “Customise”.

Cinnamon Desktop Additional Customization

You can change the icon size, change the placement from vertical to horizontal and the spacing among them on both axis. If you don’t like what you did, click in reset grid spacing to go back to the default.

Cinnamon Desktop Additional Customization

Additionally, if you click on “Desktop Settings”, more options will be revealed. You can disable the icons on the desktop, place them on the primary or secondary monitor, or even both. As you can see, you can select some of the icons to appear on your desktop.

Desktop Additional Customization

Conclusion

Cinnamon desktop is one of the best to choose, especially if you are switching from windows to Linux, but also for someone who is looking to a simple yet elegant desktop.

Cinnamon desktop is very stable and never crashed on my hands, and it is one of the main reasons why it served me for so long on a variety of Linux distributions.

I didn’t go in much details but gave you enough pointers to explore the settings on your own. Your feed to improve Cinnamon cuztomization is welcome.



from It's FOSS https://ift.tt/2N738gh
via IFTTT

Selasa, 16 Februari 2021

What is PPA Purge? How to Use it in Ubuntu and other Debian-based Distributions?

PPA is a popular method of installing additional applications or newer versions of a software in Ubuntu.

I have written a detailed guide on PPA so I will just quickly recall it here. PPA is a mechanism developed by Ubuntu to enable developers to provide their own repositories. When you add a PPA, you add additional repository to your system and thus you can download applications from this additional repository.

sudo add-apt-repository ppa:ppa-address
sudo apt update
sudo apt install package_from_ppa

I have also written about deleting PPAs from your system. I briefly mentioned the PPA Purge tool in that article. In this tutorial, you’ll get more detailed information about this handy utility.

What is PPA Purge?

PPA Purge is a command line tool that disables a PPA repository from your software sources list. Apart from that, it reverts the system back to official Ubuntu packages. This is a different behavior than simply deleting the PPA repository.

Suppose application ABC has version x available from Ubuntu repositories. You add a PPA that provides a higher version y of the same application/package ABC. When your Linux system finds that the same package is available from multiple sources, it uses the source that provides a newer version.

In this example, you’ll have version y of application ABC installed thanks to the PPA you added.

Normally, you would remove the application and then remove the PPA from sources list. But if you use ppa-purge to disable the said PPA, your application ABC will automatically revert to the older version x provided by Ubuntu repositories.

Do you see the difference? Probably not. Let me explain it to you with real examples.

Reverting applications to the official version provided by Ubuntu

I heard that the upcoming VLC 4.0 version has major UI overhaul. I wanted to try it before it is officially released and so I used the daily build PPA of VLC to get the under-development version 4.

Take a look at the screenshot below. I have added the VLC PPA (videolan/master-daily) and this PPA provides VLC version 4.0 release candidate (RC) version. Ubuntu repositories provide VLC version 3.0.11.

vlc ppa

If I use the ppa-purge command with the VLC daily build PPA, it disables the PPA and reverts the installed VLC version to 3.0.11 which is available from Ubuntu’s universal repository.

using ppa purge

You can see that it informs you that some packages are going to be downgraded.

downgrade packages with ppa purge

When the daily build VLC PPA is purged, the installed version reverts to what Ubuntu provides from its official repositories.

package reverted ppa purge

You might think that VLC was downgraded because it was upgraded from version 3.0.11 to VLC 4.0 with the PPA. But here is a funny thing. Even if I had used the PPA to install VLC 4.0 RC version afresh (instead of upgrading it), it would still be downgraded instead of being removed from the system.

Does it mean ppa-purge command cannot remove applications along with disabling the PPA? Not quite so. Let me show another example.

PPA Purge impact on application only available from a PPA

I recently stumbled across Plots, a nifty tool for plotting mathematical graphs. Since it is a new application, it is not available in Ubuntu repositories yet. I used its PPA to install it.

If I use ppa-purge command on this PPA, it disables the PPA first and then looks to revert it to the original version. But there is no ‘original version’ in Ubuntu’s repositories. So, it proceeds to uninstall the application from Ubuntu.

The entire process is depicted in the single picture below. Pointer 1 is for adding PPA, pointer 2 is for installing the application named plots. I have discarded the input for these two commands with redirection in Linux.

You can see that when PPA Purge is used (pointer 3), it disables the PPA (pointer 4) and then proceeds to inform that the application plots will be removed (pointer 5).

ppa purge deleting apps

Deleting a PPA vs disabling it

I have repeatedly used the term ‘disabling PPA’ with PPA Purge. There is a difference between disabling PPA and deleting it.

When you add a PPA, it adds a new file in the /etc/apt/sources.list.d directory. This file has the URL of the repository.

Disabling the PPA keeps this file but it is commented out the repository in the PPA’s file. Now this repository is not considered while updating or installing software.

disabled ppa

You can see disabled PPA repository in Software & Updates tool:

disabled ppa ubuntu

When you delete a PPA, it means deleting the PPA’s file from etc/apt/sources.list.d directory. You won’t see it anywhere on the system.

ppa deleted
PPA deleted

Why disable a PPA instead of deleting it? Because it is easier to re-enable it. You can do just check the box in Software & Updates tool or edit the PPA file and remove the leading # to uncomment the repository.

Recap of what PPA Purge does

If it was too much information, let me summarize the main points of what the ppa-purge script/tool does:

  • PPA Purge disables a given PPA but doesn’t delete it.
  • If there was a new application (which is not available from any sources other than only the PPA) installed with the given PPA, it is uninstalled.
  • If the PPA upgraded an already installed application, that application will be reverted to the version provided by the official Ubuntu repositories.
  • If you used the PPA to install (not upgrade) a newer version of an application (which is also available from the official Ubuntu repository), using PPA Purge will downgrade the application version to the one available from Ubuntu repositories.

Using PPA Purge

Alright! Enough explanation. You might be wondering how to use PPA Purge.

You need to install ppa-purge tool first. Ensure that you have universe repository enabled already.

sudo apt install ppa-purge

As far using PPA Purge, you should provide the PPA name in a format similar to what you use for adding it:

sudo ppa-purge ppa:ppa-name

Here’s a real example:

ppa purge example

If you are not sure of the PPA name, use the apt show command to display the source repository of the package in question.

apt show vlc
apt show find ppa source
Finding PPA source URL

For example, the source for VLC PPA shows https://ift.tt/1HvoASG groovy/main. Out of this the terms after ppa.launchpad.net and before Ubuntu are part of PPA name. So here, you get the PPA name as videolan/master-daily.

If you have to use to purge the PPA ‘videolan/master-daily’, you use it like this by adding ppa: before PPA name:

sudo ppa-purge ppa:videolan/master-daily

Do you purge your PPAs?

I wanted to keep this article short and crisp but it seems I went in a little bit of more detail.As long as you learn something new, you won’t mind the additional details, will you?

PPA Purge is a nifty utility that allows you to test newer or beta versions of applications and then easily revert to the original version provided by the distribution. If a PPA has more than one application, it works on all of them.

Of course, you can do all these stuff manually which is to disable the PPA, remove the application and install it again to get the version provided by the distribution. PPA Purge makes the job easier.

Do you use ppa-purge already or will you start using it from now onwards? Did I miss some crucial information or do you still have some doubts on this topic? Please feel free to use the comment sections.



from It's FOSS https://ift.tt/3s3QjSJ
via IFTTT

Minggu, 14 Februari 2021

Meet Plots: A Mathematical Graph Plotting App for Linux Desktop

Plots is a graph plotting application that makes it easy to visualize mathematical formulae. You can use it for trigonometric, hyperbolic, exponential and logarithmic functions along with arbitrary sums and products.

Plot mathematical graphs with Plots on Linux

Plots is a simple application inspired by graph plotting web apps like Desmos. It allows you to plot graphs of different math functions, which you can enter interactively, as well as customizing the color of your plots.

Written in Python, Plots takes advantage of modern hardware using OpenGL. It uses GTK 3 and thus integrates well with the GNOME desktop.

fourier graph plots

Using plots is straightforward. To add a new equation, click the plus sign. Clicking the trash icon deletes the equation. There is also the option to undo and redo. You can also zoom in and zoom out.

Graph plotting apps for Linux

The text box where you type is equation friendly. I could write basic equations but since I rarely deal with mathematical functions, it was difficult for me to figure out typing integration or summation symbol. Plots should have this in their documentation, I believe.

plots app linux

In dark mode, the sidebar equation area turns dark but the main plotting area remains white. I believe that’s by design perhaps.

You can use multiple functions and plot them all in one graph:

multiple equations plots

I found it crashing while trying to paste some equations it could not understand. If you write something that it cannot understand or conflicts with existing equations, all plots disappear, Removing the incorrect equation brings back the plot.

No option to export the plots or copy them to clipboard unfortunately. You can always take screenshots in Linux and use the image in your document where you have to add the graphs.

Installing Plots on Linux

Plots has different installation options available for various kinds of distributions.

Ubuntu 20.04 and 20.10 users can take advantage of the PPA:

sudo add-apt-repository ppa:apandada1/plots
sudo apt update
sudo apt install plots

For other Debian based distributions, you can install it from the deb file available here.

I didn’t find it in AUR package list but as an Arch Linux user, you can either use the Flatpak package or install it using Python.

If interested, you may check out the source code on its GitHub repository. If you like the application, please consider giving it a star on GitHub.

Conclusion

The primary use case for Plots is for students learning math or related subjects, but it can be useful in many other scenarios. I know not everyone would need that but surely helpful for the people in the academics and schools.

I would have liked the option to export the images though. Perhaps the developers can add this feature in the future releases.

Do you know any similar applications for plotting graphs? How does Plots stack up against them?



from It's FOSS https://ift.tt/3qlRBrR
via IFTTT