From 060a8f28fa1fc648bdf66afb31a5d1efac868837 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 28 Jul 2023 22:24:15 +0200 Subject: makefu: move out to own repo, add vacation-note --- makefu/5pkgs/Fluffy/default.nix | 42 -- makefu/5pkgs/HermesLedControl/default.nix | 58 --- makefu/5pkgs/HermesLedControl/remove-logger.patch | 31 -- makefu/5pkgs/PkgDecrypt/default.nix | 27 - makefu/5pkgs/_4nxci/default.nix | 50 -- makefu/5pkgs/acdcli/default.nix | 22 - makefu/5pkgs/airsensor-py/default.nix | 17 - makefu/5pkgs/ampel/default.nix | 27 - makefu/5pkgs/awesomecfg/default.nix | 29 -- makefu/5pkgs/awesomecfg/full.cfg | 577 --------------------- makefu/5pkgs/awesomecfg/kiosk.lua | 535 ------------------- makefu/5pkgs/baidudl/default.nix | 23 - makefu/5pkgs/bin2iso/default.nix | 26 - makefu/5pkgs/bintray-upload/default.nix | 19 - makefu/5pkgs/cameraupload-server/default.nix | 23 - makefu/5pkgs/cc-tool/default.nix | 32 -- makefu/5pkgs/chapter-marker/default.nix | 31 -- makefu/5pkgs/chitubox/default.nix | 67 --- makefu/5pkgs/cmpforopenssl/default.nix | 82 --- makefu/5pkgs/cmpforopenssl/nix-ssl-cert-file.patch | 14 - makefu/5pkgs/cue2pops/default.nix | 24 - makefu/5pkgs/cups-ptouch/default.nix | 55 -- makefu/5pkgs/custom/alsa-tools/default.nix | 26 - makefu/5pkgs/custom/hydra-check/default.nix | 19 - makefu/5pkgs/custom/liveproxy/default.nix | 30 -- .../5pkgs/custom/mediawiki-matrix-bot/default.nix | 27 - makefu/5pkgs/custom/qcma/default.nix | 57 -- .../custom/quodlibet/remove-override-warning.patch | 54 -- .../custom/quodlibet/single-digit-discnumber.patch | 13 - makefu/5pkgs/debmirror/default.nix | 41 -- makefu/5pkgs/default.nix | 70 --- makefu/5pkgs/devpi/default.nix | 43 -- makefu/5pkgs/devpi/py3-fix-encoding.patch | 11 - makefu/5pkgs/drozer/default.nix | 35 -- makefu/5pkgs/elchhub/default.nix | 35 -- makefu/5pkgs/gen-oath-safe/default.nix | 37 -- makefu/5pkgs/git-xlsx-textconv/default.nix | 31 -- makefu/5pkgs/kalauerbot/badsync.patch | 14 - makefu/5pkgs/kalauerbot/default.nix | 23 - makefu/5pkgs/kalauerbot/matrixbot.patch | 12 - makefu/5pkgs/kalauerbot/python-matrixbot.nix | 31 -- makefu/5pkgs/kalauerbot/translate.patch | 17 - makefu/5pkgs/logstash-filter-tld/default.nix | 31 -- makefu/5pkgs/logstash-input-rss/default.nix | 31 -- makefu/5pkgs/logstash-output-exec/default.nix | 32 -- makefu/5pkgs/minibar/default.nix | 12 - makefu/5pkgs/mycube-flask/default.nix | 21 - makefu/5pkgs/nixpkgs-pytools/default.nix | 29 -- makefu/5pkgs/nltk/default.nix | 17 - makefu/5pkgs/nodemcu-uploader/default.nix | 25 - makefu/5pkgs/novnc/default.nix | 40 -- makefu/5pkgs/ns-atmosphere-programmer/default.nix | 38 -- makefu/5pkgs/ns-usbloader/default.nix | 35 -- makefu/5pkgs/nsrenamer/default.nix | 3 - makefu/5pkgs/nsrenamer/nsrenamer.sh | 58 --- makefu/5pkgs/nur.nix | 7 - makefu/5pkgs/nx_game_info/default.nix | 32 -- makefu/5pkgs/office-radio/default.nix | 23 - makefu/5pkgs/opl-pc-tools/default.nix | 44 -- makefu/5pkgs/opl-utils/default.nix | 28 - makefu/5pkgs/otpauth/default.nix | 24 - makefu/5pkgs/pavumeter/default.nix | 30 -- makefu/5pkgs/pfsshell/default.nix | 27 - makefu/5pkgs/pkg2zip/default.nix | 29 -- makefu/5pkgs/pkgrename/default.nix | 30 -- makefu/5pkgs/prison-break/default.nix | 21 - makefu/5pkgs/prison-break/straight-plugin.nix | 22 - makefu/5pkgs/ps3netsrv/default.nix | 33 -- makefu/5pkgs/ptouch-print/default.nix | 45 -- makefu/5pkgs/ratt/default.nix | 26 - makefu/5pkgs/seeed-voicecard/default.nix | 46 -- makefu/5pkgs/sfo/default.nix | 29 -- makefu/5pkgs/skytraq-logger/default.nix | 31 -- makefu/5pkgs/stockholm-new-host/default.nix | 50 -- makefu/5pkgs/studio-link/default.nix | 44 -- makefu/5pkgs/switch-launcher/default.nix | 24 - makefu/5pkgs/tinymediamanager/default.nix | 39 -- makefu/5pkgs/tw-upload-plugin/default.nix | 8 - makefu/5pkgs/v4l2loopback-dc/default.nix | 36 -- makefu/5pkgs/vpn-ws/default.nix | 30 -- makefu/5pkgs/xdcc-dl/default.nix | 195 ------- makefu/5pkgs/xmm7360/default.nix | 48 -- makefu/5pkgs/youtube-dl2kodi/default.nix | 11 - 83 files changed, 3821 deletions(-) delete mode 100644 makefu/5pkgs/Fluffy/default.nix delete mode 100644 makefu/5pkgs/HermesLedControl/default.nix delete mode 100644 makefu/5pkgs/HermesLedControl/remove-logger.patch delete mode 100644 makefu/5pkgs/PkgDecrypt/default.nix delete mode 100644 makefu/5pkgs/_4nxci/default.nix delete mode 100644 makefu/5pkgs/acdcli/default.nix delete mode 100644 makefu/5pkgs/airsensor-py/default.nix delete mode 100644 makefu/5pkgs/ampel/default.nix delete mode 100644 makefu/5pkgs/awesomecfg/default.nix delete mode 100644 makefu/5pkgs/awesomecfg/full.cfg delete mode 100644 makefu/5pkgs/awesomecfg/kiosk.lua delete mode 100644 makefu/5pkgs/baidudl/default.nix delete mode 100644 makefu/5pkgs/bin2iso/default.nix delete mode 100644 makefu/5pkgs/bintray-upload/default.nix delete mode 100644 makefu/5pkgs/cameraupload-server/default.nix delete mode 100644 makefu/5pkgs/cc-tool/default.nix delete mode 100644 makefu/5pkgs/chapter-marker/default.nix delete mode 100644 makefu/5pkgs/chitubox/default.nix delete mode 100644 makefu/5pkgs/cmpforopenssl/default.nix delete mode 100644 makefu/5pkgs/cmpforopenssl/nix-ssl-cert-file.patch delete mode 100644 makefu/5pkgs/cue2pops/default.nix delete mode 100644 makefu/5pkgs/cups-ptouch/default.nix delete mode 100644 makefu/5pkgs/custom/alsa-tools/default.nix delete mode 100644 makefu/5pkgs/custom/hydra-check/default.nix delete mode 100644 makefu/5pkgs/custom/liveproxy/default.nix delete mode 100644 makefu/5pkgs/custom/mediawiki-matrix-bot/default.nix delete mode 100644 makefu/5pkgs/custom/qcma/default.nix delete mode 100644 makefu/5pkgs/custom/quodlibet/remove-override-warning.patch delete mode 100644 makefu/5pkgs/custom/quodlibet/single-digit-discnumber.patch delete mode 100644 makefu/5pkgs/debmirror/default.nix delete mode 100644 makefu/5pkgs/default.nix delete mode 100644 makefu/5pkgs/devpi/default.nix delete mode 100644 makefu/5pkgs/devpi/py3-fix-encoding.patch delete mode 100644 makefu/5pkgs/drozer/default.nix delete mode 100644 makefu/5pkgs/elchhub/default.nix delete mode 100644 makefu/5pkgs/gen-oath-safe/default.nix delete mode 100644 makefu/5pkgs/git-xlsx-textconv/default.nix delete mode 100644 makefu/5pkgs/kalauerbot/badsync.patch delete mode 100644 makefu/5pkgs/kalauerbot/default.nix delete mode 100644 makefu/5pkgs/kalauerbot/matrixbot.patch delete mode 100644 makefu/5pkgs/kalauerbot/python-matrixbot.nix delete mode 100644 makefu/5pkgs/kalauerbot/translate.patch delete mode 100644 makefu/5pkgs/logstash-filter-tld/default.nix delete mode 100644 makefu/5pkgs/logstash-input-rss/default.nix delete mode 100644 makefu/5pkgs/logstash-output-exec/default.nix delete mode 100644 makefu/5pkgs/minibar/default.nix delete mode 100644 makefu/5pkgs/mycube-flask/default.nix delete mode 100644 makefu/5pkgs/nixpkgs-pytools/default.nix delete mode 100644 makefu/5pkgs/nltk/default.nix delete mode 100644 makefu/5pkgs/nodemcu-uploader/default.nix delete mode 100644 makefu/5pkgs/novnc/default.nix delete mode 100644 makefu/5pkgs/ns-atmosphere-programmer/default.nix delete mode 100644 makefu/5pkgs/ns-usbloader/default.nix delete mode 100644 makefu/5pkgs/nsrenamer/default.nix delete mode 100755 makefu/5pkgs/nsrenamer/nsrenamer.sh delete mode 100644 makefu/5pkgs/nur.nix delete mode 100644 makefu/5pkgs/nx_game_info/default.nix delete mode 100644 makefu/5pkgs/office-radio/default.nix delete mode 100644 makefu/5pkgs/opl-pc-tools/default.nix delete mode 100644 makefu/5pkgs/opl-utils/default.nix delete mode 100644 makefu/5pkgs/otpauth/default.nix delete mode 100644 makefu/5pkgs/pavumeter/default.nix delete mode 100644 makefu/5pkgs/pfsshell/default.nix delete mode 100644 makefu/5pkgs/pkg2zip/default.nix delete mode 100644 makefu/5pkgs/pkgrename/default.nix delete mode 100644 makefu/5pkgs/prison-break/default.nix delete mode 100644 makefu/5pkgs/prison-break/straight-plugin.nix delete mode 100644 makefu/5pkgs/ps3netsrv/default.nix delete mode 100644 makefu/5pkgs/ptouch-print/default.nix delete mode 100644 makefu/5pkgs/ratt/default.nix delete mode 100644 makefu/5pkgs/seeed-voicecard/default.nix delete mode 100644 makefu/5pkgs/sfo/default.nix delete mode 100644 makefu/5pkgs/skytraq-logger/default.nix delete mode 100644 makefu/5pkgs/stockholm-new-host/default.nix delete mode 100644 makefu/5pkgs/studio-link/default.nix delete mode 100644 makefu/5pkgs/switch-launcher/default.nix delete mode 100644 makefu/5pkgs/tinymediamanager/default.nix delete mode 100644 makefu/5pkgs/tw-upload-plugin/default.nix delete mode 100644 makefu/5pkgs/v4l2loopback-dc/default.nix delete mode 100644 makefu/5pkgs/vpn-ws/default.nix delete mode 100644 makefu/5pkgs/xdcc-dl/default.nix delete mode 100644 makefu/5pkgs/xmm7360/default.nix delete mode 100644 makefu/5pkgs/youtube-dl2kodi/default.nix (limited to 'makefu/5pkgs') diff --git a/makefu/5pkgs/Fluffy/default.nix b/makefu/5pkgs/Fluffy/default.nix deleted file mode 100644 index b32c6cab4..000000000 --- a/makefu/5pkgs/Fluffy/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ lib, pkgs, python3Packages, ... }: - -with python3Packages; buildPythonApplication rec { - name = "Fluffy-${version}"; - format = "other"; - version = "2.9"; - - src = pkgs.fetchFromGitHub { - owner = "fourminute"; - repo = "Fluffy"; - rev = "v${version}"; - sha256 = "1w1j7cdp0zpgwn7zi28z8dcbgnhxvllgh3rp1gkdjnpr4a6ngj8z"; - }; - - prePatch = '' - sed -e "s|/tmp|$HOME/.config/fluffy|" -i linux/fluffy.desktop - ''; - - installPhase = '' - env - install -Dm 644 linux/80-fluffy-switch.rules "$out/etc/udev/rules.d/80-fluffy-switch.rules" - install -Dm 644 linux/fluffy.desktop "$out/usr/share/applications/fluffy.desktop" - install -Dm 644 icons/16x16/fluffy.png "$out/share/icons/hicolor/16x16/apps/fluffy.png" - install -Dm 644 icons/24x24/fluffy.png "$out/share/icons/hicolor/24x24/apps/fluffy.png" - install -Dm 644 icons/32x32/fluffy.png "$out/share/icons/hicolor/32x32/apps/fluffy.png" - install -Dm 644 icons/48x48/fluffy.png "$out/share/icons/hicolor/48x48/apps/fluffy.png" - install -Dm 644 icons/64x64/fluffy.png "$out/share/icons/hicolor/64x64/apps/fluffy.png" - install -Dm 644 icons/128x128/fluffy.png "$out/share/icons/hicolor/128x128/apps/fluffy.png" - install -Dm 755 fluffy.pyw "$out/bin/fluffy" - wrapProgram "$out/bin/fluffy" --set PYTHONPATH "$PYTHONPATH" - ''; - - propagatedBuildInputs = [ - pyqt5 pyusb libusb1 configparser tkinter - ]; - - meta = { - homepage = https://github.com/fourminute/Fluffy; - description = "A feature-rich tool for installing NSPs"; - license = lib.licenses.gpl3; - }; -} diff --git a/makefu/5pkgs/HermesLedControl/default.nix b/makefu/5pkgs/HermesLedControl/default.nix deleted file mode 100644 index 77164f568..000000000 --- a/makefu/5pkgs/HermesLedControl/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ lib, pkgs, python3Packages, makeWrapper, ... }: - -# How to use: -# create configuration configuration.yml: -# engine: "rhasspy" -# pathToConfig: "/var/lib/rhasspy/de/profile.json" -# hardware: "respeaker4MicArray" -# pattern: "fake-name" -# enableDoA: false -# and run HermesLedControl --hermesLedControlConfig path-to-config.yml - -# all available config options can be see in: -# result/result/lib/HermesLedControl/models/Configuration.py - - -with python3Packages; buildPythonApplication rec { - name = "HermesLedControl-${version}"; - format = "other"; - version = "3.0.4"; - - src = pkgs.fetchFromGitHub { - owner = "project-alice-assistant"; - repo = "HermesLedControl"; - rev = "v${version}"; - hash = "sha256-fVbTQPSo3fNjLb8PDDDqhMC9Hez01rTH46cKz/mfwoU="; - }; - - patches = [ - ./remove-logger.patch - ]; - - execWrapper = '' - #!/bin/sh - cd $out/lib/HermesLedControl && \ - PYTHONPATH="${makePythonPath propagatedBuildInputs}" exec \ - ${python}/bin/python "$out/lib/HermesLedControl/main.py" "$@" - ''; - - installPhase = '' - install -d "$out/lib/" - install -d "$out/bin" - cp -r . $out/lib/HermesLedControl - - echo "${execWrapper}" > HermesLedControl - install -Dm755 HermesLedControl $out/bin/HermesLedControl - - ''; - - propagatedBuildInputs = [ - spidev gpiozero rpi-gpio pyyaml paho-mqtt types-pyyaml makeWrapper - ]; - - meta = { - homepage = "https://github.com/project-alice-assistant/HermesLedControl"; - description = "Provides an easy way to control your leds in an Hermes environment"; - license = lib.licenses.gpl3; - }; -} diff --git a/makefu/5pkgs/HermesLedControl/remove-logger.patch b/makefu/5pkgs/HermesLedControl/remove-logger.patch deleted file mode 100644 index a6b757d35..000000000 --- a/makefu/5pkgs/HermesLedControl/remove-logger.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/main.py b/main.py -old mode 100644 -new mode 100755 -index 9b5a269..350d443 ---- a/main.py -+++ b/main.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python3 - from logging import handlers - - import logging -@@ -17,18 +18,6 @@ _logger.setLevel(logging.DEBUG) - - date = int(datetime.now().strftime('%Y%m%d')) - --handler = logging.FileHandler(filename='logs.log', mode='w') --rotatingHandler = handlers.RotatingFileHandler(filename=f'./logs/{date}-logs.log', mode='a', maxBytes=100000, backupCount=5) --streamHandler = logging.StreamHandler() -- --handler.setFormatter(formatter) --rotatingHandler.setFormatter(formatter) --streamHandler.setFormatter(formatter) -- --_logger.addHandler(handler) --_logger.addHandler(rotatingHandler) --_logger.addHandler(streamHandler) -- - - def stopHandler(_signum, frame): - onStop() - diff --git a/makefu/5pkgs/PkgDecrypt/default.nix b/makefu/5pkgs/PkgDecrypt/default.nix deleted file mode 100644 index 80bcbcac1..000000000 --- a/makefu/5pkgs/PkgDecrypt/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv, lib, pkgs, fetchFromGitHub, ... }: -stdenv.mkDerivation rec { - name = "PkgDecrypt-2017-12-01"; - rev = "e2f9518"; - - src = fetchFromGitHub { - owner = "St4rk"; - repo = "PkgDecrypt"; - inherit rev; - sha256 = "0dk13qamxyny0vc990s06vqddxwwc6xmikb1pkc3rnys98yda29p"; - }; - - installPhase = '' - install -m755 -D pkg_dec $out/bin/pkg_dec - install -m755 -D make_key $out/bin/make_key - ''; - - buildInputs = with pkgs;[ - zlib - ]; - - meta = { - homepage = https://github.com/St4rk/PkgDecrypt; - description = "St4rk's Vita pkg decrypter"; - license = lib.licenses.gpl2; - }; -} diff --git a/makefu/5pkgs/_4nxci/default.nix b/makefu/5pkgs/_4nxci/default.nix deleted file mode 100644 index 47c02aca4..000000000 --- a/makefu/5pkgs/_4nxci/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }: -let - version = "4.03"; - src = fetchFromGitHub { - owner = "The-4n"; - repo = "4NXCI"; - rev = "v${version}"; - sha256 = "0n49sqv6s8cj2dw1dbcyskfc2zr92p27f1bdd6jqfbawv0fqr1wf"; - }; - - mymbedtls = stdenv.mkDerivation { - name = "mbedtls-${version}"; - version = "2.6.1"; - doCheck = false; - inherit src; - buildInputs = [ perl ]; - phases = [ "unpackPhase" "buildPhase" "installPhase" ]; - makeFlags = [ "DESTDIR=$(out)" ]; - buildPhase = '' - cp config.mk.template config.mk - cd mbedtls - make - ''; - }; -in stdenv.mkDerivation rec { - name = "4nxci-${version}"; - - inherit src version; - buildPhase = '' - cp config.mk.template config.mk - sed -i 's#\(INCLUDE =\).*#\1${mymbedtls}/include#' Makefile - sed -i 's#\(LIBDIR =\).*#\1${mymbedtls}/lib#' Makefile - make 4nxci - ''; - - installPhase = '' - install -m755 -D 4nxci $out/bin/4nxci - ''; - - #preInstall = '' - # mkdir -p $out/bin - #''; - - buildInputs = [ mymbedtls ]; - - meta = { - description = "convert xci to nsp"; - license = lib.licenses.isc; - }; -} diff --git a/makefu/5pkgs/acdcli/default.nix b/makefu/5pkgs/acdcli/default.nix deleted file mode 100644 index 13b19e482..000000000 --- a/makefu/5pkgs/acdcli/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ lib, pkgs, python3Packages, fetchurl, ... }: - -with python3Packages; buildPythonPackage rec { - name = "acdcli-${version}"; - version = "0.3.2"; - propagatedBuildInputs = [ - dateutil colorama fusepy appdirs requests requests_toolbelt six - ]; - src = fetchurl { - url = "mirror://pypi/a/acdcli/${name}.tar.gz"; - sha256 = "1ak9xxpyb7n6iyalf2082jpimklakm0fgm7vsv7qcm8wy6vlq2cw"; - }; - doCheck = false; # ImportError: Failed to import test module: tests - - # acd_cli gets dumped in bin and gets overwritten by fixupPhase - postFixup = '' - mv $out/bin/.acd_cli.py-wrapped $out/bin/acd_cli.py - ''; - meta = { - description = "communicate with amazon drive"; - }; -} diff --git a/makefu/5pkgs/airsensor-py/default.nix b/makefu/5pkgs/airsensor-py/default.nix deleted file mode 100644 index 86ea22d8d..000000000 --- a/makefu/5pkgs/airsensor-py/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, fetchFromGitHub, ... }: -with pkgs.python3Packages; -buildPythonApplication rec { - name = "airsensor-py-${version}"; - version = "1.0.0"; - propagatedBuildInputs = [ - pyusb - click - ]; - - src = fetchFromGitHub { - owner = "makefu"; - repo = "airsensor-py"; - rev = "1.0.0"; - sha256 = "1jpvvl965bg3ymvr58c433jyy0smczn65fnqsskxn7basznii5g8"; - }; -} diff --git a/makefu/5pkgs/ampel/default.nix b/makefu/5pkgs/ampel/default.nix deleted file mode 100644 index fb722a52f..000000000 --- a/makefu/5pkgs/ampel/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ lib, pkgs, fetchFromGitHub, ... }: - -with pkgs.python3Packages;buildPythonPackage rec { - name = "ampel-${version}"; - version = "0.2.5"; - - propagatedBuildInputs = [ - docopt - paho-mqtt - requests - pytz - influxdb - httplib2 - google_api_python_client - ]; - - src = pkgs.fetchgit { - url = "http://cgit.euer.krebsco.de/ampel"; - rev = "ce239876820699f02054e71b4fd0950509833379"; - sha256 = "1ja32lr04lwq4shi49kppa1zzjw0zlqaqy71pr5sbajgp4zj7kh8"; - }; - meta = { - homepage = http://cgit.euer.krebsco.de/ampel; - description = "change colors of rgb cubes"; - license = lib.licenses.asl20; - }; -} diff --git a/makefu/5pkgs/awesomecfg/default.nix b/makefu/5pkgs/awesomecfg/default.nix deleted file mode 100644 index 8552634ff..000000000 --- a/makefu/5pkgs/awesomecfg/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs -, lib -, alsaUtils -, xbacklight -, networkmanagerapplet -, blueman -, clipit -, flameshot -, chapter-marker ? false -, modkey ? "Mod4" -, locker? "${pkgs.xlock}/bin/xlock -mode blank" -, ... }: - -{ - # replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@ @chapter-marker@ - full = lib.makeOverridable pkgs.substituteAll { - name = "awesome_full_config"; - inherit alsaUtils locker xbacklight modkey networkmanagerapplet blueman clipit flameshot ; - isExecutable = false; - src = ./full.cfg; - }; - - kiosk = lib.makeOverridable pkgs.substituteAll { - name = "awesome_kiosk_config"; - inherit alsaUtils locker xbacklight modkey; - isExecutable = false; - src = ./kiosk.lua; - }; -} diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg deleted file mode 100644 index 430c9d511..000000000 --- a/makefu/5pkgs/awesomecfg/full.cfg +++ /dev/null @@ -1,577 +0,0 @@ --- Standard awesome library -local gears = require("gears") -local awful = require("awful") -local vicious = require("vicious") -awful.rules = require("awful.rules") -require("awful.autofocus") --- Widget and layout library -local wibox = require("wibox") --- Theme handling library -local beautiful = require("beautiful") --- Notification library -local naughty = require("naughty") -local menubar = require("menubar") - - - --- {{{ Error handling --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} - --- {{{ Mails widget type -local function worker(format,warg) - local ncount = 0 - for line in io.popen("ls "..warg..'/new'):lines() do - ncount = ncount +1 - end - local count = 2 - --for line in io.popen("ls "..warg..'/new'):lines() do - -- count = count +1 - --end - return {ncount,count} -end - -vicious_mails = setmetatable({}, { __call = function(_, ...) return worker(...) end }) -mailwidget = wibox.widget.textbox() - -local function only_new (widget,args) - if args[1] > 0 then - return string.format("%s new",args[1]) - else - return "" - end -end - -vicious.register(mailwidget, vicious_mails,only_new ,60,"~/Mail/localhost") - ---mdirwidget = wibox.widget.textbox() ---vicious.register(mdirwidget, vicious.widgets.mdir, ) - -cpuwidget = wibox.widget.graph() --- Graph properties -cpuwidget:set_width(50) -cpuwidget:set_background_color("#494B4F") -cpuwidget:set_color({ type = "linear", from = { 0, 0 }, to = { 10,0 }, stops = { {0, "#FF5656"}, {0.5, "#88A175"}, - {1, "#AECF96" }}}) -vicious.register(cpuwidget, vicious.widgets.cpu, "$1") - --- Register widget -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0") - --- {{{ Variable definitions --- Themes define colours, icons, and wallpapers - --- Find the default theme - -beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua") -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) - --- This is used later as the default terminal and editor to run. -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" -editor_cmd = terminal .. " -e " .. editor -browser = "firefox" - --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- If you do not like this or do not have such a key, --- I suggest you to remap Mod4 to another key using xmodmap or other tools. --- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "@modkey@" --- modkey = "Mod4" - --- Table of layouts to cover with awful.layout.inc, order matters. -awful.layout.layouts = -{ - awful.layout.suit.tile, --- awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.floating, --- 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 -} --- }}} --- {{{ Helper Functions -local function client_menu_toggle_fn() - local instance = nil - - return function () - if instance and instance.wibox.visible then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ theme = { width = 250 } }) - end - end -end --- }}} - --- {{{ Wallpaper -if beautiful.wallpaper then - for s = 1, screen.count() do - gears.wallpaper.maximized(beautiful.wallpaper, s, true) - end -end --- }}} - --- {{{ Tags --- Define a tag table which hold all screen tags. -tags = {} -for s = 1, screen.count() do - -- Each screen has its own tag table. -end --- }}} - --- {{{ Menu --- Create a laucher widget and a main menu -myawesomemenu = { - { "manual", terminal .. " -e man awesome" }, - { "edit config", editor_cmd .. " " .. awesome.conffile }, - { "restart", awesome.restart }, - { "quit", awesome.quit } -} - -mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal }, - { "pcmanfm", "pcmanfm"} - } - }) - -mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, - menu = mymainmenu }) - --- Menubar configuration -menubar.utils.terminal = terminal -- Set the terminal for applications that require it --- }}} - --- {{{ Wibox --- Create a textclock widget -mytextclock = wibox.widget.textclock() - --- Create a wibox for each screen and add it -mywibox = {} -mylayoutbox = {} - --- Create a wibox for each screen and add it -local taglist_buttons = awful.util.table.join( - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end), - awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) - ) - -local tasklist_buttons = awful.util.table.join( - awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - -- Without this, the following - -- :isvisible() makes no sense - c.minimized = false - if not c:isvisible() and c.first_tag then - c.first_tag:view_only() - end - -- This will also un-minimize - -- the client, if needed - client.focus = c - c:raise() - end - end), - awful.button({ }, 3, client_menu_toggle_fn()), - awful.button({ }, 4, function () - awful.client.focus.byidx(1) - end), - awful.button({ }, 5, function () - awful.client.focus.byidx(-1) - end)) - - -local function set_wallpaper(s) - -- Wallpaper - if beautiful.wallpaper then - local wallpaper = beautiful.wallpaper - -- If wallpaper is a function, call it with the screen - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - gears.wallpaper.maximized(wallpaper, s, true) - end -end - -awful.screen.connect_for_each_screen(function(s) - -- Wallpaper - set_wallpaper(s) - - -- Each screen has its own tag table. - awful.tag({ "tmp", "ssh", "www", "im", "mail","work","net","misc","remote" }, s, awful.layout.layouts[1]) - - -- Create a promptbox for each screen - s.mypromptbox = awful.widget.prompt() - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end))) - -- Create a taglist widget - s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons) - - -- Create a tasklist widget - s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons) - - -- Create the wibox - s.mywibox = awful.wibar({ position = "top", screen = s }) - - -- Add widgets to the wibox - s.mywibox:setup { - layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, - mylauncher, - s.mytaglist, - s.mypromptbox, - }, - s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - mykeyboardlayout, - mailwidget, - wibox.widget.systray(), - cpuwidget, - batwidget, - mytextclock, - s.mylayoutbox, - }, - } -end) - --- }}} - --- {{{ Mouse bindings -root.buttons(awful.util.table.join( - awful.button({ }, 3, function () mymainmenu:toggle() end), - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) -)) --- }}} - --- {{{ Key bindings -globalkeys = awful.util.table.join( - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - - awful.key({ modkey, }, "w", function () mymainmenu:show() end), - - -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end), - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, - {description = "open a terminal", group = "launcher"}), - awful.key({ modkey, "Control" }, "r", awesome.restart, - {description = "reload awesome", group = "awesome"}), - awful.key({ modkey, "Shift" }, "q", awesome.quit, - {description = "quit awesome", group = "awesome"}), - - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, - {description = "increase master width factor", group = "layout"}), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, - {description = "decrease master width factor", group = "layout"}), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, - {description = "increase the number of master clients", group = "layout"}), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, - {description = "decrease the number of master clients", group = "layout"}), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, - {description = "increase the number of columns", group = "layout"}), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, - {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), - awful.key({ modkey, "Control" }, "n", - function () - local c = awful.client.restore() - -- Focus restored client - if c then - client.focus = c - c:raise() - end - end, - {description = "restore minimized", group = "client"}), - - awful.key({ }, "XF86MonBrightnessUp", function () - awful.util.spawn("@xbacklight@/bin/xbacklight -inc 5", false) end), - awful.key({ }, "XF86MonBrightnessDown", function () - awful.util.spawn("@xbacklight@/bin/xbacklight -dec 5", false) end), - - awful.key({ }, "XF86AudioRaiseVolume", function () - awful.util.spawn("@alsaUtils@/bin/amixer set Master 5%+", false) end), - awful.key({ }, "XF86AudioLowerVolume", function () - awful.util.spawn("@alsaUtils@/bin/amixer set Master 5%-", false) end), - awful.key({ }, "XF86AudioMute", function () - awful.util.spawn("@alsaUtils@/bin/amixer -q -D default sset Master toggle", false) end), - - -- Prompt - awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, - {description = "run prompt", group = "launcher"}), - awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("@locker@") end), - awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("@locker@") end), - - awful.key({ modkey }, "x", - function () - awful.prompt.run { - prompt = "Run Lua code: ", - textbox = awful.screen.focused().mypromptbox.widget, - exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" - } - end, - {description = "lua execute prompt", group = "awesome"}), - - -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end) -) - -clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), - awful.key({ modkey, }, "o", awful.client.movetoscreen ), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end), - awful.key({ }, "Print", function () awful.util.spawn("@flameshot@/bin/flameshot gui") end), - awful.key({ modkey, }, "m", - function (c) - c.maximized = not c.maximized - end) -) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 - -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - -- View tag only. - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end - end, - {description = "view tag #"..i, group = "tag"}), - -- Toggle tag display. - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - awful.tag.viewtoggle(tag) - end - end, - {description = "toggle tag #" .. i, group = "tag"}), - -- Move client to tag. - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - {description = "move focused client to tag #"..i, group = "tag"}), - -- Toggle tag on focused client. - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - {description = "toggle focused client on tag #" .. i, group = "tag"}) - ) -end - - -clientbuttons = awful.util.table.join( - awful.button({ }, 1, function (c) client.focus = c; c:raise() end), - awful.button({ modkey }, 1, awful.mouse.client.move), - awful.button({ modkey }, 3, awful.mouse.client.resize)) - --- Set keys -root.keys(globalkeys) --- }}} - --- {{{ Rules -awful.rules.rules = { --- -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - keys = clientkeys, - screen = awful.screen.focused, - buttons = clientbuttons } }, - -- get class via `xprop WM_CLASS` -- will be second string - --{ rule = { class = "MPlayer" }, - -- properties = { floating = true } }, - { rule = { class = "pinentry" }, - properties = { floating = true } }, - --{ rule = { class = "gimp" }, - -- properties = { floating = true } }, - { rule = { class = "Firefox" }, - properties = { tag = tags[3] } }, - { rule = { class = "Signal" }, - properties = { tag = tags[4] } }, - -- { rule = { class = "TelegramDesktop" }, - -- properties = { tag = tags[4] } }, - { rule = { class = "Element" }, - properties = { tag = tags[4] } } -} --- }}} --- {{{ Signals --- Signal function to execute when a new client appears. -client.connect_signal("manage", function (c, startup) - -- Enable sloppy focus - c:connect_signal("mouse::enter", function(c) - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end - end) - - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if not c.size_hints.user_position and not c.size_hints.program_position then - awful.placement.no_overlap(c) - awful.placement.no_offscreen(c) - end - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- Widgets that are aligned to the right - local right_layout = wibox.layout.fixed.horizontal() - right_layout:add(awful.titlebar.widget.floatingbutton(c)) - right_layout:add(awful.titlebar.widget.maximizedbutton(c)) - right_layout:add(awful.titlebar.widget.stickybutton(c)) - right_layout:add(awful.titlebar.widget.ontopbutton(c)) - right_layout:add(awful.titlebar.widget.closebutton(c)) - - -- The title goes in the middle - local title = awful.titlebar.widget.titlewidget(c) - title:buttons(awful.util.table.join( - awful.button({ }, 1, function() - client.focus = c - c:raise() - awful.mouse.client.move(c) - end), - awful.button({ }, 3, function() - client.focus = c - c:raise() - awful.mouse.client.resize(c) - end) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) - end -end) -local setmetatable = setmetatable -local os = { - date = os.date, - time = os.time -} - --- }}} - --- {{{ autostart -do - -- awful.spawn("urxvt", { tag = tags[1] }) -- dev shell - awful.spawn("urxvt -e mosh makefu@gum.i", { tag = tags[2] }) - awful.spawn("firefox", { tag = tags[3] }) - awful.spawn("telegram-desktop", { tag = tags[4] }) - awful.spawn("element-desktop", { tag = tags[4] }) - awful.spawn("signal-desktop", { tag = tags[4] }) - awful.spawn("urxvt -e mutt", { tag = tags[5] }) -end - --- }}} diff --git a/makefu/5pkgs/awesomecfg/kiosk.lua b/makefu/5pkgs/awesomecfg/kiosk.lua deleted file mode 100644 index d0261f798..000000000 --- a/makefu/5pkgs/awesomecfg/kiosk.lua +++ /dev/null @@ -1,535 +0,0 @@ --- Standard awesome library -local gears = require("gears") -local awful = require("awful") -local vicious = require("vicious") -awful.rules = require("awful.rules") -require("awful.autofocus") --- Widget and layout library -local wibox = require("wibox") --- Theme handling library -local beautiful = require("beautiful") --- Notification library -local naughty = require("naughty") -local menubar = require("menubar") - - - --- {{{ Error handling --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - in_error = false - end) -end --- }}} - --- {{{ Mails widget type -local function worker(format,warg) - local ncount = 0 - for line in io.popen("ls "..warg..'/new'):lines() do - ncount = ncount +1 - end - local count = 2 - --for line in io.popen("ls "..warg..'/new'):lines() do - -- count = count +1 - --end - return {ncount,count} -end - -vicious_mails = setmetatable({}, { __call = function(_, ...) return worker(...) end }) -mailwidget = wibox.widget.textbox() - -local function only_new (widget,args) - if args[1] > 0 then - return string.format("%s new",args[1]) - else - return "" - end -end - -vicious.register(mailwidget, vicious_mails,only_new ,60,"~/Mail/localhost") - ---mdirwidget = wibox.widget.textbox() ---vicious.register(mdirwidget, vicious.widgets.mdir, ) - -cpuwidget = awful.widget.graph() --- Graph properties -cpuwidget:set_width(50) -cpuwidget:set_background_color("#494B4F") -cpuwidget:set_color({ type = "linear", from = { 0, 0 }, to = { 10,0 }, stops = { {0, "#FF5656"}, {0.5, "#88A175"}, - {1, "#AECF96" }}}) -vicious.register(cpuwidget, vicious.widgets.cpu, "$1") - --- Register widget -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0") - --- {{{ Variable definitions --- Themes define colours, icons, and wallpapers --- beautiful.init("/usr/share/awesome/themes/default/theme.lua") --- ./qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/lib/beautiful.lua --- --- Find the default theme - --- --- beautiful.init("/nix/store/qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/themes/default/theme.lua") - -function find_default_theme() - -- find the default lua theme in the package path - for path in package.path:gmatch('([^;]+);') do - if path:match('awesome.*share') then - theme_path = path:match('^([^?]*)') .. '../themes/default/theme.lua' - if awful.util.file_readable(theme_path) then return theme_path end - end - end -end - -beautiful.init(find_default_theme()) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) - --- This is used later as the default terminal and editor to run. -terminal = "urxvt" -editor = os.getenv("EDITOR") or "vim" -editor_cmd = terminal .. " -e " .. editor -browser = "firefox" - -modkey = "@modkey@" - --- Table of layouts to cover with awful.layout.inc, order matters. -local layouts = -{ - awful.layout.suit.tile, --- awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.floating, --- 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 -} --- }}} - --- {{{ Wallpaper -if beautiful.wallpaper then - for s = 1, screen.count() do - gears.wallpaper.maximized(beautiful.wallpaper, s, true) - end -end --- }}} - --- {{{ Tags --- Define a tag table which hold all screen tags. -tags = {} -for s = 1, screen.count() do - -- Each screen has its own tag table. - tags[s] = awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, layouts[1]) -end --- }}} - --- {{{ Menu --- Create a laucher widget and a main menu -myawesomemenu = { - { "manual", terminal .. " -e man awesome" }, - { "edit config", editor_cmd .. " " .. awesome.conffile }, - { "restart", awesome.restart }, - { "quit", awesome.quit } -} - -mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal }, - { "pcmanfm", "pcmanfm"} - } - }) - -mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, - menu = mymainmenu }) - --- Menubar configuration -menubar.utils.terminal = terminal -- Set the terminal for applications that require it --- }}} - --- {{{ Wibox --- Create a textclock widget -mytextclock = awful.widget.textclock() - --- Create a wibox for each screen and add it -mywibox = {} -mypromptbox = {} -mylayoutbox = {} -mytaglist = {} -mytaglist.buttons = awful.util.table.join( - awful.button({ }, 1, awful.tag.viewonly), - awful.button({ modkey }, 1, awful.client.movetotag), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, awful.client.toggletag), - awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) - ) -mytasklist = {} -mytasklist.buttons = awful.util.table.join( - awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - -- Without this, the following - -- :isvisible() makes no sense - c.minimized = false - if not c:isvisible() then - awful.tag.viewonly(c:tags()[1]) - end - -- This will also un-minimize - -- the client, if needed - client.focus = c - c:raise() - end - end), - awful.button({ }, 3, function () - if instance then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ width=250 }) - end - end), - awful.button({ }, 4, function () - awful.client.focus.byidx(1) - if client.focus then client.focus:raise() end - end), - awful.button({ }, 5, function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end)) - -for s = 1, screen.count() do - -- Create a promptbox for each screen - mypromptbox[s] = awful.widget.prompt() - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - mylayoutbox[s] = awful.widget.layoutbox(s) - mylayoutbox[s]:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), - awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) - -- Create a taglist widget - mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) - - -- Create a tasklist widget - mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - - -- Create the wibox - mywibox[s] = awful.wibox({ position = "top", screen = s }) - - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(mylauncher) - left_layout:add(mytaglist[s]) - left_layout:add(mypromptbox[s]) - - -- Widgets that are aligned to the right - local right_layout = wibox.layout.fixed.horizontal() - right_layout:add(mailwidget) - if s == 1 then right_layout:add(wibox.widget.systray()) end - right_layout:add(cpuwidget) - right_layout:add(batwidget) - right_layout:add(mytextclock) - right_layout:add(mylayoutbox[s]) - - -- Now bring it all together (with the tasklist in the middle) - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_middle(mytasklist[s]) - layout:set_right(right_layout) - - mywibox[s]:set_widget(layout) -end --- }}} - --- {{{ Mouse bindings -root.buttons(awful.util.table.join( - awful.button({ }, 3, function () mymainmenu:toggle() end), - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) -)) --- }}} - --- {{{ Key bindings -globalkeys = awful.util.table.join( - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - - awful.key({ modkey, }, "j", - function () - awful.client.focus.byidx( 1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "w", function () mymainmenu:show() end), - - -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end), - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, "Control" }, "r", awesome.restart), - awful.key({ modkey, "Shift" }, "q", awesome.quit), - - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), - awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), - - awful.key({ modkey, "Control" }, "n", awful.client.restore), - awful.key({ }, "XF86AudioRaiseVolume", function () - awful.util.spawn("amixer set Master 5%+", false) end), - awful.key({ }, "XF86AudioLowerVolume", function () - awful.util.spawn("amixer set Master 5%-", false) end), - awful.key({ }, "XF86AudioMute", function () - awful.util.spawn("amixer -q -D default sset Master toggle", false) end), - - -- Prompt - awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), - -- awful.key({ modkey }, "r", function () awful.util.spawn( "dmenu_run" ) end ), - awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("@locker@") end), - awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("@locker@") end), - - awful.key({ modkey }, "x", - function () - awful.prompt.run({ prompt = "Run Lua code: " }, - mypromptbox[mouse.screen].widget, - awful.util.eval, nil, - awful.util.getdir("cache") .. "/history_eval") - end), - -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end) -) - -clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), - awful.key({ modkey, }, "o", awful.client.movetoscreen ), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end), - awful.key({ modkey, }, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c.maximized_vertical = not c.maximized_vertical - end) -) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)) -end - --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, keynumber do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) - end - end)) -end - -clientbuttons = awful.util.table.join( - awful.button({ }, 1, function (c) client.focus = c; c:raise() end), - awful.button({ modkey }, 1, awful.mouse.client.move), - awful.button({ modkey }, 3, awful.mouse.client.resize)) - --- Set keys -root.keys(globalkeys) --- }}} - --- {{{ Rules -awful.rules.rules = { - -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - keys = clientkeys, - buttons = clientbuttons } }, - { rule = { class = "MPlayer" }, - properties = { floating = true } }, - { rule = { class = "pinentry" }, - properties = { floating = true } }, - { rule = { class = "gimp" }, - properties = { floating = true } }, - { rule = { class = "Anamnesis" }, - properties = { floating = true } }, - -- Set Firefox to always map on tags number 2 of screen 1. - -- { rule = { class = "Firefox" }, - -- properties = { tag = tags[1][2] } }, -} --- }}} - --- {{{ Signals --- Signal function to execute when a new client appears. -client.connect_signal("manage", function (c, startup) - -- Enable sloppy focus - c:connect_signal("mouse::enter", function(c) - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end - end) - - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if not c.size_hints.user_position and not c.size_hints.program_position then - awful.placement.no_overlap(c) - awful.placement.no_offscreen(c) - end - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- Widgets that are aligned to the right - local right_layout = wibox.layout.fixed.horizontal() - right_layout:add(awful.titlebar.widget.floatingbutton(c)) - right_layout:add(awful.titlebar.widget.maximizedbutton(c)) - right_layout:add(awful.titlebar.widget.stickybutton(c)) - right_layout:add(awful.titlebar.widget.ontopbutton(c)) - right_layout:add(awful.titlebar.widget.closebutton(c)) - - -- The title goes in the middle - local title = awful.titlebar.widget.titlewidget(c) - title:buttons(awful.util.table.join( - awful.button({ }, 1, function() - client.focus = c - c:raise() - awful.mouse.client.move(c) - end), - awful.button({ }, 3, function() - client.focus = c - c:raise() - awful.mouse.client.resize(c) - end) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) - end -end) -local setmetatable = setmetatable -local os = { - date = os.date, - time = os.time -} - --- }}} - -local current_screen = 1 -awful.rules.rules = { - { rule = { class = "chromium-browser" }, - callback = function() - -- TODO different tags, switch tag - awful.client.movetotag(tags[current_screen][1],c) - if (current_screen == 1) then - current_screen = current_screen+1 - else - current_screen = current_screen-1 - end - end - }, -} - --- awful.util.spawn_with_shell("chromium --new-window --kiosk https://www.checkpoint.com/ThreatPortal/livemap.html") ---awful.util.spawn_with_shell("chromium --new-window --kiosk http://wolf:3000/dashboard/db/soc-critical-values") --- awful.util.spawn_with_shell("sleep 0.5;chromium --new-window --kiosk http://wolf:3000/dashboard/db/aralast") ---awful.util.spawn