Skip to content

Instantly share code, notes, and snippets.

View Misko-2083's full-sized avatar

Милош Павловић Misko-2083

View GitHub Profile
@Misko-2083
Misko-2083 / desktop-icons-applet.c
Last active April 23, 2021 13:17
popover attempt as a xfce4-panel applet
/*
* Copyright © 2021 misko_2083
*
* Distributed under terms of the GPL2 license.
*
* compile
* gcc -Wall -s -shared -fPIC -g desktop-icons-applet.c -o libdicons.so $(pkg-config --libs --cflags gtk+-3.0 libxfce4panel-2.0 libxfconf-0)
* move to libdir (debian 64bit)
* mv libdicons.so /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libdicons.so
*/
@Misko-2083
Misko-2083 / html-example.sh
Created May 25, 2020 13:53
yad --html dialog example
#!/bin/bash
UI=$(cat <<EOF
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.body {
background-color: #CECECE;
@Misko-2083
Misko-2083 / alarm
Created January 19, 2020 23:12
alarm script
#!/bin/bash
# Fancy alarm Misko_2083 @ 2020
# Requires: at, xfce4, wmctrl, xdotool, yad 0.42 (with html dialog), mpv
#########################
# Begin User Interface #
#########################
# JavaScript, HTML and CSS
@Misko-2083
Misko-2083 / brightness.sh
Created May 15, 2019 14:38
Sets the monitor brightness, yad notification icon
#!/bin/bash
# Script to set the monitor brightness
# Creates a notification icon UI
ERR(){ echo "ERROR: $1" 1>&2; }
declare -i DEPCOUNT=0
for DEP in /usr/bin/{xdotool,yad,xrandr};do
[ -x "$DEP" ] || {
ERR "$LINENO Dependency '$DEP' not met."
@Misko-2083
Misko-2083 / dynamic_transparency.sh
Last active December 12, 2019 04:58
Dynamic panel transparency (Budgie) like in Mate Desktop
#!/bin/bash
# Dynamic panel transparency (Budgie) like in Mate Desktop
# This script sets the top panel to full transparency if no maximized window is on the current workspace.
# Sort of like Dynamic Transparency with budgie-panel’s in Solus.
# Whenever there is a maximized window on a workspace the top panel will turn off transparency.
# The only issue is that clock applet opacity isn’t changing.
# Save, make executable, run on startup
# Requires: xprop, imagemagick
@Misko-2083
Misko-2083 / notif.sh
Created February 14, 2019 20:03
yad notification left click list example
#!/bin/bash
ERR(){ echo "ERROR: $1" 1>&2; }
declare -i DEPCOUNT=0
for DEP in /usr/bin/{xdotool,yad,xprop};do
[ -x "$DEP" ] || {
ERR "$LINENO Dependency '$DEP' not met."
DEPCOUNT+=1
}
@Misko-2083
Misko-2083 / yad-de-highlight
Last active May 12, 2018 19:07
bash script to remove highlight from yad form date filed
#!/bin/bash
# check if xdotool is installed
if ! hash xdotool; then
echo "Install xdotool!"
exit 1
fi
TEMPFILE="$(mktemp /tmp/yadformX.XXXXXX)"
@Misko-2083
Misko-2083 / wlist.sh
Created May 2, 2018 18:47
window switcher, bash, yad UI
#!/bin/bash
#######################################################
# Description: #
# bash script to list and focus windows #
# via yad list UI Misko_2083 #
#######################################################
ERR(){ echo "ERROR: $1" 1>&2; }
declare -i DEPCOUNT=0
@Misko-2083
Misko-2083 / briskier
Last active August 25, 2018 17:59
Brisk-menu workaround when it's not unmapping by hot-key in Ubuntu Mate
#!/bin/bash
### Brisk-menu workaround when it's not unmapping by hot-key in Ubuntu Mate
### Install xdotool
### Save this script and make it executable
###############################################################################
# Launching this script with the Super_L keyboard key
# Install ksuperkey https://github.com/hanschen/ksuperkey
# Set brisk menu hot-key to none '' or some other key combo like '<Ctrl>F10'
@Misko-2083
Misko-2083 / itchy-video
Created April 27, 2018 18:55
youtube-dl wrapper with yad paned dialog UI
#!/bin/bash
### Itchy video
### Downloads videos (with the best video + best audio or best option available) into ~/Videos
### If ffmpeg or avconv is installed, best video & best audio will be downloaded separately
### and combined into a single file
### Requires: xev (provided by "x11-utils" package), xdotool, yad, youtube-dl, wget
### Note: uses xev with -event option (so, should work in debian jessie or newer)
### Made by Misko_2083