Skip to content

Instantly share code, notes, and snippets.

View ElectroluxV2's full-sized avatar

Mateusz Budzisz ElectroluxV2

View GitHub Profile
@ElectroluxV2
ElectroluxV2 / rich-list.cpp
Last active March 14, 2021 15:46
Rich Lista
//
// Created by Mateusz Budzisz on 13.03.2021.
//
#ifndef MATE_RICH_LISTA_H
#define MATE_RICH_LISTA_H
#include <stdexcept>
#include <functional>
@ElectroluxV2
ElectroluxV2 / .cs
Created October 25, 2021 18:58
SE TRAIN CONTROLER
float targetSpeed;
public Program()
{
// Initialize Storage
if (String.IsNullOrEmpty(Storage)) Storage = "0.0";
targetSpeed = float.Parse(Storage);
}
public void Save()
@ElectroluxV2
ElectroluxV2 / .java
Last active November 4, 2021 00:36
Java reduce but with interface
package org.example;
import java.util.List;
import java.util.stream.Stream;
interface StringFilter {
List<String> filter(List<String> people);
default StringFilter and(StringFilter second) {
return list -> second.filter(this.filter(list));
@ElectroluxV2
ElectroluxV2 / desktop.md
Created January 4, 2022 09:51
How to create proper linux .desktop launcher

Making proper .desktop entry

Our showcase program will be psst-gui located in /home/mate/psst/target/release and has icon located /home/mate/icons/psst.png. You can use which psst command to get installation path of program.

Psst is fast and multi-platform Spotify client with native GUI written in Rust GitHub repository.

Run psst as you would normally run it.

We need to get proper StartupWMClass value for our program. While running psst open terminal and type this command: xprop WM_CLASS, notice your cursor turned into a crosshair. That is because you must click on the main window of the program.
After doing such you will be left with something like that: WM_CLASS(STRING) = "psst-gui", "Psst-gui". Remember these values between quotes. We will be using one of them in a second.

Create a psst-gui.desktop file under one of locations.

  • ~/.local/share/applications (launcher will be visible only for your user)