Open-source News

Why sysadmins should choose Awesome window manager on Linux

opensource.com - Wed, 11/09/2022 - 16:00
Why sysadmins should choose Awesome window manager on Linux Seth Kenlon Wed, 11/09/2022 - 03:00

Awesome is a window manager for the Linux desktop. A "window manager" is a graphical interface that primarily (if not literally) just manages the drawing and arrangement of windows. In practice, even the most rudimentary of window managers actually provides a little more than just the ability to draw a window. Most also provide a pop-up menu so you can launch an application, some provide a dock or panel so you can switch between different applications you have running. They stop short at providing desktop conveniences such as drawing a wallpaper in the background of your screen, mounting and unmounting devices, providing a system tray, and so on. A window manager assumes you can use other applications to build a desktop experience to your own liking, and so it focuses on managing windows. The Awesome window manager takes a "tiling" approach, meaning that each window you launch takes up a fraction of your desktop according to the number of windows you have open.

Image by:

(Seth Kenlon, CC BY-SA 4.0)

My Linux desktop is the terminal

When you're a systems administrator, you tend to spend a lot of time in a terminal window. It's a direct and efficient interface to your local machine, to remote machines, the network, the Internet, and everything else, so it's usually the easiest and most sensible way to do a lot of things to a lot of computers at once. And when you spend all day in a terminal, you understandably start to question whether you actually need a desktop at all.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles

To be perfectly honest, the answer's often no, at least for 80% of your tasks. The reality of modern computing, however, is that there are some applications that are just easier to use through a graphical interface. For instance, even though there are issue tracking systems, like the open source Bugzilla, that provide terminal commands as an interface, sometimes you're on a team that uses an issue tracker (usually it's not open source) that provides only a web application. Like it or not, you need a web browser to interact with the ticketing system. And even though you may use a perfectly reasonable markup language like AsciiDoc, you're probably sent a word processor document sometimes and, while you could use Pandoc to convert the document into AsciiDoc and then back into an office document, that risks losing something in translation. Like it or not, you need an office suite.

The bottom line is that, whether you like it or not, you need a desktop. Or at least a window manager.

Tiling windows

Awesome understands your plight. With Awesome, your "primary" desktop can be your terminal. When you first launch it, your terminal window is full screen, just like the text console you really want to be greeted with upon login. When you really need web browser, though, you can launch it and Awesome makes room for it by splitting your screen in half. Your terminal is on one side, the web browser's on the other.

If you need to open a third application, you can launch that and Awesome makes room for it by splitting your screen into thirds.

Image by:

(Seth Kenlon, CC BY-SA 4.0)

When you're finished with an application, Awesome adjusts your layout again until, eventually, you're back to a full-screen terminal, just the way you like it.

Lua configuration

Awesome uses the Lua scripting language for configuration. Lua has a similar philosophy to Awesome. It's a simple language that's pretty intuitive once you understand a few basic concepts.

The simplest concept, and yet the most important, is the Lua table construct. Lua stores information in what it calls a "table", and it means that most everything in Lua has a structured hierarchy. For instance, this creates a Lua table:

zombie = {} zombie.apocalypse = true zombie.defeat = false

Now when you need to know whether there's an active zombie apocalypse, you can "call" the zombie table and query the apocalypse value:

> print(zombie.apocalypse) true

Both the apocalypse and the defeat values are "children" of the zombie table, which makes them each distinct from the apocalypse and defeat values of the alien table.

It's a simple system of data classification, and you see several tables used in the Awesome configuration:

-- Table of layouts awful.layout.layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier, awful.layout.suit.corner.nw, }

You may not know what options are available from reading the configuration file itself, but understanding that the options are grouped into Lua tables means you know what to look up in the Awesome documentation.

Of course, if you don't feel like reading through the documentation, you can also just comment options out and see what changes. A comment in Lua are two dashes, as in the first line of this snippet:

-- Create a launcher widget and a main menu myawesomemenu = { { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", function() awesome.quit() end }, }

Lua is a consistent and logical language. Any amount of Lua you pick up from configuring Awesome is Lua you can use for real life Lua scripting. If you're ready to move up from basic Bash scripting, you might consider Lua.

Adjusting tiles

While you're working in a split screen in Awesome, you might find the need to adjust the proportions. To do this graphically, right-click on the intersection the windows you want to adjust, and then drag all window borders to suit your preference.

When you learn enough Lua to get really good at configuring Awesome, you can configure default preferences.

Floating windows

Some applications never make sense as tiled windows. The Awesome configuration provided by your Linux distribution probably has a few examples set:

-- Floating clients. class = { "Blueman-manager", "Kruler", "MessageWin", "Tor Browser", "Wpa_gui"}, },Assemble your own Linux desktop

Using a window manager instead of a desktop means you get to choose the components you use for everything else you want to do with your computer. You can launch KDE applications from the Plasma Desktop, or use bits and pieces of XFCE (such as the panel, the network manager, and more), or you can eschew the desktop model entirely and use a particularly robust file manager and the terminal commands you know and love.

The Awesome window manager takes a "tiling" approach, meaning that each window you launch takes up a fraction of your desktop according to the number of windows you have open.

Image by:

WOCinTech Chat. Modified by Opensource.com. CC BY-SA 4.0

Linux What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Using Python in VS Code and Codium

opensource.com - Wed, 11/09/2022 - 16:00
Using Python in VS Code and Codium Don Watkins Wed, 11/09/2022 - 03:00

Over the past couple of years, I have had the privilege of working with middle school children to introduce them to Python coding and the Raspberry Pi 400. It's been a lot of fun, and the Pi has been a great platform for the students and me. We've used Code with Mu and it's been quite successful. Our aptitude with Python has grown with experience, and so recently I started looking for ways to offer these students more.

I participated in a Python learning class, and during that class I got introduced to Microsoft's Visual Studio Code. I learned a lot in that class about how to set up a virtual environment for Python, and how to configure VS Code for Python programming. During that learning journey, I also got introduced to Codium, which is essentially VS Code without Microsoft's branding and telemetry.

If you're looking for a good, general-purpose, open source code editor with Python integration, then you might give Codium a try. Here's how I got Codium set up for Python on my Linux system.

Install or update Python on Linux

First, make sure you are running the latest version of Python. You can do this with your package manager. On Debian and Debian-based systems:

$ sudo apt install python3-pip

On Fedora, CentOS, Mageia, OpenMandriva, and similar:

$ sudo dnf update python3

On some systems, you may also need to install the software to create Python virtual environments:

$ sudo apt install python3.10-venv

More Python resources What is an IDE? Cheat sheet: Python 3.7 for beginners Top Python GUI frameworks Download: 7 essential PyPI libraries Red Hat Developers Latest Python articles Install Codium

Next, install Codium on your computer. On Linux, you can download a package and install it with your package manager, or use the Flatpak.

To launch Codium once it's installed, open your application or Activities menu and type "Code".

Install the VS Code Python extension

There's nothing special about code. It's just plain text that gets interpreted by some other application, whether it's a compiler or a runtime. You can write Python code in Codium without special extensions. However, having a Python extension adds several conveniences.

Click on the File menu, select Preferences, and choose Extensions. In the Extensions panel, find the Python IntelliSense extension.

Image by:

(Opensource.com, CC BY-SA 4.0)

You've got Python set up in Codium. All that's left to do is to put it to good use.

Setup a virtual environment for VS Code or Codium

You can create a project directory and add it to Codium so that while you work, the files you create and save default to the active project directory. It's a fast way to stay organized, and it saves you from having to click around File Save and Open dialogues constantly.

When you create a virtual Python environment as a work folder, Codium (because you have the Python extension installed) detects it. When you activate a virtual environment folder as the active project directory, Codium automatically runs the activation code required to use the virtual environment.

To create a virtual environment for Python, open a terminal and type:

$ python3 -m venv ~/PythonCodingAdd a project directory

In Codium, click on the File menu and choose Add Folder to Workspace. Open the virtual environment you've just set up (for me, that's /home/don/PythonCoding.)

Now you're ready to write some Python code! Create a new Python file in your workspace and insert some basic code. You may notice, as you type, that Codium helpfully suggests auto-completion for the Python modules the environment contains.

import sys
print ("Codium running Python " + sys.version)

Now click the Play button in the top right corner of the Codium window. This opens a console panel at the bottom of the window, displaying the output of your code:

(PythonCode) sh-5.1$ /home/bogus/PythonCode/bin/python /home/bogus/PythonCode/app.py
Codium running Python 3.10.6 (main…) [GCC 12.1.0]
(PythonCode) sh-5.1$

As you can see from this output, Codium is running within the PythonCode environment, and it's successfully run your Python code.

Codium and Python

Using Codium for Python makes writing and running code easier than ever, but Python isn't the only language Codium supports. You can easily find and install other extensions from the Open VSX Registry, a vendor-neutral open source "marketplace" for VS Code extensions.

The Codium interface is more complicated than some basic editors, but it has what I'm looking for at this point in my learning journey. If you're looking to graduate to something professional, or you're looking to switch from your current editor to something new, then give Codium a try.

If you're looking for a good, general-purpose, open source code editor with Python integration, then you might give Codium a try.

Image by:

WOCinTech Chat. Modified by Opensource.com. CC BY-SA 4.0

Python Linux What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

The Most Used Operating Systems in the World

Tecmint - Wed, 11/09/2022 - 13:35
The post The Most Used Operating Systems in the World first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Brief: This article explores some of the most popular and widely used operating systems in the world. If you have ever used a PC, Macbook smartphone, tablet or any smart device (which is likely

The post The Most Used Operating Systems in the World first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Intel Releases November 2022 CPU Microcode For Various Functional Issues

Phoronix - Wed, 11/09/2022 - 08:28
Intel today published their "20221108" CPU microcode collection alongside announcing various security disclosures for the quarter. Fortunately on the CPU microcode side, the changes are all focused on functional issues...

Leading Organizations Accelerate Innovation in the Industrial Sector with Red Hat

Red Hat News - Wed, 11/09/2022 - 08:00
<p><span><span><span><span><span><span>Digital Transformation has been well underway for many organizations looking for ways to effectively modernize, drive operational efficiencies and improve production in the industrial sector. Organizations in the manufacturing industries in particular, have relied on proprietary solutions and vertically-integrated vendors to address their immediate computing needs, but that seems to be changing as leaders are leaning toward capabilities that help grow and res

AMD Joins The Cloud Hypervisor Project Started By Intel

Phoronix - Wed, 11/09/2022 - 03:00
Over the past three years one of Intel's many promising open-source software projects has been the Rust-written Cloud Hypervisor. Cloud Hypervisor started as just a modern, security-focused, cloud-centric Rust VMM hypervisor for modern hardware/software. It began as just one of many open-source software projects at Intel but last year was folded into the Linux Foundation umbrella while Intel continues to be a major contributor to the project. Coming as a bit of a surprise today is AMD announcing they have joined the Cloud Hypervisor project...

Fedora 38 Looking At A Phosh Image For Mobile Devices

Phoronix - Wed, 11/09/2022 - 01:30
It looks like Fedora could be taking on more mobile ambitions with a Phosh image now proposed for running that Wayland shell focused on smartphones and tablets while delivering a good GNOME-based experience. Separately, a change proposal is expected for also introducing a Fedora Linux image with KDE Plasma Mobile...

NVIDIA Makes The PhysX 5.1 SDK Open-Source

Phoronix - Tue, 11/08/2022 - 23:17
Back in 2019 NVIDIA open-sourced the PhysX 4.1 SDK and was working on a PhysX 5.0 open-source code drop while we haven't heard anything more on the matter in the past two years. Coming out this morning as a surprise is the NVIDIA PhysX 5.1 SDK open-source release...

ASRock X670E PG Lightning - Nice AMD Zen 4 Motherboard For $250 USD

Phoronix - Tue, 11/08/2022 - 23:00
When it comes to new AMD AM5 motherboards featuring an X670 series chipset, one of the cheapest options right now is the ASRock X670E PG Lightning that retails for around $249 USD. I picked up one of these motherboards at launch and has been working out well on Linux for those wanting to build a cost-minded AMD Zen 4 desktop system.

Pages