<commit_before>#!/usr/bin/env python3
# A custom menu (<EMAIL>)
# GNU/GPL https://www.gnu.org/licenses/gpl.html

import os
import sys
import shutil
from tkinter import Tk, Button, Scale, Menu, HORIZONTAL, TRUE, FALSE, E, W, S, N
from Executables import *

__sudo_cmd__ = "SUDO_ASKPASS=`which x11-ssh-askpass|which ssh-askpass` sudo --login --askpass "
__terminal__ = "terminology"
__editor__ = "code"
__file_manager__ = "gentoo"
__browser__ = "firefox"

def runCommand(app, prm="", hlpr=0, sudo=0):
    runstr = ""
    if sudo == 1: # Prefix sudo
        runstr += __sudo_cmd__ + " "

    if hlpr == 1: # Postfix helper
        runstr += __terminal__ + " -e "
    elif hlpr == 2:
        runstr += __editor__ + " "
    elif hlpr == 3:
        runstr += __file_manager__ + " "
    elif hlpr == 4:
        runstr += __browser__ + " "

    runstr += app + " " + prm + " &" # Append app, params and background

    print(runstr)
    os.system(runstr)

class TkRootMenu(Tk):

    def __init__(self, master):

        self.master = master
        self.master.title("Root Menu")

        opts = (("*resizable", TRUE), ("*tearOff", TRUE))
        for opt, cond in opts:
            self.master.option_add(opt, cond)

        self.master.geometry('105x50+64+64')

        self.l = Button(master, width=3, text="<=", command=lambda: runCommand("xdotool key 'ctrl+alt+Left'"))
        self.r = Button(master, width=3, text="=>", command=lambda: runCommand("xdotool key 'ctrl+alt+Right'"))

        self.v = Scale(master, from_=0, to=100, orient=HORIZONTAL, showvalue=0, command=self.setVlm)

        self.l.grid(row=0, sticky=W)
        self.r.grid(row=0, sticky=E)
        self.v.grid(row=1)

        self.v.set(75)

        binds = (("<Control-b>", self.on_accel_runBrowser),<commit_msg>requirements<commit_after>#!/usr/bin/env python3
# A custom menu (<EMAIL>)
# GNU/GPL https://www.gnu.org/licenses/gpl.html
# alsa-utils, sudo, ssh-askpass, xscreensaver, xdotool
import os
import sys
import shutil
from tkinter import Tk, Button, Scale, Menu, HORIZONTAL, TRUE, FALSE, E, W, S, N
from Executables import *

__sudo_cmd__ = "SUDO_ASKPASS=`which x11-ssh-askpass|which ssh-askpass` sudo --login --askpass "
__terminal__ = "terminology"
__editor__ = "code"
__file_manager__ = "gentoo"
__browser__ = "firefox"

def runCommand(app, prm="", hlpr=0, sudo=0):
    runstr = ""
    if sudo == 1: # Prefix sudo
        runstr += __sudo_cmd__ + " "

    if hlpr == 1: # Postfix helper
        runstr += __terminal__ + " -e "
    elif hlpr == 2:
        runstr += __editor__ + " "
    elif hlpr == 3:
        runstr += __file_manager__ + " "
    elif hlpr == 4:
        runstr += __browser__ + " "

    runstr += app + " " + prm + " &" # Append app, params and background

    print(runstr)
    os.system(runstr)

class TkRootMenu(Tk):

    def __init__(self, master):

        self.master = master
        self.master.title("Root Menu")

        opts = (("*resizable", TRUE), ("*tearOff", TRUE))
        for opt, cond in opts:
            self.master.option_add(opt, cond)

        self.master.geometry('105x50+64+64')

        self.l = Button(master, width=3, text="<=", command=lambda: runCommand("xdotool key 'ctrl+alt+Left'"))
        self.r = Button(master, width=3, text="=>", command=lambda: runCommand("xdotool key 'ctrl+alt+Right'"))

        self.v = Scale(master, from_=0, to=100, orient=HORIZONTAL, showvalue=0, command=self.setVlm)

        self.l.grid(row=0, sticky=W)
        self.r.grid(row=0, sticky=E)
        self.v.grid(row=1)

        self.v.set(75)

        binds = (
            ("<Control-b>", self.on_accel_runBrowser),
{'fraction_non_alphanumeric': 0.15433462175593596, 'fraction_numerical': 0.017117614577581448, 'mean_word_length': 2.925243770314193, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1399946', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1298, 'n_words': 296}