undo ricing
236
flake.lock
generated
@ -21,6 +21,46 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ags": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1718921313,
|
||||||
|
"narHash": "sha256-TFJah1RW5qnYW7kajjAFPAS5j/0q0R3vz9zPjrRA0Mc=",
|
||||||
|
"owner": "Aylur",
|
||||||
|
"repo": "ags",
|
||||||
|
"rev": "646d5ad073ff7f8b1d50cfbd40f5b8a250fcd59d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Aylur",
|
||||||
|
"repo": "ags",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"anyrun": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1717576207,
|
||||||
|
"narHash": "sha256-LU6d1xX7jN1zt10YU7Oym07MtzVfziSmUEznGFdbuaw=",
|
||||||
|
"owner": "Kirottu",
|
||||||
|
"repo": "anyrun",
|
||||||
|
"rev": "7aabad8d5bb7d1bffae903ce86427b888ab824b4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Kirottu",
|
||||||
|
"repo": "anyrun",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"base16": {
|
"base16": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"fromYaml": "fromYaml"
|
"fromYaml": "fromYaml"
|
||||||
@ -150,6 +190,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"firefox-gnome-theme": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1720790484,
|
||||||
|
"narHash": "sha256-H1yMxIoxqpYotxiqXYxNYf3LZ1PE4K/mbjHGtpJrfYI=",
|
||||||
|
"owner": "rafaelmardojai",
|
||||||
|
"repo": "firefox-gnome-theme",
|
||||||
|
"rev": "cbd351c587211d48c77cc679b49aa7292ec556dc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rafaelmardojai",
|
||||||
|
"repo": "firefox-gnome-theme",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -182,6 +238,47 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"anyrun",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1717285511,
|
||||||
|
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1719994518,
|
||||||
|
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fromYaml": {
|
"fromYaml": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -215,6 +312,29 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gross": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1698945515,
|
||||||
|
"narHash": "sha256-c3PpMckBQpVrNmhslN+mY/CZ5DIOLSWxA3ZQsDgTAOg=",
|
||||||
|
"owner": "fufexan",
|
||||||
|
"repo": "gross",
|
||||||
|
"rev": "68de266681bf070372270db822990dfbfe8250b1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "fufexan",
|
||||||
|
"repo": "gross",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -291,8 +411,8 @@
|
|||||||
"hyprlang": "hyprlang",
|
"hyprlang": "hyprlang",
|
||||||
"hyprutils": "hyprutils",
|
"hyprutils": "hyprutils",
|
||||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"systems": "systems",
|
"systems": "systems_2",
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -467,7 +587,58 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"matugen": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1719821386,
|
||||||
|
"narHash": "sha256-KyDPTF8AdcN7SaanCUtlZMDHAHNYXtrryfcN28PIwTs=",
|
||||||
|
"owner": "InioX",
|
||||||
|
"repo": "Matugen",
|
||||||
|
"rev": "250809841ed4133ced82d78e3d46e2425f86694f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "InioX",
|
||||||
|
"repo": "Matugen",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"more-waita": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1714324684,
|
||||||
|
"narHash": "sha256-E8zkq8Zfn90Qrn5clXquHAQhAI4K4/7JV7fjujf1P7U=",
|
||||||
|
"owner": "somepaulo",
|
||||||
|
"repo": "MoreWaita",
|
||||||
|
"rev": "0f4ed19f51b5ca8f0622c9e154886efb2a5ff59b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "somepaulo",
|
||||||
|
"repo": "MoreWaita",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1718714799,
|
||||||
|
"narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720542800,
|
"lastModified": 1720542800,
|
||||||
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
|
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
|
||||||
@ -483,7 +654,23 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1716330097,
|
||||||
|
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719690277,
|
"lastModified": 1719690277,
|
||||||
"narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=",
|
"narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=",
|
||||||
@ -499,7 +686,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714912032,
|
"lastModified": 1714912032,
|
||||||
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
|
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
|
||||||
@ -518,12 +705,19 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"aagl": "aagl",
|
"aagl": "aagl",
|
||||||
|
"ags": "ags",
|
||||||
|
"anyrun": "anyrun",
|
||||||
"catppuccin": "catppuccin",
|
"catppuccin": "catppuccin",
|
||||||
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
|
"flake-parts": "flake-parts_2",
|
||||||
|
"gross": "gross",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"hyprland-hyprspace": "hyprland-hyprspace",
|
"hyprland-hyprspace": "hyprland-hyprspace",
|
||||||
"hyprland-plugins": "hyprland-plugins",
|
"hyprland-plugins": "hyprland-plugins",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"matugen": "matugen",
|
||||||
|
"more-waita": "more-waita",
|
||||||
|
"nixpkgs": "nixpkgs_4",
|
||||||
"stylix": "stylix"
|
"stylix": "stylix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -539,7 +733,7 @@
|
|||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
"gnome-shell": "gnome-shell",
|
"gnome-shell": "gnome-shell",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719525570,
|
"lastModified": 1719525570,
|
||||||
@ -570,6 +764,36 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689347949,
|
||||||
|
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689347949,
|
||||||
|
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default-linux",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xdph": {
|
"xdph": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprland-protocols": "hyprland-protocols",
|
"hyprland-protocols": "hyprland-protocols",
|
||||||
|
|||||||
30
flake.nix
@ -29,6 +29,36 @@
|
|||||||
url = "github:KZDKM/Hyprspace";
|
url = "github:KZDKM/Hyprspace";
|
||||||
inputs.hyprland.follows = "hyprland";
|
inputs.hyprland.follows = "hyprland";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ags.url = "github:Aylur/ags";
|
||||||
|
|
||||||
|
flake-parts = {
|
||||||
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
gross = {
|
||||||
|
url = "github:fufexan/gross";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-parts.follows = "flake-parts";
|
||||||
|
};
|
||||||
|
|
||||||
|
matugen.url = "github:InioX/Matugen";
|
||||||
|
|
||||||
|
more-waita = {
|
||||||
|
url = "github:somepaulo/MoreWaita";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
firefox-gnome-theme = {
|
||||||
|
url = "github:rafaelmardojai/firefox-gnome-theme";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
anyrun = {
|
||||||
|
url = "github:Kirottu/anyrun";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.file.".config/awesome" = {
|
|
||||||
recursive = true;
|
|
||||||
source = ./gruv;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::battery
|
|
||||||
-- percentage (integer)
|
|
||||||
-- evil::charger
|
|
||||||
-- plugged (boolean)
|
|
||||||
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local update_interval = 30
|
|
||||||
|
|
||||||
-- Subscribe to power supply status changes with acpi_listen
|
|
||||||
local charger_script = [[
|
|
||||||
sh -c '
|
|
||||||
acpi_listen | grep --line-buffered ac_adapter
|
|
||||||
'
|
|
||||||
]]
|
|
||||||
|
|
||||||
-- First get battery file path
|
|
||||||
-- If there are multiple, only get the first one
|
|
||||||
-- TODO support multiple batteries
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
'sh -c \'out="$(find /sys/class/power_supply/BAT?/capacity)" && (echo "$out" | head -1) || false\' ',
|
|
||||||
function(battery_file, _, __, exit_code)
|
|
||||||
-- No battery file found
|
|
||||||
if not (exit_code == 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- Periodically get battery info
|
|
||||||
awful.widget.watch("cat " .. battery_file, update_interval, function(_, stdout)
|
|
||||||
awesome.emit_signal("evil::battery", tonumber(stdout))
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
-- First get charger file path
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
'sh -c \'out="$(find /sys/class/power_supply/*/online)" && (echo "$out" | head -1) || false\' ',
|
|
||||||
function(charger_file, _, __, exit_code)
|
|
||||||
-- No charger file found
|
|
||||||
if not (exit_code == 0) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- Then initialize function that emits charger info
|
|
||||||
local emit_charger_info = function()
|
|
||||||
awful.spawn.easy_async_with_shell("cat " .. charger_file, function(out)
|
|
||||||
local status = tonumber(out) == 1
|
|
||||||
awesome.emit_signal("evil::charger", status)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Run once to initialize widgets
|
|
||||||
emit_charger_info()
|
|
||||||
|
|
||||||
-- Kill old acpi_listen process
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
"ps x | grep \"acpi_listen\" | grep -v grep | awk '{print $1}' | xargs kill",
|
|
||||||
function()
|
|
||||||
-- Update charger status with each line printed
|
|
||||||
awful.spawn.with_line_callback(charger_script, {
|
|
||||||
stdout = function(_)
|
|
||||||
emit_charger_info()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::brightness
|
|
||||||
-- value (integer)
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local function emit()
|
|
||||||
awful.spawn.with_line_callback('sh -c "light -G"', {
|
|
||||||
stdout = function(line)
|
|
||||||
local value = math.floor(tonumber(line))
|
|
||||||
awesome.emit_signal("evil::brightness", value)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Run once to initialize widgets
|
|
||||||
emit()
|
|
||||||
|
|
||||||
-- Subscribe to backlight changes
|
|
||||||
-- Requires inotify-tools
|
|
||||||
local subscribe = [[ bash -c "while (inotifywait -e modify /sys/class/backlight/?*/brightness -qq) do echo; done"]]
|
|
||||||
|
|
||||||
-- Kill old inotifywait process
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
"ps x | grep \"inotifywait -e modify /sys/class/backlight\" | grep -v grep | awk '{print $1}' | xargs kill",
|
|
||||||
function()
|
|
||||||
-- Update brightness status with each line printed
|
|
||||||
awful.spawn.with_line_callback(subscribe, {
|
|
||||||
stdout = function()
|
|
||||||
emit()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::cpu
|
|
||||||
-- used percentage (integer)
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local update_interval = 5
|
|
||||||
local cpu_idle_script = [[
|
|
||||||
sh -c "
|
|
||||||
vmstat 1 2 | tail -1 | awk '{printf \"%d\", $15}'
|
|
||||||
"]]
|
|
||||||
|
|
||||||
-- Periodically get cpu info
|
|
||||||
awful.widget.watch(cpu_idle_script, update_interval, function(widget, stdout)
|
|
||||||
-- local cpu_idle = stdout:match('+(.*)%.%d...(.*)%(')
|
|
||||||
local cpu_idle = stdout
|
|
||||||
cpu_idle = string.gsub(cpu_idle, "^%s*(.-)%s*$", "%1")
|
|
||||||
awesome.emit_signal("evil::cpu", 100 - tonumber(cpu_idle))
|
|
||||||
end)
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
-- Monitoring
|
|
||||||
require("evil.cpu")
|
|
||||||
require("evil.ram")
|
|
||||||
|
|
||||||
-- User controlled
|
|
||||||
require("evil.volume")
|
|
||||||
require("evil.playerctl")
|
|
||||||
-- require("evil.brightness")
|
|
||||||
-- require("evil.battery")
|
|
||||||
|
|
||||||
-- Internet access required
|
|
||||||
require("evil.weather")
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::playerctl
|
|
||||||
-- artist (string)
|
|
||||||
-- song (string)
|
|
||||||
-- status (string) [playing | paused | stopped]
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local function emit_info(playerctl_output)
|
|
||||||
local artist = playerctl_output:match("artist_start(.*)title_start")
|
|
||||||
local title = playerctl_output:match("title_start(.*)status_start")
|
|
||||||
-- Use the lower case of status
|
|
||||||
local status = playerctl_output:match("status_start(.*)"):lower()
|
|
||||||
status = string.gsub(status, "^%s*(.-)%s*$", "%1")
|
|
||||||
|
|
||||||
awesome.emit_signal("evil::playerctl", artist, title, status)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Sleeps until playerctl changes state (pause/play/next/prev)
|
|
||||||
local playerctl_script = [[
|
|
||||||
sh -c '
|
|
||||||
playerctl metadata --format 'artist_start{{artist}}title_start{{title}}status_start{{status}}' --follow
|
|
||||||
']]
|
|
||||||
|
|
||||||
-- Kill old playerctl process
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
"ps x | grep \"playerctl metadata\" | grep -v grep | awk '{print $1}' | xargs kill",
|
|
||||||
function()
|
|
||||||
-- Emit song info with each line printed
|
|
||||||
awful.spawn.with_line_callback(playerctl_script, {
|
|
||||||
stdout = function(line)
|
|
||||||
emit_info(line)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::ram
|
|
||||||
-- used (integer - mega bytes)
|
|
||||||
-- total (integer - mega bytes)
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local update_interval = 20
|
|
||||||
-- Returns the used amount of ram in percentage
|
|
||||||
local ram_script = [[
|
|
||||||
sh -c "
|
|
||||||
free -m | grep 'Mem:' | awk '{printf \"%d@@%d@\", $7, $2}'
|
|
||||||
"]]
|
|
||||||
|
|
||||||
-- Periodically get ram info
|
|
||||||
awful.widget.watch(ram_script, update_interval, function(widget, stdout)
|
|
||||||
local available = stdout:match("(.*)@@")
|
|
||||||
local total = stdout:match("@@(.*)@")
|
|
||||||
local used = tonumber(total) - tonumber(available)
|
|
||||||
awesome.emit_signal("evil::ram", used, tonumber(total))
|
|
||||||
end)
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::volume
|
|
||||||
-- volume
|
|
||||||
-- muted
|
|
||||||
local awful = require("awful")
|
|
||||||
|
|
||||||
local volume_old = -1
|
|
||||||
local muted_old = -1
|
|
||||||
local function emit()
|
|
||||||
-- Requires wireplumber
|
|
||||||
awful.spawn.easy_async_with_shell("wpctl get-volume @DEFAULT_AUDIO_SINK@", function(out)
|
|
||||||
local volume = tonumber(string.match(out:match("(%d%.%d+)") * 100, "(%d+)"))
|
|
||||||
local muted = out:match("MUTED")
|
|
||||||
|
|
||||||
local icon = ""
|
|
||||||
if muted or volume == 0 then
|
|
||||||
icon = ""
|
|
||||||
elseif volume <= 33 then
|
|
||||||
icon = ""
|
|
||||||
elseif volume <= 66 then
|
|
||||||
icon = ""
|
|
||||||
elseif volume <= 100 then
|
|
||||||
icon = ""
|
|
||||||
else
|
|
||||||
icon = ""
|
|
||||||
end
|
|
||||||
|
|
||||||
if volume ~= volume_old or muted ~= muted_old then
|
|
||||||
awesome.emit_signal("evil::volume", volume, muted, icon)
|
|
||||||
volume_old = volume
|
|
||||||
muted_old = muted
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Run once to initialize widgets
|
|
||||||
emit()
|
|
||||||
|
|
||||||
-- Subscribe to pactl changes
|
|
||||||
local subscribe = [[ bash -c "LANG=C pactl subscribe 2> /dev/null | grep --line-buffered \"Event 'change' on sink\"" ]]
|
|
||||||
|
|
||||||
-- Kill old pactl processes
|
|
||||||
awful.spawn.easy_async({ "pkill", "--full", "--uid", os.getenv("USER"), "^pactl subscribe" }, function()
|
|
||||||
awful.spawn.with_line_callback(subscribe, {
|
|
||||||
stdout = function()
|
|
||||||
emit()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
-- Provides:
|
|
||||||
-- evil::weather
|
|
||||||
-- result json (string)
|
|
||||||
local awful = require("awful")
|
|
||||||
local json = require("modules.json")
|
|
||||||
|
|
||||||
local api_key = user.openweathermap_key
|
|
||||||
local coordinates = user.openweathermap_city_id
|
|
||||||
local units = user.openweathermap_weather_units
|
|
||||||
|
|
||||||
local url = (
|
|
||||||
"https://api.openweathermap.org/data/2.5/onecall"
|
|
||||||
.. "?lat="
|
|
||||||
.. coordinates[1]
|
|
||||||
.. "&lon="
|
|
||||||
.. coordinates[2]
|
|
||||||
.. "&appid="
|
|
||||||
.. api_key
|
|
||||||
.. "&units="
|
|
||||||
.. units
|
|
||||||
.. "&exclude=minutely"
|
|
||||||
)
|
|
||||||
|
|
||||||
local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]]
|
|
||||||
|
|
||||||
awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout, stderr)
|
|
||||||
if stderr == "" then
|
|
||||||
local result = json.decode(stdout)
|
|
||||||
awesome.emit_signal("evil::weather", result)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
@ -1,250 +0,0 @@
|
|||||||
local beautiful = require("beautiful")
|
|
||||||
local xresources = require("beautiful.xresources")
|
|
||||||
local dpi = xresources.apply_dpi
|
|
||||||
local awful = require("awful")
|
|
||||||
local gears = require("gears")
|
|
||||||
local helpers = {}
|
|
||||||
|
|
||||||
-- Mouse hover
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.add_hover_cursor(w, hover_cursor)
|
|
||||||
local original_cursor = "left_ptr"
|
|
||||||
|
|
||||||
w:connect_signal("mouse::enter", function()
|
|
||||||
local w = _G.mouse.current_wibox
|
|
||||||
if w then
|
|
||||||
w.cursor = hover_cursor
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
w:connect_signal("mouse::leave", function()
|
|
||||||
local w = _G.mouse.current_wibox
|
|
||||||
if w then
|
|
||||||
w.cursor = original_cursor
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Create rounded rectangle shape (in one line)
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.rrect(radius)
|
|
||||||
return function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, radius)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Raise or spawn
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.run_or_raise(match, move, spawn_cmd, spawn_args)
|
|
||||||
local matcher = function(c)
|
|
||||||
return awful.rules.match(c, match)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Find and raise
|
|
||||||
local found = false
|
|
||||||
for c in awful.client.iterate(matcher) do
|
|
||||||
found = true
|
|
||||||
c.minimized = false
|
|
||||||
if move then
|
|
||||||
c:move_to_tag(mouse.screen.selected_tag)
|
|
||||||
client.focus = c
|
|
||||||
else
|
|
||||||
c:jump_to()
|
|
||||||
end
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Spawn if not found
|
|
||||||
if not found then
|
|
||||||
awful.spawn(spawn_cmd, spawn_args)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Run raise or minimize a client (scratchpad style)
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.scratchpad(match, spawn_cmd, spawn_args)
|
|
||||||
local cf = client.focus
|
|
||||||
if cf and awful.rules.match(cf, match) then
|
|
||||||
cf.minimized = true
|
|
||||||
else
|
|
||||||
helpers.run_or_raise(match, true, spawn_cmd, spawn_args)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Resize DWIM (Do What I Mean)
|
|
||||||
-- ===================================================================
|
|
||||||
-- Resize client or factor
|
|
||||||
-- Constants
|
|
||||||
local floating_resize_amount = dpi(20)
|
|
||||||
local tiling_resize_factor = 0.05
|
|
||||||
---------------
|
|
||||||
function helpers.resize_dwim(c, direction)
|
|
||||||
if c and c.floating then
|
|
||||||
if direction == "up" then
|
|
||||||
c:relative_move(0, 0, 0, -floating_resize_amount)
|
|
||||||
elseif direction == "down" then
|
|
||||||
c:relative_move(0, 0, 0, floating_resize_amount)
|
|
||||||
elseif direction == "left" then
|
|
||||||
c:relative_move(0, 0, -floating_resize_amount, 0)
|
|
||||||
elseif direction == "right" then
|
|
||||||
c:relative_move(0, 0, floating_resize_amount, 0)
|
|
||||||
end
|
|
||||||
elseif awful.layout.get(mouse.screen) ~= awful.layout.suit.floating then
|
|
||||||
if direction == "up" then
|
|
||||||
awful.client.incwfact(-tiling_resize_factor)
|
|
||||||
elseif direction == "down" then
|
|
||||||
awful.client.incwfact(tiling_resize_factor)
|
|
||||||
elseif direction == "left" then
|
|
||||||
awful.tag.incmwfact(-tiling_resize_factor)
|
|
||||||
elseif direction == "right" then
|
|
||||||
awful.tag.incmwfact(tiling_resize_factor)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Change volume
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.volume_control(step)
|
|
||||||
local cmd
|
|
||||||
if step == 0 then
|
|
||||||
cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
|
||||||
else
|
|
||||||
sign = step > 0 and "+" or ""
|
|
||||||
cmd = "pactl set-sink-mute @DEFAULT_SINK@ 0 && pactl set-sink-volume @DEFAULT_SINK@ "
|
|
||||||
.. sign
|
|
||||||
.. tostring(step)
|
|
||||||
.. "%"
|
|
||||||
end
|
|
||||||
awful.spawn.with_shell(cmd)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Quick markup
|
|
||||||
-- ===================================================================
|
|
||||||
function helpers.colorize_text(text, color)
|
|
||||||
return "<span foreground='" .. color .. "'>" .. text .. "</span>"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Lighten or darken hex colors
|
|
||||||
-- ===================================================================
|
|
||||||
-- Rounds to whole number
|
|
||||||
local function round(num)
|
|
||||||
return math.floor(num + 0.5)
|
|
||||||
end
|
|
||||||
-- Rounds to hundredths
|
|
||||||
local function roundH(num)
|
|
||||||
return math.floor((num * 100) + 0.5) / 100
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Converts hexadecimal color to HSL
|
|
||||||
-- Lightness (L) is changed based on amt
|
|
||||||
-- Converts HSL back to hex
|
|
||||||
-- amt (0-100) can be negative to darken or positive to lighten
|
|
||||||
-- The amt specified is added to the color's existing Lightness
|
|
||||||
-- e.g., (#000000, 25) L = 25 but (#404040, 25) L = 50
|
|
||||||
|
|
||||||
function helpers.lighten(hex_color, amt)
|
|
||||||
local r, g, b, a
|
|
||||||
local hex = hex_color:gsub("#", "")
|
|
||||||
if #hex < 6 then
|
|
||||||
local t = {}
|
|
||||||
for i = 1, #hex do
|
|
||||||
local char = hex:sub(i, i)
|
|
||||||
t[i] = char .. char
|
|
||||||
end
|
|
||||||
hex = table.concat(t)
|
|
||||||
end
|
|
||||||
r = tonumber(hex:sub(1, 2), 16) / 255
|
|
||||||
g = tonumber(hex:sub(3, 4), 16) / 255
|
|
||||||
b = tonumber(hex:sub(5, 6), 16) / 255
|
|
||||||
if #hex ~= 6 then
|
|
||||||
a = roundH(tonumber(hex:sub(7, 8), 16) / 255)
|
|
||||||
end
|
|
||||||
|
|
||||||
local max = math.max(r, g, b)
|
|
||||||
local min = math.min(r, g, b)
|
|
||||||
local c = max - min
|
|
||||||
|
|
||||||
-- Hue
|
|
||||||
local h
|
|
||||||
if c == 0 then
|
|
||||||
h = 0
|
|
||||||
elseif max == r then
|
|
||||||
h = ((g - b) / c) % 6
|
|
||||||
elseif max == g then
|
|
||||||
h = ((b - r) / c) + 2
|
|
||||||
elseif max == b then
|
|
||||||
h = ((r - g) / c) + 4
|
|
||||||
end
|
|
||||||
h = h * 60
|
|
||||||
|
|
||||||
-- Luminance
|
|
||||||
local l = (max + min) * 0.5
|
|
||||||
|
|
||||||
-- Saturation
|
|
||||||
local s
|
|
||||||
if l == 0 then
|
|
||||||
s = 0
|
|
||||||
elseif l <= 0.5 then
|
|
||||||
s = c / (l * 2)
|
|
||||||
elseif l > 0.5 then
|
|
||||||
s = c / (2 - (l * 2))
|
|
||||||
end
|
|
||||||
|
|
||||||
local H, S, L, A
|
|
||||||
H = round(h) / 360
|
|
||||||
S = round(s * 100) / 100
|
|
||||||
L = round(l * 100) / 100
|
|
||||||
|
|
||||||
amt = amt / 100
|
|
||||||
if L + amt > 1 then
|
|
||||||
L = 1
|
|
||||||
elseif L + amt < 0 then
|
|
||||||
L = 0
|
|
||||||
else
|
|
||||||
L = L + amt
|
|
||||||
end
|
|
||||||
|
|
||||||
local R, G, B
|
|
||||||
if S == 0 then
|
|
||||||
R, G, B = round(L * 255), round(L * 255), round(L * 255)
|
|
||||||
else
|
|
||||||
local function hue2rgb(p, q, t)
|
|
||||||
if t < 0 then
|
|
||||||
t = t + 1
|
|
||||||
end
|
|
||||||
if t > 1 then
|
|
||||||
t = t - 1
|
|
||||||
end
|
|
||||||
if t < 1 / 6 then
|
|
||||||
return p + (q - p) * (6 * t)
|
|
||||||
end
|
|
||||||
if t < 1 / 2 then
|
|
||||||
return q
|
|
||||||
end
|
|
||||||
if t < 2 / 3 then
|
|
||||||
return p + (q - p) * (2 / 3 - t) * 6
|
|
||||||
end
|
|
||||||
return p
|
|
||||||
end
|
|
||||||
local q
|
|
||||||
if L < 0.5 then
|
|
||||||
q = L * (1 + S)
|
|
||||||
else
|
|
||||||
q = L + S - (L * S)
|
|
||||||
end
|
|
||||||
local p = 2 * L - q
|
|
||||||
R = round(hue2rgb(p, q, (H + 1 / 3)) * 255)
|
|
||||||
G = round(hue2rgb(p, q, H) * 255)
|
|
||||||
B = round(hue2rgb(p, q, (H - 1 / 3)) * 255)
|
|
||||||
end
|
|
||||||
|
|
||||||
if a ~= nil then
|
|
||||||
A = round(a * 255)
|
|
||||||
return string.format("#" .. "%.2x%.2x%.2x%.2x", R, G, B, A)
|
|
||||||
else
|
|
||||||
return string.format("#" .. "%.2x%.2x%.2x", R, G, B)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return helpers
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,582 +0,0 @@
|
|||||||
-- ░█░█░█▀▀░█░█░█▀▄░▀█▀░█▀█░█▀▄░█▀▀
|
|
||||||
-- ░█▀▄░█▀▀░░█░░█▀▄░░█░░█░█░█░█░▀▀█
|
|
||||||
-- ░▀░▀░▀▀▀░░▀░░▀▀░░▀▀▀░▀░▀░▀▀░░▀▀▀
|
|
||||||
|
|
||||||
local gears = require("gears")
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
local awful = require("awful")
|
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
|
||||||
local helpers = require("helpers")
|
|
||||||
local awesome = awesome
|
|
||||||
local client = client
|
|
||||||
local root = root
|
|
||||||
local keys = {}
|
|
||||||
|
|
||||||
local mod = "Mod4"
|
|
||||||
local alt = "Mod1"
|
|
||||||
local ctrl = "Control"
|
|
||||||
local shift = "Shift"
|
|
||||||
|
|
||||||
-- Menu
|
|
||||||
-- =============================================
|
|
||||||
local menu = {}
|
|
||||||
menu.awesome = {
|
|
||||||
{
|
|
||||||
"Hotkeys",
|
|
||||||
function()
|
|
||||||
hotkeys_popup.show_help(nil, awful.screen.focused())
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Manual",
|
|
||||||
function()
|
|
||||||
awful.spawn(user.terminal .. " -e man awesome")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Edit config",
|
|
||||||
function()
|
|
||||||
awful.spawn(user.editor .. " " .. awesome.conffile)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Restart",
|
|
||||||
function()
|
|
||||||
awesome.restart()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Quit",
|
|
||||||
function()
|
|
||||||
awesome.quit()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
menu.mainmenu = awful.menu({
|
|
||||||
items = {
|
|
||||||
{ " Terminal", user.terminal },
|
|
||||||
{ " Explorer", apps.file_manager },
|
|
||||||
{ " Browser", apps.browser },
|
|
||||||
{ " Editor", apps.editor },
|
|
||||||
{ " GUI Editor", apps.visual_editor },
|
|
||||||
{ " AwesomeWM", menu.awesome },
|
|
||||||
{
|
|
||||||
" Notifications",
|
|
||||||
function()
|
|
||||||
awesome.emit_signal("summon::notif_center")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Mouse bindings on desktop
|
|
||||||
-- =============================================
|
|
||||||
keys.desktopbuttons = gears.table.join(
|
|
||||||
awful.button({}, 1, function()
|
|
||||||
-- Single tap
|
|
||||||
awesome.emit_signal("summon::dismiss")
|
|
||||||
if menu.mainmenu then
|
|
||||||
menu.mainmenu:hide()
|
|
||||||
end
|
|
||||||
-- if sidebar_hide then
|
|
||||||
-- sidebar_hide()
|
|
||||||
-- end
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Right click - Show app drawer
|
|
||||||
awful.button({}, 3, function()
|
|
||||||
menu.mainmenu:toggle()
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Middle button - Toggle dashboard
|
|
||||||
-- awful.button({ }, 2, function()
|
|
||||||
-- if dashboard_show then
|
|
||||||
-- dashboard_show()
|
|
||||||
-- end
|
|
||||||
-- end),
|
|
||||||
|
|
||||||
-- Scrolling - Switch tags
|
|
||||||
-- awful.button({ }, 4, awful.tag.viewprev),
|
|
||||||
-- awful.button({ }, 5, awful.tag.viewnext),
|
|
||||||
|
|
||||||
-- Side buttons - Control volume
|
|
||||||
awful.button({}, 8, function()
|
|
||||||
helpers.volume_control(-5)
|
|
||||||
end),
|
|
||||||
awful.button({}, 9, function()
|
|
||||||
helpers.volume_control(5)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Side buttons - Minimize and restore minimized client
|
|
||||||
-- awful.button({}, 8, function()
|
|
||||||
-- if client.focus ~= nil then
|
|
||||||
-- client.focus.minimized = true
|
|
||||||
-- end
|
|
||||||
-- end),
|
|
||||||
-- awful.button({}, 9, function()
|
|
||||||
-- local c = awful.client.restore()
|
|
||||||
-- -- Focus restored client
|
|
||||||
-- if c then
|
|
||||||
-- client.focus = c
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Global bindings
|
|
||||||
-- =============================================
|
|
||||||
keys.globalkeys = gears.table.join(
|
|
||||||
awful.key({
|
|
||||||
modifiers = { mod },
|
|
||||||
keygroup = "numrow",
|
|
||||||
description = "only view tag",
|
|
||||||
group = "tag",
|
|
||||||
on_press = function(index)
|
|
||||||
local screen = awful.screen.focused()
|
|
||||||
local tag = screen.tags[index]
|
|
||||||
if tag then
|
|
||||||
tag:view_only()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
awful.key({
|
|
||||||
modifiers = { mod, ctrl },
|
|
||||||
keygroup = "numrow",
|
|
||||||
description = "toggle tag",
|
|
||||||
group = "tag",
|
|
||||||
on_press = function(index)
|
|
||||||
local screen = awful.screen.focused()
|
|
||||||
local tag = screen.tags[index]
|
|
||||||
if tag then
|
|
||||||
awful.tag.viewtoggle(tag)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
awful.key({
|
|
||||||
modifiers = { mod, shift },
|
|
||||||
keygroup = "numrow",
|
|
||||||
description = "move focused client to tag",
|
|
||||||
group = "tag",
|
|
||||||
on_press = function(index)
|
|
||||||
if client.focus then
|
|
||||||
local tag = client.focus.screen.tags[index]
|
|
||||||
if tag then
|
|
||||||
client.focus:move_to_tag(tag)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
awful.key({ mod }, "space", function()
|
|
||||||
awful.layout.inc(1)
|
|
||||||
end, { description = "next layout", group = "tag" }),
|
|
||||||
awful.key({ mod, shift }, "space", function()
|
|
||||||
awful.layout.inc(-1)
|
|
||||||
end, { description = "previous layout", group = "tag" }),
|
|
||||||
|
|
||||||
-- Tag switcher
|
|
||||||
awful.key({ mod }, "Tab", function()
|
|
||||||
awful.tag.viewnext()
|
|
||||||
end, { description = "next tag", group = "client" }),
|
|
||||||
awful.key({ mod, shift }, "Tab", function()
|
|
||||||
awful.tag.viewprev()
|
|
||||||
end, { description = "prev tag", group = "client" }),
|
|
||||||
|
|
||||||
-- Focus client by direction (hjkl keys)
|
|
||||||
awful.key({ mod }, "j", function()
|
|
||||||
awful.client.focus.bydirection("down")
|
|
||||||
end, { description = "focus down", group = "client" }),
|
|
||||||
awful.key({ mod }, "k", function()
|
|
||||||
awful.client.focus.bydirection("up")
|
|
||||||
end, { description = "focus up", group = "client" }),
|
|
||||||
awful.key({ mod }, "h", function()
|
|
||||||
awful.client.focus.bydirection("left")
|
|
||||||
end, { description = "focus left", group = "client" }),
|
|
||||||
awful.key({ mod }, "l", function()
|
|
||||||
awful.client.focus.bydirection("right")
|
|
||||||
end, { description = "focus right", group = "client" }),
|
|
||||||
|
|
||||||
-- Focus client by index (cycle through clients)
|
|
||||||
awful.key({ mod }, "z", function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end, { description = "focus next by index", group = "client" }),
|
|
||||||
awful.key({ mod, shift }, "z", function()
|
|
||||||
awful.client.focus.byidx(-1)
|
|
||||||
end, { description = "focus next by index", group = "client" }),
|
|
||||||
|
|
||||||
-- Focus client by direction (arrow keys)
|
|
||||||
awful.key({ mod }, "Down", function()
|
|
||||||
awful.client.focus.bydirection("down")
|
|
||||||
end, { description = "focus down", group = "client" }),
|
|
||||||
awful.key({ mod }, "Up", function()
|
|
||||||
awful.client.focus.bydirection("up")
|
|
||||||
end, { description = "focus up", group = "client" }),
|
|
||||||
awful.key({ mod }, "Left", function()
|
|
||||||
awful.client.focus.bydirection("left")
|
|
||||||
end, { description = "focus left", group = "client" }),
|
|
||||||
awful.key({ mod }, "Right", function()
|
|
||||||
awful.client.focus.bydirection("right")
|
|
||||||
end, { description = "focus right", group = "client" }),
|
|
||||||
|
|
||||||
-- Urgent or Undo:
|
|
||||||
-- Jump to urgent client or (if there is no such client) go back
|
|
||||||
-- to the last tag
|
|
||||||
awful.key({ mod }, "u", function()
|
|
||||||
uc = awful.client.urgent.get()
|
|
||||||
-- If there is no urgent client, go back to last tag
|
|
||||||
if uc == nil then
|
|
||||||
awful.tag.history.restore()
|
|
||||||
else
|
|
||||||
awful.client.urgent.jumpto()
|
|
||||||
end
|
|
||||||
end, { description = "jump to urgent client", group = "client" }),
|
|
||||||
|
|
||||||
awful.key({ mod }, "x", function()
|
|
||||||
awful.tag.history.restore()
|
|
||||||
end, { description = "go back", group = "tag" }),
|
|
||||||
|
|
||||||
-- Spawn terminal
|
|
||||||
awful.key({ mod }, "Return", function()
|
|
||||||
awful.spawn(user.terminal)
|
|
||||||
end, { description = "open a terminal", group = "launcher" }),
|
|
||||||
|
|
||||||
-- Spawn floating terminal
|
|
||||||
awful.key({ mod, shift }, "Return", function()
|
|
||||||
awful.spawn(user.floating_terminal, { floating = true })
|
|
||||||
end, { description = "spawn floating terminal", group = "launcher" }),
|
|
||||||
|
|
||||||
-- Reload Awesome
|
|
||||||
awful.key({ mod, shift }, "r", function()
|
|
||||||
awesome.restart()
|
|
||||||
end, { description = "reload awesome", group = "awesome" }),
|
|
||||||
|
|
||||||
-- Quit Awesome
|
|
||||||
awful.key({ mod, shift }, "q", function()
|
|
||||||
awesome.quit()
|
|
||||||
end, { description = "quit awesome", group = "awesome" }),
|
|
||||||
awful.key({ mod, shift }, "x", function()
|
|
||||||
awesome.quit()
|
|
||||||
-- exit_screen_show()
|
|
||||||
end, { description = "quit awesome", group = "awesome" }),
|
|
||||||
awful.key({}, "XF86PowerOff", function()
|
|
||||||
awesome.quit()
|
|
||||||
-- exit_screen_show()
|
|
||||||
end, { description = "quit awesome", group = "awesome" }),
|
|
||||||
|
|
||||||
-- Resize focused client or layout factor
|
|
||||||
awful.key({ mod, ctrl }, "Down", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "down")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "Up", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "up")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "Left", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "left")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "Right", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "right")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "j", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "down")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "k", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "up")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "h", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "left")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, ctrl }, "l", function(c)
|
|
||||||
helpers.resize_dwim(client.focus, "right")
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Focus restored client
|
|
||||||
awful.key({ mod, shift }, "n", function()
|
|
||||||
local c = awful.client.restore()
|
|
||||||
if c then
|
|
||||||
client.focus = c
|
|
||||||
end
|
|
||||||
end, { description = "restore minimized", group = "client" }),
|
|
||||||
|
|
||||||
-- Dismiss notifications and elements that connect to the dismiss signal
|
|
||||||
awful.key({ ctrl }, "space", function()
|
|
||||||
awesome.emit_signal("summon::dismiss")
|
|
||||||
end, { description = "dismiss notification", group = "notifications" }),
|
|
||||||
|
|
||||||
-- Scratchpad terminal
|
|
||||||
awful.key({ mod }, "s", function()
|
|
||||||
helpers.scratchpad({ instance = "scratchpad" }, user.scratchpad_terminal, nil)
|
|
||||||
end, { description = "scratchpad", group = "launcher" }),
|
|
||||||
|
|
||||||
-- Screen Shots/Vids
|
|
||||||
awful.key({}, "Print", apps.screenshot_full, { description = "screenshot gui", group = "awesome" }),
|
|
||||||
awful.key(
|
|
||||||
{ shift },
|
|
||||||
"Print",
|
|
||||||
apps.screenshot_clipboard,
|
|
||||||
{ description = "screenshot to clipboard", group = "awesome" }
|
|
||||||
),
|
|
||||||
|
|
||||||
-- Prompt
|
|
||||||
awful.key({ mod }, "d", function()
|
|
||||||
awful.screen.focused().mypromptbox:run()
|
|
||||||
end, { description = "run prompt", group = "launcher" }),
|
|
||||||
--- App launcher
|
|
||||||
awful.key({ mod }, "a", function()
|
|
||||||
awful.spawn(user.app_launcher)
|
|
||||||
end, { description = "app launcher", group = "app" }),
|
|
||||||
--- Emoji picker
|
|
||||||
awful.key({ mod }, "e", apps.emoji_picker, { description = "emoji picker", group = "app" }),
|
|
||||||
--- Clipboard
|
|
||||||
awful.key({ mod }, "v", apps.clipboard, { description = "clipboard", group = "app" }),
|
|
||||||
|
|
||||||
-- Hotkeys list
|
|
||||||
awful.key({ mod }, "F1", function()
|
|
||||||
hotkeys_popup.show_help()
|
|
||||||
end, { description = "show help", group = "awesome" }),
|
|
||||||
|
|
||||||
-- Volume control with volume keys
|
|
||||||
awful.key({}, "XF86AudioMute", function()
|
|
||||||
helpers.volume_control(0)
|
|
||||||
end, { description = "(un)mute volume", group = "volume" }),
|
|
||||||
awful.key({}, "XF86AudioLowerVolume", function()
|
|
||||||
helpers.volume_control(-5)
|
|
||||||
awesome.emit_signal("summon::osd")
|
|
||||||
end, { description = "lower volume", group = "volume" }),
|
|
||||||
awful.key({}, "XF86AudioRaiseVolume", function()
|
|
||||||
helpers.volume_control(5)
|
|
||||||
awesome.emit_signal("summon::osd")
|
|
||||||
end, { description = "raise volume", group = "volume" }),
|
|
||||||
|
|
||||||
-- Brightness control with brightness keys
|
|
||||||
awful.key({}, "XF86MonBrightnessUp", function()
|
|
||||||
awful.spawn("light -A 10")
|
|
||||||
awesome.emit_signal("summon::osd")
|
|
||||||
end, { description = "increase brightness", group = "brightness" }),
|
|
||||||
awful.key({}, "XF86MonBrightnessDown", function()
|
|
||||||
awful.spawn("light -U 10")
|
|
||||||
awesome.emit_signal("summon::osd")
|
|
||||||
end, { description = "decrease brightness", group = "brightness" }),
|
|
||||||
|
|
||||||
-- Music
|
|
||||||
awful.key({}, "XF86AudioPlay", function()
|
|
||||||
awful.spawn.with_shell("playerctl play-pause")
|
|
||||||
end, { description = "play pause music", group = "volume" }),
|
|
||||||
awful.key({}, "XF86AudioPrev", function()
|
|
||||||
awful.spawn.with_shell("playerctl previous")
|
|
||||||
end, { description = "previous music", group = "volume" }),
|
|
||||||
awful.key({}, "XF86AudioNext", function()
|
|
||||||
awful.spawn.with_shell("playerctl next")
|
|
||||||
end, { description = "next music", group = "volume" }),
|
|
||||||
|
|
||||||
-- Lockscreen
|
|
||||||
awful.key({ mod, alt }, "l", function()
|
|
||||||
awesome.emit_signal("summon::lock_screen")
|
|
||||||
end, { description = "lock screen", group = "hotkeys" }),
|
|
||||||
|
|
||||||
-- Apps
|
|
||||||
-- Spawn browser
|
|
||||||
awful.key({ mod }, "F2", apps.browser, { description = "web browser", group = "launcher" }),
|
|
||||||
-- Spawn gui file manager
|
|
||||||
awful.key({ mod }, "F3", apps.file_manager, { description = "file manager", group = "launcher" }),
|
|
||||||
-- Terminal file manager
|
|
||||||
awful.key({ mod }, "F4", apps.term_filemanager, { description = "term filemanager", group = "launcher" }),
|
|
||||||
-- Primary editor
|
|
||||||
awful.key({ mod }, "F5", apps.editor, { description = "editor", group = "launcher" }),
|
|
||||||
-- Gui editor
|
|
||||||
awful.key({ mod }, "F6", apps.visual_editor, { description = "visual editor", group = "launcher" }),
|
|
||||||
-- Add more
|
|
||||||
awful.key({ mod }, "F7", apps.file_manager, { description = "file manager", group = "launcher" }),
|
|
||||||
awful.key({ mod }, "F8", apps.file_manager, { description = "file manager", group = "launcher" }),
|
|
||||||
awful.key({ mod }, "F9", apps.file_manager, { description = "file manager", group = "launcher" }),
|
|
||||||
awful.key({ mod }, "F10", apps.file_manager, { description = "file manager", group = "launcher" }),
|
|
||||||
-- Volume control
|
|
||||||
awful.key({ mod }, "F11", apps.volume, { description = "volume control", group = "launcher" }),
|
|
||||||
-- Process monitor
|
|
||||||
awful.key({ mod }, "F12", apps.process_monitor, { description = "process monitor", group = "launcher" })
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Client related bindings
|
|
||||||
-- =============================================
|
|
||||||
keys.clientkeys = gears.table.join(
|
|
||||||
-- Swap by direction
|
|
||||||
awful.key({ mod, shift }, "j", function()
|
|
||||||
awful.client.swap.bydirection("down")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, shift }, "k", function()
|
|
||||||
awful.client.swap.bydirection("up")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, shift }, "h", function()
|
|
||||||
awful.client.swap.bydirection("left")
|
|
||||||
end),
|
|
||||||
awful.key({ mod, shift }, "l", function()
|
|
||||||
awful.client.swap.bydirection("right")
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Toggle fullscreen
|
|
||||||
awful.key({ mod }, "f", function(c)
|
|
||||||
c.fullscreen = not c.fullscreen
|
|
||||||
c:raise()
|
|
||||||
end, { description = "toggle fullscreen", group = "client" }),
|
|
||||||
|
|
||||||
-- Close client
|
|
||||||
awful.key({ mod }, "q", function(c)
|
|
||||||
c:kill()
|
|
||||||
end, { description = "close", group = "client" }),
|
|
||||||
awful.key({ alt }, "F4", function(c)
|
|
||||||
c:kill()
|
|
||||||
end, { description = "close", group = "client" }),
|
|
||||||
|
|
||||||
--- Center client
|
|
||||||
awful.key({ mod }, "c", function()
|
|
||||||
awful.placement.centered(c, { honor_workarea = true, honor_padding = true })
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Switch clients
|
|
||||||
awful.key({ alt }, "Tab", function()
|
|
||||||
awesome.emit_signal("window_switcher::turn_on")
|
|
||||||
-- awful.client.focus.byidx(1)
|
|
||||||
end, { description = "focus next by index", group = "client" }),
|
|
||||||
|
|
||||||
-- Toggle floating
|
|
||||||
awful.key({ mod, ctrl }, "space", function(c)
|
|
||||||
local layout_is_floating = (awful.layout.get(mouse.screen) == awful.layout.suit.floating)
|
|
||||||
if not layout_is_floating then
|
|
||||||
awful.client.floating.toggle()
|
|
||||||
end
|
|
||||||
end, { description = "toggle floating", group = "client" }),
|
|
||||||
|
|
||||||
-- Set master
|
|
||||||
awful.key({ mod, ctrl }, "Return", function(c)
|
|
||||||
c:swap(awful.client.getmaster())
|
|
||||||
end, { description = "move to master", group = "client" }),
|
|
||||||
|
|
||||||
-- P for pin: keep on top OR sticky
|
|
||||||
-- On top
|
|
||||||
awful.key({ mod, shift }, "p", function(c)
|
|
||||||
c.ontop = not c.ontop
|
|
||||||
end, { description = "toggle keep on top", group = "client" }),
|
|
||||||
-- Sticky
|
|
||||||
awful.key({ mod, ctrl }, "p", function(c)
|
|
||||||
c.sticky = not c.sticky
|
|
||||||
end, { description = "toggle sticky", group = "client" }),
|
|
||||||
|
|
||||||
-- Minimize
|
|
||||||
awful.key({ mod }, "n", function(c)
|
|
||||||
c.minimized = true
|
|
||||||
end, { description = "minimize", group = "client" }),
|
|
||||||
|
|
||||||
-- Maximize
|
|
||||||
awful.key({ mod }, "m", function(c)
|
|
||||||
c.maximized = not c.maximized
|
|
||||||
end, { description = "(un)maximize", group = "client" }),
|
|
||||||
awful.key({ mod, ctrl }, "m", function(c)
|
|
||||||
c.maximized_vertical = not c.maximized_vertical
|
|
||||||
c:raise()
|
|
||||||
end, { description = "(un)maximize vertically", group = "client" }),
|
|
||||||
awful.key({ mod, shift }, "m", function(c)
|
|
||||||
c.maximized_horizontal = not c.maximized_horizontal
|
|
||||||
c:raise()
|
|
||||||
end, { description = "(un)maximize horizontally", group = "client" })
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Mouse buttons on the client (whole window, not just titlebar)
|
|
||||||
-- =============================================
|
|
||||||
keys.clientbuttons = gears.table.join(
|
|
||||||
awful.button({}, 1, function(c)
|
|
||||||
client.focus = c
|
|
||||||
end),
|
|
||||||
awful.button({ mod }, 1, awful.mouse.client.move),
|
|
||||||
-- awful.button({ mod }, 2, function(c) c:kill() end),
|
|
||||||
awful.button({ mod }, 3, function(c)
|
|
||||||
client.focus = c
|
|
||||||
awful.mouse.client.resize(c)
|
|
||||||
-- awful.mouse.resize(c, nil, {jump_to_corner=true})
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Super + scroll = Change client opacity
|
|
||||||
-- awful.button({ mod }, 4, function(c)
|
|
||||||
-- c.opacity = c.opacity + 0.1
|
|
||||||
-- end),
|
|
||||||
-- awful.button({ mod }, 5, function(c)
|
|
||||||
-- c.opacity = c.opacity - 0.1
|
|
||||||
-- end)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Mouse buttons on the tasklist
|
|
||||||
-- Use 'Any' modifier so that the same buttons can be used in the floating
|
|
||||||
-- tasklist displayed by the window switcher while the mod is pressed
|
|
||||||
-- =============================================
|
|
||||||
keys.tasklist_buttons = gears.table.join(
|
|
||||||
awful.button({ "Any" }, 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
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
-- Middle mouse button closes the window (on release)
|
|
||||||
awful.button({ "Any" }, 2, nil, function(c)
|
|
||||||
c:kill()
|
|
||||||
end),
|
|
||||||
awful.button({ "Any" }, 3, function(c)
|
|
||||||
c.minimized = true
|
|
||||||
end),
|
|
||||||
awful.button({ "Any" }, 4, function()
|
|
||||||
awful.client.focus.byidx(-1)
|
|
||||||
end),
|
|
||||||
awful.button({ "Any" }, 5, function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end),
|
|
||||||
|
|
||||||
-- Side button up - toggle floating
|
|
||||||
awful.button({ "Any" }, 9, function(c)
|
|
||||||
c.floating = not c.floating
|
|
||||||
end),
|
|
||||||
-- Side button down - toggle ontop
|
|
||||||
awful.button({ "Any" }, 8, function(c)
|
|
||||||
c.ontop = not c.ontop
|
|
||||||
end)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Mouse buttons on a tag of the taglist widget
|
|
||||||
-- =============================================
|
|
||||||
keys.taglist_buttons = gears.table.join(
|
|
||||||
awful.button({}, 1, function(t)
|
|
||||||
t:view_only()
|
|
||||||
end),
|
|
||||||
awful.button({ mod }, 1, function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:move_to_tag(t)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
-- awful.button({ }, 3, awful.tag.viewtoggle),
|
|
||||||
awful.button({}, 3, function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:move_to_tag(t)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ mod }, 3, function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:toggle_tag(t)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({}, 4, function(t)
|
|
||||||
awful.tag.viewprev(t.screen)
|
|
||||||
end),
|
|
||||||
awful.button({}, 5, function(t)
|
|
||||||
awful.tag.viewnext(t.screen)
|
|
||||||
end)
|
|
||||||
)
|
|
||||||
|
|
||||||
root.keys(keys.globalkeys)
|
|
||||||
root.buttons(keys.desktopbuttons)
|
|
||||||
|
|
||||||
return keys
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,373 +0,0 @@
|
|||||||
--
|
|
||||||
-- json.lua
|
|
||||||
--
|
|
||||||
-- Copyright (c) 2020 rxi
|
|
||||||
--
|
|
||||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
-- this software and associated documentation files (the "Software"), to deal in
|
|
||||||
-- the Software without restriction, including without limitation the rights to
|
|
||||||
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
-- of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
-- so, subject to the following conditions:
|
|
||||||
--
|
|
||||||
-- The above copyright notice and this permission notice shall be included in all
|
|
||||||
-- copies or substantial portions of the Software.
|
|
||||||
--
|
|
||||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
-- SOFTWARE.
|
|
||||||
--
|
|
||||||
|
|
||||||
local json = { _version = "0.1.2" }
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- Encode
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local encode
|
|
||||||
|
|
||||||
local escape_char_map = {
|
|
||||||
["\\"] = "\\",
|
|
||||||
['"'] = '"',
|
|
||||||
["\b"] = "b",
|
|
||||||
["\f"] = "f",
|
|
||||||
["\n"] = "n",
|
|
||||||
["\r"] = "r",
|
|
||||||
["\t"] = "t",
|
|
||||||
}
|
|
||||||
|
|
||||||
local escape_char_map_inv = { ["/"] = "/" }
|
|
||||||
for k, v in pairs(escape_char_map) do
|
|
||||||
escape_char_map_inv[v] = k
|
|
||||||
end
|
|
||||||
|
|
||||||
local function escape_char(c)
|
|
||||||
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
|
|
||||||
end
|
|
||||||
|
|
||||||
local function encode_nil(val)
|
|
||||||
return "null"
|
|
||||||
end
|
|
||||||
|
|
||||||
local function encode_table(val, stack)
|
|
||||||
local res = {}
|
|
||||||
stack = stack or {}
|
|
||||||
|
|
||||||
-- Circular reference?
|
|
||||||
if stack[val] then
|
|
||||||
error("circular reference")
|
|
||||||
end
|
|
||||||
|
|
||||||
stack[val] = true
|
|
||||||
|
|
||||||
if rawget(val, 1) ~= nil or next(val) == nil then
|
|
||||||
-- Treat as array -- check keys are valid and it is not sparse
|
|
||||||
local n = 0
|
|
||||||
for k in pairs(val) do
|
|
||||||
if type(k) ~= "number" then
|
|
||||||
error("invalid table: mixed or invalid key types")
|
|
||||||
end
|
|
||||||
n = n + 1
|
|
||||||
end
|
|
||||||
if n ~= #val then
|
|
||||||
error("invalid table: sparse array")
|
|
||||||
end
|
|
||||||
-- Encode
|
|
||||||
for i, v in ipairs(val) do
|
|
||||||
table.insert(res, encode(v, stack))
|
|
||||||
end
|
|
||||||
stack[val] = nil
|
|
||||||
return "[" .. table.concat(res, ",") .. "]"
|
|
||||||
else
|
|
||||||
-- Treat as an object
|
|
||||||
for k, v in pairs(val) do
|
|
||||||
if type(k) ~= "string" then
|
|
||||||
error("invalid table: mixed or invalid key types")
|
|
||||||
end
|
|
||||||
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
|
|
||||||
end
|
|
||||||
stack[val] = nil
|
|
||||||
return "{" .. table.concat(res, ",") .. "}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function encode_string(val)
|
|
||||||
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
|
|
||||||
end
|
|
||||||
|
|
||||||
local function encode_number(val)
|
|
||||||
-- Check for NaN, -inf and inf
|
|
||||||
if val ~= val or val <= -math.huge or val >= math.huge then
|
|
||||||
error("unexpected number value '" .. tostring(val) .. "'")
|
|
||||||
end
|
|
||||||
return string.format("%.14g", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
local type_func_map = {
|
|
||||||
["nil"] = encode_nil,
|
|
||||||
["table"] = encode_table,
|
|
||||||
["string"] = encode_string,
|
|
||||||
["number"] = encode_number,
|
|
||||||
["boolean"] = tostring,
|
|
||||||
}
|
|
||||||
|
|
||||||
encode = function(val, stack)
|
|
||||||
local t = type(val)
|
|
||||||
local f = type_func_map[t]
|
|
||||||
if f then
|
|
||||||
return f(val, stack)
|
|
||||||
end
|
|
||||||
error("unexpected type '" .. t .. "'")
|
|
||||||
end
|
|
||||||
|
|
||||||
function json.encode(val)
|
|
||||||
return (encode(val))
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- Decode
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local parse
|
|
||||||
|
|
||||||
local function create_set(...)
|
|
||||||
local res = {}
|
|
||||||
for i = 1, select("#", ...) do
|
|
||||||
res[select(i, ...)] = true
|
|
||||||
end
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
local space_chars = create_set(" ", "\t", "\r", "\n")
|
|
||||||
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
|
|
||||||
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
|
|
||||||
local literals = create_set("true", "false", "null")
|
|
||||||
|
|
||||||
local literal_map = {
|
|
||||||
["true"] = true,
|
|
||||||
["false"] = false,
|
|
||||||
["null"] = nil,
|
|
||||||
}
|
|
||||||
|
|
||||||
local function next_char(str, idx, set, negate)
|
|
||||||
for i = idx, #str do
|
|
||||||
if set[str:sub(i, i)] ~= negate then
|
|
||||||
return i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return #str + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local function decode_error(str, idx, msg)
|
|
||||||
local line_count = 1
|
|
||||||
local col_count = 1
|
|
||||||
for i = 1, idx - 1 do
|
|
||||||
col_count = col_count + 1
|
|
||||||
if str:sub(i, i) == "\n" then
|
|
||||||
line_count = line_count + 1
|
|
||||||
col_count = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
error(string.format("%s at line %d col %d", msg, line_count, col_count))
|
|
||||||
end
|
|
||||||
|
|
||||||
local function codepoint_to_utf8(n)
|
|
||||||
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
|
|
||||||
local f = math.floor
|
|
||||||
if n <= 0x7f then
|
|
||||||
return string.char(n)
|
|
||||||
elseif n <= 0x7ff then
|
|
||||||
return string.char(f(n / 64) + 192, n % 64 + 128)
|
|
||||||
elseif n <= 0xffff then
|
|
||||||
return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128)
|
|
||||||
elseif n <= 0x10ffff then
|
|
||||||
return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, f(n % 4096 / 64) + 128, n % 64 + 128)
|
|
||||||
end
|
|
||||||
error(string.format("invalid unicode codepoint '%x'", n))
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_unicode_escape(s)
|
|
||||||
local n1 = tonumber(s:sub(1, 4), 16)
|
|
||||||
local n2 = tonumber(s:sub(7, 10), 16)
|
|
||||||
-- Surrogate pair?
|
|
||||||
if n2 then
|
|
||||||
return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
|
|
||||||
else
|
|
||||||
return codepoint_to_utf8(n1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_string(str, i)
|
|
||||||
local res = ""
|
|
||||||
local j = i + 1
|
|
||||||
local k = j
|
|
||||||
|
|
||||||
while j <= #str do
|
|
||||||
local x = str:byte(j)
|
|
||||||
|
|
||||||
if x < 32 then
|
|
||||||
decode_error(str, j, "control character in string")
|
|
||||||
elseif x == 92 then -- `\`: Escape
|
|
||||||
res = res .. str:sub(k, j - 1)
|
|
||||||
j = j + 1
|
|
||||||
local c = str:sub(j, j)
|
|
||||||
if c == "u" then
|
|
||||||
local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1)
|
|
||||||
or str:match("^%x%x%x%x", j + 1)
|
|
||||||
or decode_error(str, j - 1, "invalid unicode escape in string")
|
|
||||||
res = res .. parse_unicode_escape(hex)
|
|
||||||
j = j + #hex
|
|
||||||
else
|
|
||||||
if not escape_chars[c] then
|
|
||||||
decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string")
|
|
||||||
end
|
|
||||||
res = res .. escape_char_map_inv[c]
|
|
||||||
end
|
|
||||||
k = j + 1
|
|
||||||
elseif x == 34 then -- `"`: End of string
|
|
||||||
res = res .. str:sub(k, j - 1)
|
|
||||||
return res, j + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
j = j + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
decode_error(str, i, "expected closing quote for string")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_number(str, i)
|
|
||||||
local x = next_char(str, i, delim_chars)
|
|
||||||
local s = str:sub(i, x - 1)
|
|
||||||
local n = tonumber(s)
|
|
||||||
if not n then
|
|
||||||
decode_error(str, i, "invalid number '" .. s .. "'")
|
|
||||||
end
|
|
||||||
return n, x
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_literal(str, i)
|
|
||||||
local x = next_char(str, i, delim_chars)
|
|
||||||
local word = str:sub(i, x - 1)
|
|
||||||
if not literals[word] then
|
|
||||||
decode_error(str, i, "invalid literal '" .. word .. "'")
|
|
||||||
end
|
|
||||||
return literal_map[word], x
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_array(str, i)
|
|
||||||
local res = {}
|
|
||||||
local n = 1
|
|
||||||
i = i + 1
|
|
||||||
while 1 do
|
|
||||||
local x
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
-- Empty / end of array?
|
|
||||||
if str:sub(i, i) == "]" then
|
|
||||||
i = i + 1
|
|
||||||
break
|
|
||||||
end
|
|
||||||
-- Read token
|
|
||||||
x, i = parse(str, i)
|
|
||||||
res[n] = x
|
|
||||||
n = n + 1
|
|
||||||
-- Next token
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
local chr = str:sub(i, i)
|
|
||||||
i = i + 1
|
|
||||||
if chr == "]" then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
if chr ~= "," then
|
|
||||||
decode_error(str, i, "expected ']' or ','")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return res, i
|
|
||||||
end
|
|
||||||
|
|
||||||
local function parse_object(str, i)
|
|
||||||
local res = {}
|
|
||||||
i = i + 1
|
|
||||||
while 1 do
|
|
||||||
local key, val
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
-- Empty / end of object?
|
|
||||||
if str:sub(i, i) == "}" then
|
|
||||||
i = i + 1
|
|
||||||
break
|
|
||||||
end
|
|
||||||
-- Read key
|
|
||||||
if str:sub(i, i) ~= '"' then
|
|
||||||
decode_error(str, i, "expected string for key")
|
|
||||||
end
|
|
||||||
key, i = parse(str, i)
|
|
||||||
-- Read ':' delimiter
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
if str:sub(i, i) ~= ":" then
|
|
||||||
decode_error(str, i, "expected ':' after key")
|
|
||||||
end
|
|
||||||
i = next_char(str, i + 1, space_chars, true)
|
|
||||||
-- Read value
|
|
||||||
val, i = parse(str, i)
|
|
||||||
-- Set
|
|
||||||
res[key] = val
|
|
||||||
-- Next token
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
local chr = str:sub(i, i)
|
|
||||||
i = i + 1
|
|
||||||
if chr == "}" then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
if chr ~= "," then
|
|
||||||
decode_error(str, i, "expected '}' or ','")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return res, i
|
|
||||||
end
|
|
||||||
|
|
||||||
local char_func_map = {
|
|
||||||
['"'] = parse_string,
|
|
||||||
["0"] = parse_number,
|
|
||||||
["1"] = parse_number,
|
|
||||||
["2"] = parse_number,
|
|
||||||
["3"] = parse_number,
|
|
||||||
["4"] = parse_number,
|
|
||||||
["5"] = parse_number,
|
|
||||||
["6"] = parse_number,
|
|
||||||
["7"] = parse_number,
|
|
||||||
["8"] = parse_number,
|
|
||||||
["9"] = parse_number,
|
|
||||||
["-"] = parse_number,
|
|
||||||
["t"] = parse_literal,
|
|
||||||
["f"] = parse_literal,
|
|
||||||
["n"] = parse_literal,
|
|
||||||
["["] = parse_array,
|
|
||||||
["{"] = parse_object,
|
|
||||||
}
|
|
||||||
|
|
||||||
parse = function(str, idx)
|
|
||||||
local chr = str:sub(idx, idx)
|
|
||||||
local f = char_func_map[chr]
|
|
||||||
if f then
|
|
||||||
return f(str, idx)
|
|
||||||
end
|
|
||||||
decode_error(str, idx, "unexpected character '" .. chr .. "'")
|
|
||||||
end
|
|
||||||
|
|
||||||
function json.decode(str)
|
|
||||||
if type(str) ~= "string" then
|
|
||||||
error("expected argument of type string, got " .. type(str))
|
|
||||||
end
|
|
||||||
local res, idx = parse(str, next_char(str, 1, space_chars, true))
|
|
||||||
idx = next_char(str, idx, space_chars, true)
|
|
||||||
if idx <= #str then
|
|
||||||
decode_error(str, idx, "trailing garbage")
|
|
||||||
end
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
return json
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
local awful = require("awful")
|
|
||||||
local gfs = require("gears.filesystem")
|
|
||||||
|
|
||||||
local lock_screen = {}
|
|
||||||
|
|
||||||
local lua_pam_path = gfs.get_configuration_dir() .. "modules/lockscren/lib/liblua_pam.so"
|
|
||||||
|
|
||||||
-- Initialize authentication method based on whether lua-pam has been
|
|
||||||
-- installed or not
|
|
||||||
awful.spawn.easy_async_with_shell("stat " .. lua_pam_path .. " >/dev/null 2>&1", function(_, __, ___, exitcode)
|
|
||||||
if exitcode == 0 then
|
|
||||||
local pam = require("liblua_pam")
|
|
||||||
-- lua-pam was installed.
|
|
||||||
-- Authenticate with PAM
|
|
||||||
-- TODO: setup lib-pam
|
|
||||||
lock_screen.authenticate = function(password)
|
|
||||||
return pam.auth_current_user(password)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- lua-pam was NOT installed.
|
|
||||||
-- Authenticate with user.lock_screen_custom_password
|
|
||||||
lock_screen.authenticate = function(password)
|
|
||||||
return password == user.lock_screen_custom_password
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Load the lock_screen element
|
|
||||||
require("modules.lockscreen.lockscreen")
|
|
||||||
end)
|
|
||||||
|
|
||||||
return lock_screen
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,404 +0,0 @@
|
|||||||
local gears = require("gears")
|
|
||||||
local awful = require("awful")
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
local xresources = require("beautiful.xresources")
|
|
||||||
local dpi = xresources.apply_dpi
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local lock_screen = require("modules.lockscreen")
|
|
||||||
|
|
||||||
--- Word Clock Lock Screen
|
|
||||||
--- ~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
local lock_screen_symbol = ""
|
|
||||||
local lock_screen_fail_symbol = ""
|
|
||||||
local lock_animation_icon = wibox.widget({
|
|
||||||
--- Set forced size to prevent flickering when the icon rotates
|
|
||||||
forced_height = dpi(80),
|
|
||||||
forced_width = dpi(80),
|
|
||||||
font = beautiful.icon_font_name .. "40",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox(lock_screen_symbol),
|
|
||||||
})
|
|
||||||
|
|
||||||
local some_textbox = wibox.widget.textbox()
|
|
||||||
|
|
||||||
-- Create the lock screen wibox
|
|
||||||
-- Use widgets::splash::visibility or
|
|
||||||
-- Set the type to "splash" and set all "splash" windows to be blurred in your
|
|
||||||
-- compositor configuration file
|
|
||||||
lock_screen_box = wibox({ visible = false, ontop = true, type = "splash", screen = screen.primary })
|
|
||||||
awful.placement.maximize(lock_screen_box)
|
|
||||||
|
|
||||||
lock_screen_box.bg = beautiful.transparent
|
|
||||||
lock_screen_box.fg = beautiful.fg_normal
|
|
||||||
|
|
||||||
--- Add lockscreen to each screen
|
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
|
||||||
if s == screen.primary then
|
|
||||||
s.mylockscreen = lock_screen_box
|
|
||||||
else
|
|
||||||
s.mylockscreen = wibox({
|
|
||||||
visible = false,
|
|
||||||
ontop = true,
|
|
||||||
type = "splash",
|
|
||||||
screen = s,
|
|
||||||
})
|
|
||||||
awful.placement.maximize(s.mylockscreen)
|
|
||||||
s.mylockscreen.bg = beautiful.bg_normal
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
local function set_visibility(v)
|
|
||||||
for s in screen do
|
|
||||||
s.mylockscreen.visible = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Word Clock
|
|
||||||
--- ~~~~~~~~~
|
|
||||||
local char =
|
|
||||||
"I T L I S A S A M P M A C Q U A R T E R D C T W E N T Y F I V E X H A L F S T E N F T O P A S T E R U N I N E O N E S I X T H R E E F O U R F I V E T W O E I G H T E L E V E N S E V E N T W E L V E T E N S E O C L O C K"
|
|
||||||
|
|
||||||
local pos_map = {
|
|
||||||
["it"] = { 1, 2 },
|
|
||||||
["is"] = { 4, 5 },
|
|
||||||
["a"] = { 12, 12 },
|
|
||||||
["quarter"] = { 14, 20 },
|
|
||||||
["twenty"] = { 23, 28 },
|
|
||||||
["five"] = { 29, 32 },
|
|
||||||
["half"] = { 34, 37 },
|
|
||||||
["ten"] = { 39, 41 },
|
|
||||||
["past"] = { 45, 48 },
|
|
||||||
["to"] = { 43, 44 },
|
|
||||||
["1"] = { 56, 58 },
|
|
||||||
["2"] = { 75, 77 },
|
|
||||||
["3"] = { 62, 66 },
|
|
||||||
["4"] = { 67, 70 },
|
|
||||||
["5"] = { 71, 74 },
|
|
||||||
["6"] = { 59, 61 },
|
|
||||||
["7"] = { 89, 93 },
|
|
||||||
["8"] = { 78, 82 },
|
|
||||||
["9"] = { 52, 55 },
|
|
||||||
["10"] = { 100, 102 },
|
|
||||||
["11"] = { 83, 88 },
|
|
||||||
["12"] = { 94, 99 },
|
|
||||||
["oclock"] = { 105, 110 },
|
|
||||||
}
|
|
||||||
|
|
||||||
local char_map = {
|
|
||||||
["it"] = {},
|
|
||||||
["is"] = {},
|
|
||||||
["a"] = {},
|
|
||||||
["quarter"] = {},
|
|
||||||
["twenty"] = {},
|
|
||||||
["five"] = {},
|
|
||||||
["half"] = {},
|
|
||||||
["ten"] = {},
|
|
||||||
["past"] = {},
|
|
||||||
["to"] = {},
|
|
||||||
["1"] = {},
|
|
||||||
["2"] = {},
|
|
||||||
["3"] = {},
|
|
||||||
["4"] = {},
|
|
||||||
["5"] = {},
|
|
||||||
["6"] = {},
|
|
||||||
["7"] = {},
|
|
||||||
["8"] = {},
|
|
||||||
["9"] = {},
|
|
||||||
["10"] = {},
|
|
||||||
["11"] = {},
|
|
||||||
["12"] = {},
|
|
||||||
["oclock"] = {},
|
|
||||||
}
|
|
||||||
|
|
||||||
local reset_map = { 4, 12, 14, 23, 29, 34, 39, 43, 45, 52, 56, 59, 62, 67, 71, 75, 78, 83, 89, 94, 100, 105 }
|
|
||||||
|
|
||||||
function split_str(s, delimiter)
|
|
||||||
result = {}
|
|
||||||
for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do
|
|
||||||
table.insert(result, match)
|
|
||||||
end
|
|
||||||
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
local time_char = split_str(char, " ")
|
|
||||||
|
|
||||||
local time = wibox.widget({
|
|
||||||
forced_num_cols = 11,
|
|
||||||
spacing = dpi(6),
|
|
||||||
layout = wibox.layout.grid,
|
|
||||||
})
|
|
||||||
|
|
||||||
local function create_text_widget(index, w)
|
|
||||||
local text_widget = wibox.widget({
|
|
||||||
id = "t" .. index,
|
|
||||||
markup = w,
|
|
||||||
font = beautiful.font_name .. "Bold 24",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
forced_width = dpi(36),
|
|
||||||
forced_height = dpi(36),
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
})
|
|
||||||
|
|
||||||
time:add(text_widget)
|
|
||||||
|
|
||||||
return text_widget
|
|
||||||
end
|
|
||||||
|
|
||||||
local var_count = 0
|
|
||||||
for i, m in pairs(time_char) do
|
|
||||||
local text = "<span foreground='" .. "#ffffff" .. "10" .. "'>" .. m .. "</span>"
|
|
||||||
|
|
||||||
var_count = var_count + 1
|
|
||||||
local create_dummy_text = true
|
|
||||||
|
|
||||||
for j, k in pairs(pos_map) do
|
|
||||||
if i >= pos_map[j][1] and i <= pos_map[j][2] then
|
|
||||||
char_map[j][var_count] = create_text_widget(i, text)
|
|
||||||
create_dummy_text = false
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, n in pairs(reset_map) do
|
|
||||||
if i == n then
|
|
||||||
var_count = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if create_dummy_text then
|
|
||||||
create_text_widget(i, text)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function activate_word(w)
|
|
||||||
for i, m in pairs(char_map[w]) do
|
|
||||||
local text = m.text
|
|
||||||
m.markup = "<span foreground='" .. beautiful.fg_normal .. "'>" .. text .. "</span>"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function deactivate_word(w)
|
|
||||||
for i, m in pairs(char_map[w]) do
|
|
||||||
local text = m.text
|
|
||||||
m.markup = "<span foreground='" .. "#ffffff" .. "10" .. "'>" .. text .. "</span>"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function reset_time()
|
|
||||||
for j, k in pairs(char_map) do
|
|
||||||
deactivate_word(j)
|
|
||||||
end
|
|
||||||
|
|
||||||
activate_word("it")
|
|
||||||
activate_word("is")
|
|
||||||
end
|
|
||||||
|
|
||||||
gears.timer({
|
|
||||||
timeout = 1,
|
|
||||||
call_now = true,
|
|
||||||
autostart = true,
|
|
||||||
callback = function()
|
|
||||||
local time = os.date("%I" .. ":%M")
|
|
||||||
local h, m = time:match("(%d+):(%d+)")
|
|
||||||
local min = tonumber(m)
|
|
||||||
local hour = tonumber(h)
|
|
||||||
|
|
||||||
reset_time()
|
|
||||||
|
|
||||||
if min >= 0 and min <= 2 or min >= 58 and min <= 59 then
|
|
||||||
activate_word("oclock")
|
|
||||||
elseif min >= 3 and min <= 7 or min >= 53 and min <= 57 then
|
|
||||||
activate_word("five")
|
|
||||||
elseif min >= 8 and min <= 12 or min >= 48 and min <= 52 then
|
|
||||||
activate_word("ten")
|
|
||||||
elseif min >= 13 and min <= 17 or min >= 43 and min <= 47 then
|
|
||||||
activate_word("a")
|
|
||||||
activate_word("quarter")
|
|
||||||
elseif min >= 18 and min <= 22 or min >= 38 and min <= 42 then
|
|
||||||
activate_word("twenty")
|
|
||||||
elseif min >= 23 and min <= 27 or min >= 33 and min <= 37 then
|
|
||||||
activate_word("twenty")
|
|
||||||
activate_word("five")
|
|
||||||
elseif min >= 28 and min <= 32 then
|
|
||||||
activate_word("half")
|
|
||||||
end
|
|
||||||
|
|
||||||
if min >= 3 and min <= 32 then
|
|
||||||
activate_word("past")
|
|
||||||
elseif min >= 33 and min <= 57 then
|
|
||||||
activate_word("to")
|
|
||||||
end
|
|
||||||
|
|
||||||
local hh
|
|
||||||
|
|
||||||
if min >= 0 and min <= 30 then
|
|
||||||
hh = hour
|
|
||||||
else
|
|
||||||
hh = hour + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
if hh > 12 then
|
|
||||||
hh = hh - 12
|
|
||||||
end
|
|
||||||
|
|
||||||
activate_word(tostring(hh))
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
--- Lock animation
|
|
||||||
local lock_animation_widget_rotate = wibox.container.rotate()
|
|
||||||
|
|
||||||
local arc = function()
|
|
||||||
return function(cr, width, height)
|
|
||||||
gears.shape.arc(cr, width, height, 5, 0, math.pi / 2, true, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local lock_animation_arc = wibox.widget({
|
|
||||||
shape = arc(),
|
|
||||||
bg = beautiful.transparent,
|
|
||||||
forced_width = dpi(100),
|
|
||||||
forced_height = dpi(100),
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
local lock_animation = {
|
|
||||||
{
|
|
||||||
lock_animation_arc,
|
|
||||||
widget = lock_animation_widget_rotate,
|
|
||||||
},
|
|
||||||
lock_animation_icon,
|
|
||||||
layout = wibox.layout.stack,
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Lock helper functions
|
|
||||||
local characters_entered = 0
|
|
||||||
local function reset()
|
|
||||||
characters_entered = 0
|
|
||||||
lock_animation_icon.markup = lock_screen_symbol
|
|
||||||
lock_animation_widget_rotate.direction = "north"
|
|
||||||
lock_animation_arc.bg = beautiful.transparent
|
|
||||||
end
|
|
||||||
|
|
||||||
local function fail()
|
|
||||||
characters_entered = 0
|
|
||||||
lock_animation_icon.markup = lock_screen_fail_symbol
|
|
||||||
lock_animation_widget_rotate.direction = "north"
|
|
||||||
lock_animation_arc.bg = beautiful.transparent
|
|
||||||
end
|
|
||||||
|
|
||||||
local animation_colors = {
|
|
||||||
--- Rainbow sequence
|
|
||||||
beautiful.red,
|
|
||||||
beautiful.magenta,
|
|
||||||
beautiful.blue,
|
|
||||||
beautiful.cyan,
|
|
||||||
beautiful.green,
|
|
||||||
beautiful.yellow,
|
|
||||||
}
|
|
||||||
|
|
||||||
local animation_directions = { "north", "west", "south", "east" }
|
|
||||||
|
|
||||||
--- Function that "animates" every key press
|
|
||||||
local function key_animation(char_inserted)
|
|
||||||
local color
|
|
||||||
local direction = animation_directions[(characters_entered % 4) + 1]
|
|
||||||
if char_inserted then
|
|
||||||
color = animation_colors[(characters_entered % 6) + 1]
|
|
||||||
lock_animation_icon.markup = lock_screen_symbol
|
|
||||||
else
|
|
||||||
if characters_entered == 0 then
|
|
||||||
reset()
|
|
||||||
else
|
|
||||||
color = beautiful.white .. "55"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
lock_animation_arc.bg = color
|
|
||||||
lock_animation_widget_rotate.direction = direction
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Get input from user
|
|
||||||
local function grab_password()
|
|
||||||
awful.prompt.run({
|
|
||||||
hooks = {
|
|
||||||
--- Custom escape behaviour: Do not cancel input with Escape
|
|
||||||
--- Instead, this will just clear any input received so far.
|
|
||||||
{
|
|
||||||
{},
|
|
||||||
"Escape",
|
|
||||||
function(_)
|
|
||||||
reset()
|
|
||||||
grab_password()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
--- Fix for Control+Delete crashing the keygrabber
|
|
||||||
{
|
|
||||||
{ "Control" },
|
|
||||||
"Delete",
|
|
||||||
function()
|
|
||||||
reset()
|
|
||||||
grab_password()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keypressed_callback = function(mod, key, cmd)
|
|
||||||
--- Only count single character keys (thus preventing "Shift", "Escape", etc from triggering the animation)
|
|
||||||
if #key == 1 then
|
|
||||||
characters_entered = characters_entered + 1
|
|
||||||
key_animation(true)
|
|
||||||
elseif key == "BackSpace" then
|
|
||||||
if characters_entered > 0 then
|
|
||||||
characters_entered = characters_entered - 1
|
|
||||||
end
|
|
||||||
key_animation(false)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
exe_callback = function(input)
|
|
||||||
--- Check input
|
|
||||||
if lock_screen.authenticate(input) then
|
|
||||||
--- YAY
|
|
||||||
reset()
|
|
||||||
set_visibility(false)
|
|
||||||
awesome.emit_signal("widgets::splash::visibility", false)
|
|
||||||
else
|
|
||||||
--- NAY
|
|
||||||
fail()
|
|
||||||
grab_password()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
textbox = some_textbox,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
awesome.connect_signal("summon::lock_screen", function()
|
|
||||||
set_visibility(true)
|
|
||||||
grab_password()
|
|
||||||
awesome.emit_signal("widgets::splash::visibility", true)
|
|
||||||
end)
|
|
||||||
|
|
||||||
lock_screen_box:setup({
|
|
||||||
--- Horizontal centering
|
|
||||||
nil,
|
|
||||||
{
|
|
||||||
--- Vertical centering
|
|
||||||
nil,
|
|
||||||
{
|
|
||||||
wibox.widget({
|
|
||||||
forced_height = dpi(20),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
}),
|
|
||||||
time,
|
|
||||||
lock_animation,
|
|
||||||
spacing = dpi(60),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
},
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.vertical,
|
|
||||||
},
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
})
|
|
||||||
@ -1,261 +0,0 @@
|
|||||||
local gears = require("gears")
|
|
||||||
local awful = require("awful")
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local naughty = require("naughty")
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
local helpers = require("helpers")
|
|
||||||
|
|
||||||
-- Notification list
|
|
||||||
local label = wibox.widget({
|
|
||||||
text = "Notifications",
|
|
||||||
align = "center",
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
})
|
|
||||||
|
|
||||||
local notifs_clear = wibox.widget({
|
|
||||||
markup = "<span foreground='" .. beautiful.red .. "'> </span>",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
})
|
|
||||||
|
|
||||||
notifs_clear:buttons(gears.table.join(awful.button({}, 1, function()
|
|
||||||
_G.notif_center_reset_notifs_container()
|
|
||||||
end)))
|
|
||||||
|
|
||||||
local notifs_empty = wibox.widget({
|
|
||||||
forced_height = dpi(300),
|
|
||||||
widget = wibox.container.background,
|
|
||||||
{
|
|
||||||
layout = wibox.layout.flex.vertical,
|
|
||||||
{
|
|
||||||
markup = "<span foreground='" .. beautiful.bg_urgent .. "'>No notifications</span>",
|
|
||||||
font = beautiful.font,
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local notifs_container = wibox.widget({
|
|
||||||
forced_width = dpi(240),
|
|
||||||
forced_height = dpi(715),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
spacing = dpi(10),
|
|
||||||
spacing_widget = {
|
|
||||||
top = dpi(2),
|
|
||||||
bottom = dpi(2),
|
|
||||||
left = dpi(6),
|
|
||||||
right = dpi(6),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
{
|
|
||||||
widget = wibox.container.background,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local remove_notifs_empty = true
|
|
||||||
|
|
||||||
notif_center_reset_notifs_container = function()
|
|
||||||
notifs_container:reset(notifs_container)
|
|
||||||
notifs_container:insert(1, notifs_empty)
|
|
||||||
remove_notifs_empty = true
|
|
||||||
end
|
|
||||||
|
|
||||||
notif_center_remove_notif = function(box)
|
|
||||||
notifs_container:remove_widgets(box)
|
|
||||||
|
|
||||||
if #notifs_container.children == 0 then
|
|
||||||
notifs_container:insert(1, notifs_empty)
|
|
||||||
remove_notifs_empty = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local create_notif = function(icon, n, width)
|
|
||||||
local time = os.date("%H:%M:%S")
|
|
||||||
|
|
||||||
local icon_widget = wibox.widget({
|
|
||||||
widget = wibox.container.constraint,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(20),
|
|
||||||
{
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
image = icon,
|
|
||||||
clip_shape = gears.shape.circle,
|
|
||||||
halign = "center",
|
|
||||||
valign = "center",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local title_widget = wibox.widget({
|
|
||||||
widget = wibox.container.scroll.horizontal,
|
|
||||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
|
||||||
speed = 50,
|
|
||||||
forced_width = dpi(200),
|
|
||||||
{
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
text = n.title,
|
|
||||||
align = "left",
|
|
||||||
forced_width = dpi(200),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local time_widget = wibox.widget({
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = beautiful.fg_normal,
|
|
||||||
fg = beautiful.bg_normal,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = { left = dpi(10), right = dpi(10), top = dpi(4), bottom = dpi(4) },
|
|
||||||
{
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
text = time,
|
|
||||||
align = "right",
|
|
||||||
valign = "bottom",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local text_notif = wibox.widget({
|
|
||||||
markup = n.message,
|
|
||||||
align = "left",
|
|
||||||
forced_width = dpi(165),
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
})
|
|
||||||
|
|
||||||
local box = wibox.widget({
|
|
||||||
widget = wibox.container.background,
|
|
||||||
forced_height = dpi(120),
|
|
||||||
bg = beautiful.black_alt,
|
|
||||||
{
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
icon_widget,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(10),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.align.vertical,
|
|
||||||
expand = "none",
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
expand = "none",
|
|
||||||
title_widget,
|
|
||||||
nil,
|
|
||||||
time_widget,
|
|
||||||
},
|
|
||||||
text_notif,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
box:buttons(gears.table.join(awful.button({}, 1, function()
|
|
||||||
_G.notif_center_remove_notif(box)
|
|
||||||
end)))
|
|
||||||
|
|
||||||
return box
|
|
||||||
end
|
|
||||||
|
|
||||||
notifs_container:buttons(gears.table.join(
|
|
||||||
awful.button({}, 4, nil, function()
|
|
||||||
if #notifs_container.children == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
notifs_container:insert(1, notifs_container.children[#notifs_container.children])
|
|
||||||
notifs_container:remove(#notifs_container.children)
|
|
||||||
end),
|
|
||||||
|
|
||||||
awful.button({}, 5, nil, function()
|
|
||||||
if #notifs_container.children == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
notifs_container:insert(#notifs_container.children + 1, notifs_container.children[1])
|
|
||||||
notifs_container:remove(1)
|
|
||||||
end)
|
|
||||||
))
|
|
||||||
|
|
||||||
notifs_container:insert(1, notifs_empty)
|
|
||||||
|
|
||||||
naughty.connect_signal("request::display", function(n)
|
|
||||||
if #notifs_container.children == 1 and remove_notifs_empty then
|
|
||||||
notifs_container:reset(notifs_container)
|
|
||||||
remove_notifs_empty = false
|
|
||||||
end
|
|
||||||
|
|
||||||
local appicon = n.icon or n.app_icon
|
|
||||||
if not appicon then
|
|
||||||
appicon = beautiful.awesome_icon
|
|
||||||
end
|
|
||||||
|
|
||||||
notifs_container:insert(1, create_notif(appicon, n, width))
|
|
||||||
end)
|
|
||||||
|
|
||||||
local notifs = wibox.widget({
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(10),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
label,
|
|
||||||
nil,
|
|
||||||
notifs_clear,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
notifs_container,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Main window
|
|
||||||
local main = wibox.widget({
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = beautiful.bg_normal,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(10),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
fill_space = true,
|
|
||||||
spacing = dpi(10),
|
|
||||||
notifs,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local notif_center = awful.popup({
|
|
||||||
shape = helpers.rrect(beautiful.border_radius),
|
|
||||||
visible = false,
|
|
||||||
ontop = true,
|
|
||||||
border_width = beautiful.border_width,
|
|
||||||
border_color = beautiful.widget_border_color,
|
|
||||||
minimum_height = dpi(585),
|
|
||||||
maximum_height = dpi(585),
|
|
||||||
minimum_width = dpi(500),
|
|
||||||
maximum_width = dpi(500),
|
|
||||||
placement = function(d)
|
|
||||||
awful.placement.bottom_right(d, { honor_workarea = true, margins = dpi(5) + beautiful.border_width * 2 })
|
|
||||||
end,
|
|
||||||
widget = main,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Summon functions
|
|
||||||
awesome.connect_signal("summon::notif_center", function()
|
|
||||||
notif_center.visible = not notif_center.visible
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Hide on click on other windows
|
|
||||||
client.connect_signal("button::press", function()
|
|
||||||
notif_center.visible = false
|
|
||||||
end)
|
|
||||||
|
|
||||||
awesome.connect_signal("summon::dismiss", function()
|
|
||||||
naughty.destroy_all_notifications()
|
|
||||||
notif_center.visible = false
|
|
||||||
end)
|
|
||||||
@ -1,281 +0,0 @@
|
|||||||
local awful = require("awful")
|
|
||||||
local gears = require("gears")
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
local dpi = beautiful.xresources.apply_dpi
|
|
||||||
|
|
||||||
local window_switcher_first_client -- The client that was focused when the window_switcher was activated
|
|
||||||
local window_switcher_minimized_clients = {} -- The clients that were minimized when the window switcher was activated
|
|
||||||
local window_switcher_grabber
|
|
||||||
|
|
||||||
local get_num_clients = function()
|
|
||||||
local minimized_clients_in_tag = 0
|
|
||||||
local matcher = function(c)
|
|
||||||
return awful.rules.match(c, {
|
|
||||||
minimized = true,
|
|
||||||
skip_taskbar = false,
|
|
||||||
hidden = false,
|
|
||||||
first_tag = awful.screen.focused().selected_tag,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
for c in awful.client.iterate(matcher) do
|
|
||||||
minimized_clients_in_tag = minimized_clients_in_tag + 1
|
|
||||||
end
|
|
||||||
return minimized_clients_in_tag + #awful.screen.focused().clients
|
|
||||||
end
|
|
||||||
|
|
||||||
local window_switcher_hide = function(window_switcher_box)
|
|
||||||
-- Add currently focused client to history
|
|
||||||
if client.focus then
|
|
||||||
local window_switcher_last_client = client.focus
|
|
||||||
awful.client.focus.history.add(window_switcher_last_client)
|
|
||||||
-- Raise client that was focused originally
|
|
||||||
-- Then raise last focused client
|
|
||||||
if window_switcher_first_client and window_switcher_first_client.valid then
|
|
||||||
window_switcher_first_client:raise()
|
|
||||||
window_switcher_last_client:raise()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Minimize originally minimized clients
|
|
||||||
local s = awful.screen.focused()
|
|
||||||
for _, c in pairs(window_switcher_minimized_clients) do
|
|
||||||
if c and c.valid and not (client.focus and client.focus == c) then
|
|
||||||
c.minimized = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- Reset helper table
|
|
||||||
window_switcher_minimized_clients = {}
|
|
||||||
|
|
||||||
-- Resume recording focus history
|
|
||||||
awful.client.focus.history.enable_tracking()
|
|
||||||
-- Stop and hide window_switcher
|
|
||||||
awful.keygrabber.stop(window_switcher_grabber)
|
|
||||||
window_switcher_box.visible = false
|
|
||||||
window_switcher_box.widget = nil
|
|
||||||
collectgarbage("collect")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function draw_widget(mouse_keys)
|
|
||||||
local tasklist_widget = awful.widget.tasklist({
|
|
||||||
screen = awful.screen.focused(),
|
|
||||||
filter = awful.widget.tasklist.filter.currenttags,
|
|
||||||
buttons = mouse_keys,
|
|
||||||
style = {
|
|
||||||
font = beautiful.font,
|
|
||||||
bg_normal = beautiful.bg_normal,
|
|
||||||
bg_focus = beautiful.bg_focus,
|
|
||||||
fg_normal = beautiful.fg_normal,
|
|
||||||
fg_focus = beautiful.fg_focus,
|
|
||||||
shape = gears.shape.rounded_rect,
|
|
||||||
},
|
|
||||||
layout = {
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
widget_template = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
awful.widget.clienticon,
|
|
||||||
forced_height = dpi(80),
|
|
||||||
forced_width = dpi(80),
|
|
||||||
halign = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.container.place,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
widget = wibox.container.scroll.horizontal,
|
|
||||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
|
||||||
fps = 60,
|
|
||||||
speed = 75,
|
|
||||||
{
|
|
||||||
id = "text_role",
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
halign = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.container.place,
|
|
||||||
},
|
|
||||||
spacing = dpi(15),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
},
|
|
||||||
margins = dpi(15),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
forced_width = dpi(150),
|
|
||||||
forced_height = dpi(150),
|
|
||||||
id = "background_role",
|
|
||||||
widget = wibox.container.background,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
return wibox.widget({
|
|
||||||
{
|
|
||||||
tasklist_widget,
|
|
||||||
margins = dpi(15),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
bg = beautiful.background,
|
|
||||||
shape = gears.shape.rounded_rect,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local hide_window_switcher_key = "Escape"
|
|
||||||
|
|
||||||
local select_client_key = 1
|
|
||||||
local minimize_key = "n"
|
|
||||||
local unminimize_key = "N"
|
|
||||||
local kill_client_key = "q"
|
|
||||||
|
|
||||||
local cycle_key = "Tab"
|
|
||||||
|
|
||||||
local previous_key = "Left"
|
|
||||||
local next_key = "Right"
|
|
||||||
|
|
||||||
local vim_previous_key = "h"
|
|
||||||
local vim_next_key = "l"
|
|
||||||
|
|
||||||
local scroll_previous_key = 4
|
|
||||||
local scroll_next_key = 5
|
|
||||||
|
|
||||||
local window_switcher_box = awful.popup({
|
|
||||||
-- bg = beautiful.transparent,
|
|
||||||
visible = false,
|
|
||||||
ontop = true,
|
|
||||||
placement = awful.placement.centered,
|
|
||||||
screen = awful.screen.focused(),
|
|
||||||
widget = wibox.container.background, -- A dummy widget to make awful.popup not scream
|
|
||||||
widget = draw_widget(),
|
|
||||||
})
|
|
||||||
|
|
||||||
local mouse_keys = gears.table.join(
|
|
||||||
awful.button({
|
|
||||||
modifiers = { "Any" },
|
|
||||||
button = select_client_key,
|
|
||||||
on_press = function(c)
|
|
||||||
client.focus = c
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
|
|
||||||
awful.button({
|
|
||||||
modifiers = { "Any" },
|
|
||||||
button = scroll_previous_key,
|
|
||||||
on_press = function()
|
|
||||||
awful.client.focus.byidx(-1)
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
|
|
||||||
awful.button({
|
|
||||||
modifiers = { "Any" },
|
|
||||||
button = scroll_next_key,
|
|
||||||
on_press = function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
local keyboard_keys = {
|
|
||||||
[hide_window_switcher_key] = function()
|
|
||||||
window_switcher_hide(window_switcher_box)
|
|
||||||
end,
|
|
||||||
|
|
||||||
[minimize_key] = function()
|
|
||||||
if client.focus then
|
|
||||||
client.focus.minimized = true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
[unminimize_key] = function()
|
|
||||||
if awful.client.restore() then
|
|
||||||
client.focus = awful.client.restore()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
[kill_client_key] = function()
|
|
||||||
if client.focus then
|
|
||||||
client.focus:kill()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
[cycle_key] = function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end,
|
|
||||||
|
|
||||||
[previous_key] = function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end,
|
|
||||||
[next_key] = function()
|
|
||||||
awful.client.focus.byidx(-1)
|
|
||||||
end,
|
|
||||||
|
|
||||||
[vim_previous_key] = function()
|
|
||||||
awful.client.focus.byidx(1)
|
|
||||||
end,
|
|
||||||
[vim_next_key] = function()
|
|
||||||
awful.client.focus.byidx(-1)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
window_switcher_box:connect_signal("property::width", function()
|
|
||||||
if window_switcher_box.visible and get_num_clients() == 0 then
|
|
||||||
window_switcher_hide(window_switcher_box)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
window_switcher_box:connect_signal("property::height", function()
|
|
||||||
if window_switcher_box.visible and get_num_clients() == 0 then
|
|
||||||
window_switcher_hide(window_switcher_box)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
awesome.connect_signal("window_switcher::turn_on", function()
|
|
||||||
local number_of_clients = get_num_clients()
|
|
||||||
if number_of_clients == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Store client that is focused in a variable
|
|
||||||
window_switcher_first_client = client.focus
|
|
||||||
|
|
||||||
-- Stop recording focus history
|
|
||||||
awful.client.focus.history.disable_tracking()
|
|
||||||
|
|
||||||
-- Go to previously focused client (in the tag)
|
|
||||||
awful.client.focus.history.previous()
|
|
||||||
|
|
||||||
-- Track minimized clients
|
|
||||||
-- Unminimize them
|
|
||||||
-- Lower them so that they are always below other
|
|
||||||
-- originally unminimized windows
|
|
||||||
local clients = awful.screen.focused().selected_tag:clients()
|
|
||||||
for _, c in pairs(clients) do
|
|
||||||
if c.minimized then
|
|
||||||
table.insert(window_switcher_minimized_clients, c)
|
|
||||||
c.minimized = false
|
|
||||||
c:lower()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Start the keygrabber
|
|
||||||
window_switcher_grabber = awful.keygrabber.run(function(_, key, event)
|
|
||||||
if event == "release" then
|
|
||||||
-- Hide if the modifier was released
|
|
||||||
-- We try to match Super or Alt or Control since we do not know which keybind is
|
|
||||||
-- used to activate the window switcher (the keybind is set by the user in keys.lua)
|
|
||||||
if key:match("Super") or key:match("Alt") or key:match("Control") then
|
|
||||||
window_switcher_hide(window_switcher_box)
|
|
||||||
end
|
|
||||||
-- Do nothing
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Run function attached to key, if it exists
|
|
||||||
if keyboard_keys[key] then
|
|
||||||
keyboard_keys[key]()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
window_switcher_box.widget = draw_widget(mouse_keys)
|
|
||||||
window_switcher_box.visible = true
|
|
||||||
end)
|
|
||||||
@ -1,798 +0,0 @@
|
|||||||
-- ░█▄█░█▀█░█▀▄░█▀▀░█▀▀░█▀█░█▀█░█▀█░▀█▀░▀░█▀▀░░░█▀█░█░█░█▀▀░█▀▀░█▀█░█▄█░█▀▀
|
|
||||||
-- ░█░█░█░█░█▀▄░▀▀█░█▀▀░█░█░█▀█░█▀▀░░█░░░░▀▀█░░░█▀█░█▄█░█▀▀░▀▀█░█░█░█░█░█▀▀
|
|
||||||
-- ░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀░░░▀▀▀░░░▀▀▀░░░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀
|
|
||||||
|
|
||||||
-- >> The file that binds everything together.
|
|
||||||
local awesome = awesome
|
|
||||||
local client = client
|
|
||||||
local screen = screen
|
|
||||||
local decorations = {}
|
|
||||||
|
|
||||||
-- User variables and preferences
|
|
||||||
-- ===================================================================
|
|
||||||
user = {
|
|
||||||
terminal = "wezterm start --always-new-process",
|
|
||||||
floating_terminal = "wezterm start --class floating_terminal",
|
|
||||||
scratchpad_terminal = "wezterm start --class scratchpad",
|
|
||||||
editor = "wezterm start --class editor -e hx",
|
|
||||||
browser = "firefox",
|
|
||||||
file_manager = "pcmanfm",
|
|
||||||
term_filemanager = "wezterm start --class term_filemanager -e yazi",
|
|
||||||
visual_editor = "",
|
|
||||||
openweathermap_key = "d1b3b6a81db867259446b0863d5f9108",
|
|
||||||
openweathermap_city_id = {
|
|
||||||
"25.6", -- lat
|
|
||||||
"85.1167", -- lon
|
|
||||||
},
|
|
||||||
openweathermap_weather_units = "metric",
|
|
||||||
lock_screen_custom_password = "040424",
|
|
||||||
app_launcher = "rofi -matching fuzzy -show drun",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Initialization
|
|
||||||
-- ===================================================================
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
-- Make dpi function global
|
|
||||||
dpi = beautiful.xresources.apply_dpi
|
|
||||||
|
|
||||||
-- Load AwesomeWM libraries
|
|
||||||
local gears = require("gears")
|
|
||||||
local gfs = require("gears.filesystem")
|
|
||||||
local awful = require("awful")
|
|
||||||
require("awful.autofocus")
|
|
||||||
-- Default notification library
|
|
||||||
local naughty = require("naughty")
|
|
||||||
|
|
||||||
-- Load theme
|
|
||||||
beautiful.init(gfs.get_configuration_dir() .. "themes/gruva/" .. "theme.lua")
|
|
||||||
|
|
||||||
-- Error handling
|
|
||||||
-- ===================================================================
|
|
||||||
naughty.connect_signal("request::display_error", function(message, startup)
|
|
||||||
naughty.notification({
|
|
||||||
urgency = "critical",
|
|
||||||
title = "Oops, an error happened" .. (startup and " during startup!" or "!"),
|
|
||||||
message = message,
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Features
|
|
||||||
-- ===================================================================
|
|
||||||
-- Load helper functions
|
|
||||||
local helpers = require("helpers")
|
|
||||||
-- Apps
|
|
||||||
apps = {
|
|
||||||
-- TODO: switchtotag not working?
|
|
||||||
browser = function()
|
|
||||||
awful.spawn(user.browser, { switchtotag = true })
|
|
||||||
end,
|
|
||||||
file_manager = function()
|
|
||||||
awful.spawn(user.file_manager, { floating = true })
|
|
||||||
end,
|
|
||||||
term_filemanager = function()
|
|
||||||
awful.spawn(user.term_filemanager, { floating = true })
|
|
||||||
end,
|
|
||||||
editor = function()
|
|
||||||
helpers.run_or_raise({ instance = "editor" }, false, user.editor, { switchtotag = true })
|
|
||||||
end,
|
|
||||||
visual_editor = function()
|
|
||||||
helpers.run_or_raise({ class = "" }, false, user.visual_editor, { switchtotag = true })
|
|
||||||
end,
|
|
||||||
volume = function()
|
|
||||||
helpers.run_or_raise({ class = "Pavucontrol" }, true, "pavucontrol")
|
|
||||||
end,
|
|
||||||
process_monitor = function()
|
|
||||||
helpers.run_or_raise(
|
|
||||||
{ instance = "bottom" },
|
|
||||||
false,
|
|
||||||
user.terminal .. " --class bottom -e btm",
|
|
||||||
{ switchtotag = true }
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
screenshot_full = function()
|
|
||||||
awful.spawn.with_shell("maim -s | swappy -f -")
|
|
||||||
end,
|
|
||||||
screenshot_clipboard = function()
|
|
||||||
awful.spawn.with_shell("maim -s | xclip -selection clipboard -t image/png")
|
|
||||||
end,
|
|
||||||
clipboard = function()
|
|
||||||
awful.spawn.with_shell("clipmenu")
|
|
||||||
end,
|
|
||||||
emoji_picker = function()
|
|
||||||
awful.spawn("rofi -show emoji")
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Confuguration folder
|
|
||||||
require("themes/gruva")
|
|
||||||
|
|
||||||
-- Keybinds and mousebinds
|
|
||||||
local keys = require("keys")
|
|
||||||
|
|
||||||
-- Lock screen
|
|
||||||
-- Make sure to install lua-pam as described in the README or configure your
|
|
||||||
-- custom password in the 'user' section above
|
|
||||||
require("modules.lockscreen")
|
|
||||||
-- Window switcher
|
|
||||||
require("modules.window_switcher")
|
|
||||||
-- Notification center
|
|
||||||
require("modules.notification_center")
|
|
||||||
|
|
||||||
-- Daemons
|
|
||||||
-- Most widgets that display system/external info depend on evil.
|
|
||||||
-- Make sure to initialize it last in order to allow all widgets to connect to
|
|
||||||
-- their needed evil signals.
|
|
||||||
require("evil")
|
|
||||||
|
|
||||||
-- Get screen geometry
|
|
||||||
-- I am using a single screen setup and I assume that screen geometry will not
|
|
||||||
-- change during the session.
|
|
||||||
local screen_width = awful.screen.focused().geometry.width
|
|
||||||
local screen_height = awful.screen.focused().geometry.height
|
|
||||||
|
|
||||||
-- Layouts
|
|
||||||
-- ===================================================================
|
|
||||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
|
||||||
awful.layout.layouts = {
|
|
||||||
awful.layout.suit.tile,
|
|
||||||
awful.layout.suit.floating,
|
|
||||||
awful.layout.suit.max,
|
|
||||||
--awful.layout.suit.spiral,
|
|
||||||
--awful.layout.suit.spiral.dwindle,
|
|
||||||
--awful.layout.suit.tile.top,
|
|
||||||
--awful.layout.suit.fair,
|
|
||||||
--awful.layout.suit.fair.horizontal,
|
|
||||||
--awful.layout.suit.tile.left,
|
|
||||||
--awful.layout.suit.tile.bottom,
|
|
||||||
--awful.layout.suit.max.fullscreen,
|
|
||||||
--awful.layout.suit.corner.nw,
|
|
||||||
--awful.layout.suit.magnifier,
|
|
||||||
--awful.layout.suit.corner.ne,
|
|
||||||
--awful.layout.suit.corner.sw,
|
|
||||||
--awful.layout.suit.corner.se,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Wallpaper
|
|
||||||
-- ===================================================================
|
|
||||||
local function set_wallpaper(s)
|
|
||||||
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
|
|
||||||
|
|
||||||
-- >> Method 1: Built in wallpaper function
|
|
||||||
gears.wallpaper.maximized(wallpaper, s, true)
|
|
||||||
|
|
||||||
-- >> Method 2: Set theme's wallpaper with feh
|
|
||||||
-- awful.spawn.with_shell("feh --bg-fill " .. wallpaper)
|
|
||||||
|
|
||||||
-- >> Method 3: Set last wallpaper with feh
|
|
||||||
-- awful.spawn.with_shell(os.getenv("HOME") .. "/.fehbg")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Set wallpaper
|
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
|
||||||
set_wallpaper(s)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
|
||||||
screen.connect_signal("property::geometry", set_wallpaper)
|
|
||||||
|
|
||||||
-- Tags
|
|
||||||
-- ===================================================================
|
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
|
||||||
-- Each screen has its own tag table.
|
|
||||||
local l = awful.layout.suit -- Alias to save time :)
|
|
||||||
-- Tag layouts
|
|
||||||
local layouts = {
|
|
||||||
l.max,
|
|
||||||
l.max,
|
|
||||||
l.max,
|
|
||||||
l.max,
|
|
||||||
l.max,
|
|
||||||
l.max,
|
|
||||||
l.tile,
|
|
||||||
l.tile,
|
|
||||||
l.tile,
|
|
||||||
l.tile,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Tag names
|
|
||||||
local tagnames = beautiful.tagnames or { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }
|
|
||||||
-- Create all tags at once (without seperate configuration for each tag)
|
|
||||||
awful.tag(tagnames, s, layouts)
|
|
||||||
|
|
||||||
-- Create tags with seperate configuration for each tag
|
|
||||||
-- awful.tag.add(tagnames[1], {
|
|
||||||
-- layout = layouts[1],
|
|
||||||
-- screen = s,
|
|
||||||
-- master_width_factor = 0.6,
|
|
||||||
-- selected = true,
|
|
||||||
-- })
|
|
||||||
-- ...
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Determines how floating clients should be placed
|
|
||||||
local floating_client_placement = function(c)
|
|
||||||
-- If the layout is floating or there are no other visible
|
|
||||||
-- clients, center client
|
|
||||||
if awful.layout.get(mouse.screen) ~= awful.layout.suit.floating or #mouse.screen.clients == 1 then
|
|
||||||
return awful.placement.centered(c, { honor_padding = true, honor_workarea = true })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Else use this placement
|
|
||||||
local p = awful.placement.no_overlap + awful.placement.no_offscreen
|
|
||||||
return p(c, { honor_padding = true, honor_workarea = true, margins = beautiful.useless_gap * 2 })
|
|
||||||
end
|
|
||||||
|
|
||||||
local centered_client_placement = function(c)
|
|
||||||
return gears.timer.delayed_call(function()
|
|
||||||
awful.placement.centered(c, { honor_padding = true, honor_workarea = true })
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Rules
|
|
||||||
-- ===================================================================
|
|
||||||
-- Rules to apply to new clients (through the "manage" signal).
|
|
||||||
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,
|
|
||||||
raise = true,
|
|
||||||
keys = keys.clientkeys,
|
|
||||||
buttons = keys.clientbuttons,
|
|
||||||
screen = awful.screen.focused,
|
|
||||||
size_hints_honor = false,
|
|
||||||
honor_workarea = true,
|
|
||||||
honor_padding = true,
|
|
||||||
maximized = false,
|
|
||||||
titlebars_enabled = beautiful.titlebars_enabled,
|
|
||||||
maximized_horizontal = false,
|
|
||||||
maximized_vertical = false,
|
|
||||||
placement = floating_client_placement,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Floating clients
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
instance = {
|
|
||||||
"floating_terminal",
|
|
||||||
"Devtools", -- Firefox devtools
|
|
||||||
},
|
|
||||||
class = {
|
|
||||||
"Gpick",
|
|
||||||
"Lxappearance",
|
|
||||||
"Nm-connection-editor",
|
|
||||||
"File-roller",
|
|
||||||
"fst",
|
|
||||||
"Nvidia-settings",
|
|
||||||
},
|
|
||||||
name = {
|
|
||||||
"Event Tester", -- xev
|
|
||||||
"MetaMask Notification",
|
|
||||||
"Picture in picture",
|
|
||||||
},
|
|
||||||
role = {
|
|
||||||
"AlarmWindow",
|
|
||||||
"pop-up",
|
|
||||||
"GtkFileChooserDialog",
|
|
||||||
"conversation",
|
|
||||||
},
|
|
||||||
type = {
|
|
||||||
"dialog",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { floating = true },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Fullscreen clients
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"dota2",
|
|
||||||
"dontstarve_steam",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"synthetik.exe",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { fullscreen = true },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Centered clients
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
type = {
|
|
||||||
"dialog",
|
|
||||||
},
|
|
||||||
class = {
|
|
||||||
"Steam",
|
|
||||||
"discord",
|
|
||||||
"music",
|
|
||||||
"scratchpad",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"music",
|
|
||||||
"scratchpad",
|
|
||||||
},
|
|
||||||
role = {
|
|
||||||
"GtkFileChooserDialog",
|
|
||||||
"conversation",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { placement = centered_client_placement },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Titlebars ON (explicitly)
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
type = {
|
|
||||||
"dialog",
|
|
||||||
},
|
|
||||||
role = {
|
|
||||||
"conversation",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
callback = function(c)
|
|
||||||
decorations.show(c)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- "Needy": Clients that steal focus when they are urgent
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"TelegramDesktop",
|
|
||||||
"firefox",
|
|
||||||
"Nightly",
|
|
||||||
},
|
|
||||||
type = {
|
|
||||||
"dialog",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
callback = function(c)
|
|
||||||
c:connect_signal("property::urgent", function()
|
|
||||||
if c.urgent then
|
|
||||||
c:jump_to()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Fixed terminal geometry for floating terminals
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"Alacritty",
|
|
||||||
"Termite",
|
|
||||||
"mpvtube",
|
|
||||||
"kitty",
|
|
||||||
"st-256color",
|
|
||||||
"st",
|
|
||||||
"URxvt",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { width = screen_width * 0.45, height = screen_height * 0.5 },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- File chooser dialog
|
|
||||||
{
|
|
||||||
rule_any = { role = { "GtkFileChooserDialog" } },
|
|
||||||
properties = { floating = true, width = screen_width * 0.55, height = screen_height * 0.65 },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Pavucontrol
|
|
||||||
{
|
|
||||||
rule_any = { class = { "Pavucontrol" } },
|
|
||||||
properties = { floating = true, width = screen_width * 0.45, height = screen_height * 0.8 },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Galculator
|
|
||||||
{
|
|
||||||
rule_any = { class = { "Galculator" } },
|
|
||||||
except_any = { type = { "dialog" } },
|
|
||||||
properties = { floating = true, width = screen_width * 0.2, height = screen_height * 0.4 },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- File managers
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"Pcmanfm",
|
|
||||||
"Nemo",
|
|
||||||
"Thunar",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
except_any = {
|
|
||||||
type = { "dialog" },
|
|
||||||
},
|
|
||||||
properties = { floating = true, width = screen_width * 0.45, height = screen_height * 0.55 },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Scratchpad
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
instance = {
|
|
||||||
"scratchpad",
|
|
||||||
"markdown_input",
|
|
||||||
},
|
|
||||||
class = {
|
|
||||||
"scratchpad",
|
|
||||||
"markdown_input",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = {
|
|
||||||
skip_taskbar = false,
|
|
||||||
floating = true,
|
|
||||||
ontop = false,
|
|
||||||
minimized = true,
|
|
||||||
sticky = false,
|
|
||||||
width = screen_width * 0.7,
|
|
||||||
height = screen_height * 0.75,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Music clients (usually a terminal running ncmpcpp)
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"music",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"music",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = {
|
|
||||||
floating = true,
|
|
||||||
width = screen_width * 0.45,
|
|
||||||
height = screen_height * 0.50,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Image viewers
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"feh",
|
|
||||||
"Sxiv",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = {
|
|
||||||
floating = true,
|
|
||||||
width = screen_width * 0.7,
|
|
||||||
height = screen_height * 0.75,
|
|
||||||
},
|
|
||||||
callback = function(c)
|
|
||||||
awful.placement.centered(c, { honor_padding = true, honor_workarea = true })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Steam guard
|
|
||||||
{
|
|
||||||
rule = { name = "Steam Guard - Computer Authorization Required" },
|
|
||||||
properties = { floating = true },
|
|
||||||
-- Such a stubborn window, centering it does not work
|
|
||||||
-- callback = function(c)
|
|
||||||
-- gears.timer.delayed_call(function()
|
|
||||||
-- awful.placement.centered(c,{honor_padding = true, honor_workarea=true})
|
|
||||||
-- end)
|
|
||||||
-- end
|
|
||||||
},
|
|
||||||
|
|
||||||
-- MPV
|
|
||||||
{
|
|
||||||
rule = { class = "mpv" },
|
|
||||||
properties = {},
|
|
||||||
callback = function(c)
|
|
||||||
-- Make it floating, ontop and move it out of the way if the current tag is maximized
|
|
||||||
if awful.layout.get(awful.screen.focused()) == awful.layout.suit.max then
|
|
||||||
c.floating = true
|
|
||||||
c.ontop = true
|
|
||||||
c.width = screen_width * 0.30
|
|
||||||
c.height = screen_height * 0.35
|
|
||||||
awful.placement.bottom_right(c, {
|
|
||||||
honor_padding = true,
|
|
||||||
honor_workarea = true,
|
|
||||||
margins = { bottom = beautiful.useless_gap * 2, right = beautiful.useless_gap * 2 },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Restore `ontop` after fullscreen is disabled
|
|
||||||
-- Sorta tries to fix: https://github.com/awesomeWM/awesome/issues/667
|
|
||||||
c:connect_signal("property::fullscreen", function()
|
|
||||||
if not c.fullscreen then
|
|
||||||
c.ontop = true
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Start application on specific workspace
|
|
||||||
-- ===================================================================
|
|
||||||
-- Browsing
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"firefox",
|
|
||||||
"Nightly",
|
|
||||||
"Vivaldi-stable",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
except_any = {
|
|
||||||
role = { "GtkFileChooserDialog" },
|
|
||||||
instance = { "Toolkit" },
|
|
||||||
type = { "dialog" },
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[1] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Editing
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"^editor$",
|
|
||||||
"VSCodium",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[2] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Games
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"Wine",
|
|
||||||
},
|
|
||||||
instance = {},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[3] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Chatting
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"discord",
|
|
||||||
"Signal",
|
|
||||||
"Slack",
|
|
||||||
"zoom",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[4] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- System monitoring
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"htop",
|
|
||||||
"bottom",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"htop",
|
|
||||||
"bottom",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[5] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Image editing
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"Gimp",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[6] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Mail
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"email",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"email",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[7] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Game clients/launchers
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"Steam",
|
|
||||||
"battle.net.exe",
|
|
||||||
"Lutris",
|
|
||||||
},
|
|
||||||
name = {
|
|
||||||
"Steam",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[8] },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Miscellaneous
|
|
||||||
-- All clients that I want out of my way when they are running
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
class = {
|
|
||||||
"torrent",
|
|
||||||
"Transmission",
|
|
||||||
"Deluge",
|
|
||||||
"VirtualBox Manager",
|
|
||||||
"KeePassXC",
|
|
||||||
},
|
|
||||||
instance = {
|
|
||||||
"torrent",
|
|
||||||
"qemu",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
except_any = {
|
|
||||||
type = { "dialog" },
|
|
||||||
},
|
|
||||||
properties = { screen = 1, tag = awful.screen.focused().tags[10] },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Signals
|
|
||||||
-- ===================================================================
|
|
||||||
if beautiful.border_width > 0 then
|
|
||||||
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)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Set mouse resize mode (live or after)
|
|
||||||
awful.mouse.resize.set_mode("live")
|
|
||||||
|
|
||||||
-- Restore geometry for floating clients
|
|
||||||
-- (for example after swapping from tiling mode to floating mode)
|
|
||||||
tag.connect_signal("property::layout", function(t)
|
|
||||||
for k, c in ipairs(t:clients()) do
|
|
||||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
|
||||||
local cgeo = awful.client.property.get(c, "floating_geometry")
|
|
||||||
if cgeo then
|
|
||||||
c:geometry(awful.client.property.get(c, "floating_geometry"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
client.connect_signal("manage", function(c)
|
|
||||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
|
||||||
awful.client.property.set(c, "floating_geometry", c:geometry())
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
client.connect_signal("property::geometry", function(c)
|
|
||||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
|
||||||
awful.client.property.set(c, "floating_geometry", c:geometry())
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- When switching to a tag with urgent clients, raise them.
|
|
||||||
-- This fixes the issue (visual mismatch) where after switching to
|
|
||||||
-- a tag which includes an urgent client, the urgent client is
|
|
||||||
-- unfocused but still covers all other windows (even the currently
|
|
||||||
-- focused window).
|
|
||||||
awful.tag.attached_connect_signal(s, "property::selected", function()
|
|
||||||
local urgent_clients = function(c)
|
|
||||||
return awful.rules.match(c, { urgent = true })
|
|
||||||
end
|
|
||||||
for c in awful.client.iterate(urgent_clients) do
|
|
||||||
if c.first_tag == mouse.screen.selected_tag then
|
|
||||||
client.focus = c
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Enable sloppy focus, so that focus follows mouse.
|
|
||||||
-- client.connect_signal("mouse::enter", function(c)
|
|
||||||
-- c:activate { context = "mouse_enter", raise = false }
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- Raise focused clients automatically
|
|
||||||
client.connect_signal("focus", function(c)
|
|
||||||
c:raise()
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Focus all urgent clients automatically
|
|
||||||
-- client.connect_signal("property::urgent", function(c)
|
|
||||||
-- if c.urgent then
|
|
||||||
-- c.minimized = false
|
|
||||||
-- c:jump_to()
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- Disable ontop when the client is not floating, and restore ontop if needed
|
|
||||||
-- when the client is floating again
|
|
||||||
-- I never want a non floating client to be ontop.
|
|
||||||
client.connect_signal("property::floating", function(c)
|
|
||||||
if c.floating then
|
|
||||||
if c.restore_ontop then
|
|
||||||
c.ontop = c.restore_ontop
|
|
||||||
end
|
|
||||||
else
|
|
||||||
c.restore_ontop = c.ontop
|
|
||||||
c.ontop = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Hide all windows when a splash is shown
|
|
||||||
awesome.connect_signal("widgets::splash::visibility", function(vis)
|
|
||||||
local t = screen.primary.selected_tag
|
|
||||||
if vis then
|
|
||||||
for idx, c in ipairs(t:clients()) do
|
|
||||||
c.hidden = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for idx, c in ipairs(t:clients()) do
|
|
||||||
c.hidden = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Decorations
|
|
||||||
-- ===================================================================
|
|
||||||
local wibox = require("wibox")
|
|
||||||
-- Apply rounded corners to clients if needed
|
|
||||||
if beautiful.border_radius and beautiful.border_radius > 0 then
|
|
||||||
client.connect_signal("manage", function(c, startup)
|
|
||||||
if not c.fullscreen and not c.maximized then
|
|
||||||
c.shape = helpers.rrect(beautiful.border_radius)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Fullscreen and maximized clients should not have rounded corners
|
|
||||||
local function no_round_corners(c)
|
|
||||||
if c.fullscreen or c.maximized then
|
|
||||||
c.shape = gears.shape.rectangle
|
|
||||||
else
|
|
||||||
c.shape = helpers.rrect(beautiful.border_radius)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
client.connect_signal("property::fullscreen", no_round_corners)
|
|
||||||
client.connect_signal("property::maximized", no_round_corners)
|
|
||||||
|
|
||||||
beautiful.snap_shape = helpers.rrect(beautiful.border_radius * 2)
|
|
||||||
else
|
|
||||||
beautiful.snap_shape = gears.shape.rectangle
|
|
||||||
end
|
|
||||||
|
|
||||||
function decorations.show(c)
|
|
||||||
if not c.custom_decoration or not c.custom_decoration[beautiful.titlebar_position] then
|
|
||||||
awful.titlebar.show(c, beautiful.titlebar_position)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Dummy titlebar
|
|
||||||
client.connect_signal("request::titlebars", function(c)
|
|
||||||
awful.titlebar(c)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Startup apps
|
|
||||||
-- ===================================================================
|
|
||||||
-- Spawn once
|
|
||||||
-- awful.spawn.once({}, false)
|
|
||||||
-- With shell
|
|
||||||
-- awful.spawn.with_shell({}, false)
|
|
||||||
|
|
||||||
-- Garbage collection
|
|
||||||
-- ===================================================================
|
|
||||||
collectgarbage("setpause", 110)
|
|
||||||
collectgarbage("setstepmul", 1000)
|
|
||||||
@ -1,733 +0,0 @@
|
|||||||
-- ░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀░█░█░█▀▄░█▀█░▀█▀░▀█▀░█▀█░█▀█
|
|
||||||
-- ░█░░░█░█░█░█░█▀▀░░█░░█░█░█░█░█▀▄░█▀█░░█░░░█░░█░█░█░█
|
|
||||||
-- ░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░▀░░▀▀▀░▀▀▀░▀░▀
|
|
||||||
|
|
||||||
local gears = require("gears")
|
|
||||||
local awful = require("awful")
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
local naughty = require("naughty")
|
|
||||||
local menubar = require("menubar")
|
|
||||||
local keys = require("keys")
|
|
||||||
local helpers = require("helpers")
|
|
||||||
local awesome = awesome
|
|
||||||
local client = client
|
|
||||||
|
|
||||||
-- ░█░█░▀█▀░█▀▄░█▀▀░█▀▀░▀█▀░█▀▀
|
|
||||||
-- ░█▄█░░█░░█░█░█░█░█▀▀░░█░░▀▀█
|
|
||||||
-- ░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░░▀░░▀▀▀
|
|
||||||
|
|
||||||
-- Memory widget
|
|
||||||
-- ===================================================================
|
|
||||||
local memory_widget = wibox.widget({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
text = "",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = beautiful.wibar_icon_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
-- fixing font centering
|
|
||||||
right = dpi(3),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
bg = beautiful.darkblue,
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.background,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "text",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
left = dpi(5),
|
|
||||||
right = dpi(5),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
bg = beautiful.blue,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::ram", function(used, total)
|
|
||||||
memory_widget:get_children_by_id("text")[1].markup = tostring(used) .. " MB"
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Clock widget
|
|
||||||
-- ===================================================================
|
|
||||||
local clock_widget = wibox.widget({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
text = "",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = beautiful.wibar_icon_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
-- fixing font centering
|
|
||||||
right = dpi(3),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
bg = beautiful.darkgreen,
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.background,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "text",
|
|
||||||
format = "%a %b %d - %I:%M %p",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
widget = wibox.widget.textclock,
|
|
||||||
},
|
|
||||||
left = dpi(5),
|
|
||||||
right = dpi(5),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
bg = beautiful.green,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- CPU widget
|
|
||||||
-- ===================================================================
|
|
||||||
local cpu_widget = wibox.widget({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
text = "",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = beautiful.wibar_icon_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
-- fixing font centering
|
|
||||||
right = dpi(5),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
bg = beautiful.cyan,
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.background,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "text",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
left = dpi(5),
|
|
||||||
right = dpi(5),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
fg = beautiful.cyan,
|
|
||||||
bg = beautiful.light_bg,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::cpu", function(cpu_idle)
|
|
||||||
cpu_widget:get_children_by_id("text")[1].markup = tostring(cpu_idle) .. "%"
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Weather widget
|
|
||||||
-- ===================================================================
|
|
||||||
local weather_widget = wibox.widget({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
text = "",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = beautiful.wibar_icon_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
bg = beautiful.magenta,
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.background,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "description",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
{
|
|
||||||
id = "temp_current",
|
|
||||||
align = "right",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
widget = wibox.layout.align.horizontal,
|
|
||||||
},
|
|
||||||
left = dpi(5),
|
|
||||||
right = dpi(5),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
fg = beautiful.magenta,
|
|
||||||
bg = beautiful.light_bg,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::weather", function(result)
|
|
||||||
weather_widget:get_children_by_id("description")[1].markup = result.current.weather[1].description:gsub(
|
|
||||||
"^%l",
|
|
||||||
string.upper
|
|
||||||
) .. ", "
|
|
||||||
weather_widget:get_children_by_id("temp_current")[1].markup = math.floor(result.current.temp)
|
|
||||||
.. "<sup><span>°</span></sup><span>C</span>"
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Playerctl widget
|
|
||||||
-- ===================================================================
|
|
||||||
local playerctl_widget = wibox.widget({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
text = "",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = beautiful.wibar_icon_font,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
bg = beautiful.red,
|
|
||||||
fg = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.background,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "text",
|
|
||||||
text = "Not Playing",
|
|
||||||
font = beautiful.wibar_font,
|
|
||||||
align = "center",
|
|
||||||
forced_width = dpi(100),
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
left = dpi(10),
|
|
||||||
right = dpi(10),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
fg = beautiful.red,
|
|
||||||
bg = beautiful.light_bg,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::playerctl", function(artist, title, status)
|
|
||||||
playerctl_widget:get_children_by_id("text")[1].markup = title
|
|
||||||
end)
|
|
||||||
|
|
||||||
playerctl_widget:buttons(gears.table.join(
|
|
||||||
-- left click = all players
|
|
||||||
awful.button({}, 1, function()
|
|
||||||
awful.spawn.with_shell("playerctl play-pause")
|
|
||||||
end)
|
|
||||||
-- right click = specific player
|
|
||||||
-- awful.button({}, 3, function()
|
|
||||||
-- awful.spawn.with_shell("mpvc toggle")
|
|
||||||
-- end)
|
|
||||||
))
|
|
||||||
|
|
||||||
-- Volume bar widget
|
|
||||||
-- ===================================================================
|
|
||||||
local volume_bar = wibox.widget({
|
|
||||||
max_value = 100,
|
|
||||||
value = 70,
|
|
||||||
forced_width = dpi(100),
|
|
||||||
shape = helpers.rrect(dpi(6)),
|
|
||||||
bar_shape = helpers.rrect(dpi(6)),
|
|
||||||
color = beautiful.bg_focus,
|
|
||||||
background_color = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.progressbar,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::volume", function(volume, muted)
|
|
||||||
volume_bar.value = volume
|
|
||||||
|
|
||||||
if muted then
|
|
||||||
volume_bar.color = beautiful.light_bg
|
|
||||||
else
|
|
||||||
volume_bar.color = beautiful.bg_focus
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Battery bar widget
|
|
||||||
-- ===================================================================
|
|
||||||
local battery_bar = wibox.widget({
|
|
||||||
max_value = 100,
|
|
||||||
value = 50,
|
|
||||||
forced_width = dpi(100),
|
|
||||||
shape = helpers.rrect(dpi(6)),
|
|
||||||
bar_shape = helpers.rrect(dpi(6)),
|
|
||||||
color = beautiful.bg_focus,
|
|
||||||
background_color = beautiful.light_bg,
|
|
||||||
widget = wibox.widget.progressbar,
|
|
||||||
})
|
|
||||||
|
|
||||||
awesome.connect_signal("evil::battery", function(value)
|
|
||||||
battery_bar.value = value
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Osd
|
|
||||||
-- ===================================================================
|
|
||||||
local slider = wibox.widget({
|
|
||||||
widget = wibox.widget.progressbar,
|
|
||||||
max_value = 100,
|
|
||||||
forced_width = dpi(380),
|
|
||||||
forced_height = dpi(10),
|
|
||||||
shape = gears.shape.rounded_bar,
|
|
||||||
bar_shape = gears.shape.rounded_bar,
|
|
||||||
background_color = beautiful.light_bg,
|
|
||||||
color = beautiful.bg_focus,
|
|
||||||
})
|
|
||||||
|
|
||||||
local icon_widget = wibox.widget({
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
font = beautiful.icon_font_name .. "15",
|
|
||||||
forced_width = dpi(30),
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
})
|
|
||||||
|
|
||||||
local text = wibox.widget({
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
halign = "center",
|
|
||||||
})
|
|
||||||
|
|
||||||
local info = wibox.widget({
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(20),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
fill_space = true,
|
|
||||||
spacing = dpi(8),
|
|
||||||
icon_widget,
|
|
||||||
{
|
|
||||||
widget = wibox.container.background,
|
|
||||||
forced_width = dpi(36),
|
|
||||||
text,
|
|
||||||
},
|
|
||||||
slider,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local osd = awful.popup({
|
|
||||||
shape = helpers.rrect(beautiful.border_radius),
|
|
||||||
visible = false,
|
|
||||||
ontop = true,
|
|
||||||
border_width = beautiful.widget_border_width,
|
|
||||||
border_color = beautiful.widget_border_color,
|
|
||||||
minimum_height = dpi(60),
|
|
||||||
maximum_height = dpi(60),
|
|
||||||
minimum_width = dpi(290),
|
|
||||||
maximum_width = dpi(290),
|
|
||||||
placement = function(c)
|
|
||||||
awful.placement.bottom(c, { margins = dpi(20) + beautiful.border_width * 2 })
|
|
||||||
end,
|
|
||||||
widget = info,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- volume
|
|
||||||
awesome.connect_signal("evil::volume", function(volume, muted, icon)
|
|
||||||
slider.value = volume
|
|
||||||
text.text = volume
|
|
||||||
icon_widget.text = icon
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- bright
|
|
||||||
awesome.connect_signal("evil::brightness", function(value)
|
|
||||||
slider.value = value
|
|
||||||
text.text = value
|
|
||||||
icon_widget.text = ""
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- function
|
|
||||||
local function osd_hide()
|
|
||||||
osd.visible = false
|
|
||||||
osd_timer:stop()
|
|
||||||
end
|
|
||||||
|
|
||||||
local osd_timer = gears.timer({
|
|
||||||
timeout = 3,
|
|
||||||
callback = osd_hide,
|
|
||||||
})
|
|
||||||
|
|
||||||
local function osd_toggle()
|
|
||||||
if not osd.visible then
|
|
||||||
osd.visible = true
|
|
||||||
osd_timer:start()
|
|
||||||
else
|
|
||||||
osd_timer:again()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
awesome.connect_signal("summon::osd", function()
|
|
||||||
osd_toggle()
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- ░█░█░▀█▀░█▀▄░█▀█░█▀▄
|
|
||||||
-- ░█▄█░░█░░█▀▄░█▀█░█▀▄
|
|
||||||
-- ░▀░▀░▀▀▀░▀▀░░▀░▀░▀░▀
|
|
||||||
-- Create a wibox for each screen and add it
|
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
|
||||||
-- Create a promptbox for each screen
|
|
||||||
s.mypromptbox = awful.widget.prompt({ prompt = " Run: ", fg = beautiful.wibar_fg })
|
|
||||||
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
|
||||||
-- We need one layoutbox per screen.
|
|
||||||
s.mylayoutbox = {
|
|
||||||
widget = wibox.container.place,
|
|
||||||
awful.widget.layoutbox({
|
|
||||||
screen = s,
|
|
||||||
resize = true,
|
|
||||||
forced_width = dpi(15),
|
|
||||||
forced_height = dpi(15),
|
|
||||||
widget = wibox.container.place,
|
|
||||||
-- Add buttons, allowing you to change the layout
|
|
||||||
buttons = {
|
|
||||||
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
|
|
||||||
-- Helper function that updates a taglist item
|
|
||||||
local update_taglist = function(self, tag, index)
|
|
||||||
local tagBox = self:get_children_by_id("underline")[1]
|
|
||||||
local tagName = self:get_children_by_id("index_role")[1]
|
|
||||||
if tag.selected then
|
|
||||||
tagName.markup = helpers.colorize_text(
|
|
||||||
beautiful.taglist_text_focused[index],
|
|
||||||
beautiful.taglist_text_color_focused[index]
|
|
||||||
)
|
|
||||||
tagBox.bg = beautiful.taglist_text_color_occupied[index]
|
|
||||||
elseif tag.urgent then
|
|
||||||
tagName.markup =
|
|
||||||
helpers.colorize_text(beautiful.taglist_text_urgent[index], beautiful.taglist_text_color_urgent[index])
|
|
||||||
tagBox.bg = beautiful.wibar_bg
|
|
||||||
elseif #tag:clients() > 0 then
|
|
||||||
tagName.markup = helpers.colorize_text(
|
|
||||||
beautiful.taglist_text_occupied[index],
|
|
||||||
beautiful.taglist_text_color_occupied[index]
|
|
||||||
)
|
|
||||||
tagBox.bg = beautiful.wibar_bg
|
|
||||||
else
|
|
||||||
tagName.markup =
|
|
||||||
helpers.colorize_text(beautiful.taglist_text_empty[index], beautiful.taglist_text_color_empty[index])
|
|
||||||
tagBox.bg = beautiful.wibar_bg
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
s.mytaglist = awful.widget.taglist({
|
|
||||||
screen = s,
|
|
||||||
filter = awful.widget.taglist.filter.all,
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
buttons = keys.taglist_buttons,
|
|
||||||
widget_template = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "index_role",
|
|
||||||
font = beautiful.taglist_text_font,
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
forced_width = dpi(24),
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
top = dpi(0),
|
|
||||||
right = dpi(4),
|
|
||||||
bottom = dpi(-1),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
top = dpi(0),
|
|
||||||
bottom = dpi(3),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
id = "underline",
|
|
||||||
bg = beautiful.wibar_bg,
|
|
||||||
shape = gears.shape.rectangle,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
right = dpi(4),
|
|
||||||
},
|
|
||||||
id = "background_role",
|
|
||||||
widget = wibox.container.background,
|
|
||||||
shape = gears.shape.rectangle,
|
|
||||||
create_callback = update_taglist,
|
|
||||||
update_callback = update_taglist,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Create a tasklist widget
|
|
||||||
s.mytasklist = awful.widget.tasklist({
|
|
||||||
screen = s,
|
|
||||||
filter = awful.widget.tasklist.filter.currenttags,
|
|
||||||
buttons = keys.tasklist_buttons,
|
|
||||||
style = {
|
|
||||||
font = beautiful.tasklist_font,
|
|
||||||
bg = beautiful.tasklist_bg_normal,
|
|
||||||
},
|
|
||||||
layout = {
|
|
||||||
spacing = dpi(4),
|
|
||||||
-- layout = wibox.layout.fixed.horizontal
|
|
||||||
layout = wibox.layout.flex.horizontal,
|
|
||||||
},
|
|
||||||
widget_template = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "icon_role",
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
},
|
|
||||||
margins = dpi(2),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id = "text_role",
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
forced_width = dpi(220),
|
|
||||||
left = dpi(10),
|
|
||||||
right = dpi(10),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
},
|
|
||||||
-- border_width = dpi(2),
|
|
||||||
-- shape = gears.shape.rounded_bar,
|
|
||||||
-- id = "bg_role",
|
|
||||||
id = "background_role",
|
|
||||||
widget = wibox.container.background,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Create a system tray widget
|
|
||||||
s.systray = wibox.widget.systray()
|
|
||||||
s.systray.visible = true -- can be toggled by a keybind
|
|
||||||
|
|
||||||
-- Create the wibox
|
|
||||||
s.mywibox = awful.wibar({
|
|
||||||
position = beautiful.wibar_position,
|
|
||||||
screen = s,
|
|
||||||
type = "dock",
|
|
||||||
width = beautiful.wibar_width,
|
|
||||||
height = beautiful.wibar_height,
|
|
||||||
shape = helpers.rrect(beautiful.wibar_border_radius),
|
|
||||||
})
|
|
||||||
|
|
||||||
s.mywibox:setup({
|
|
||||||
{
|
|
||||||
{
|
|
||||||
s.mytaglist,
|
|
||||||
s.mytasklist,
|
|
||||||
align = "left",
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
s.mypromptbox,
|
|
||||||
playerctl_widget,
|
|
||||||
-- volume_bar,
|
|
||||||
-- battery_bar,
|
|
||||||
align = "center",
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
weather_widget,
|
|
||||||
memory_widget,
|
|
||||||
cpu_widget,
|
|
||||||
clock_widget,
|
|
||||||
s.systray,
|
|
||||||
s.mylayoutbox,
|
|
||||||
align = "right",
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
},
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
},
|
|
||||||
top = dpi(3),
|
|
||||||
bottom = dpi(3),
|
|
||||||
left = dpi(3),
|
|
||||||
right = dpi(3),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Place bar at the top and add margins
|
|
||||||
awful.placement.top(s.mywibox, { margins = beautiful.screen_margin * 0 }) -- No margin
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- ░█▀█░█▀█░▀█▀░▀█▀░█▀█░█▀█░█▀▀
|
|
||||||
-- ░█░█░█▀▀░░█░░░█░░█░█░█░█░▀▀█
|
|
||||||
-- ░▀▀▀░▀░░░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀
|
|
||||||
|
|
||||||
-- Notification settings
|
|
||||||
-- ===================================================================
|
|
||||||
-- Handle notification icon
|
|
||||||
naughty.connect_signal("request::icon", function(n, context, hints)
|
|
||||||
-- Handle other contexts here
|
|
||||||
if context ~= "app_icon" then
|
|
||||||
n.icon = beautiful.awesome_icon
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Use XDG icon
|
|
||||||
local path = menubar.utils.lookup_icon(hints.app_icon) or menubar.utils.lookup_icon(hints.app_icon:lower())
|
|
||||||
|
|
||||||
if path then
|
|
||||||
n.icon = path
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
naughty.connect_signal("request::display", function(n)
|
|
||||||
naughty.layout.box({
|
|
||||||
notification = n,
|
|
||||||
type = "notification",
|
|
||||||
cursor = "hand1",
|
|
||||||
shape = beautiful.notification_shape,
|
|
||||||
maximum_width = beautiful.notification_max_width,
|
|
||||||
maximum_height = beautiful.notification_max_height,
|
|
||||||
widget_template = {
|
|
||||||
widget = wibox.container.constraint,
|
|
||||||
strategy = "max",
|
|
||||||
{
|
|
||||||
widget = naughty.container.background,
|
|
||||||
id = "background_role",
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
margins = dpi(10),
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
spacing = dpi(20),
|
|
||||||
fill_space = true,
|
|
||||||
{
|
|
||||||
widget = wibox.container.place,
|
|
||||||
{
|
|
||||||
widget = wibox.container.background,
|
|
||||||
shape = gears.shape.circle,
|
|
||||||
naughty.widget.icon,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
spacing = dpi(10),
|
|
||||||
naughty.widget.title,
|
|
||||||
naughty.widget.message,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Titlebar
|
|
||||||
-- ===================================================================
|
|
||||||
client.connect_signal("request::titlebars", function(c)
|
|
||||||
local titlebar = awful.titlebar(c, {
|
|
||||||
position = beautiful.titlebar_position,
|
|
||||||
size = beautiful.titlebar_size,
|
|
||||||
})
|
|
||||||
|
|
||||||
local buttons = gears.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)
|
|
||||||
)
|
|
||||||
|
|
||||||
titlebar.widget = {
|
|
||||||
layout = wibox.layout.flex.horizontal,
|
|
||||||
-- {
|
|
||||||
-- widget = wibox.container.place,
|
|
||||||
-- align = "left",
|
|
||||||
-- {
|
|
||||||
-- widget = wibox.container.margin,
|
|
||||||
-- margins = { left = dpi(10), right = dpi(10) top = dpi(8), bottom = dpi(8) },
|
|
||||||
-- {
|
|
||||||
-- layout = wibox.layout.fixed.horizontal,
|
|
||||||
-- spacing = 8,
|
|
||||||
-- awful.titlebar.widget.maximizedbutton(c),
|
|
||||||
-- awful.titlebar.widget.minimizebutton(c),
|
|
||||||
-- awful.titlebar.widget.closebutton(c),
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
{
|
|
||||||
widget = wibox.container.background,
|
|
||||||
buttons = buttons,
|
|
||||||
{
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
left = dpi(10),
|
|
||||||
right = dpi(10),
|
|
||||||
{
|
|
||||||
widget = wibox.container.constraint,
|
|
||||||
width = dpi(100),
|
|
||||||
{
|
|
||||||
align = beautiful.titlebar_title_align,
|
|
||||||
widget = awful.titlebar.widget.titlewidget(c),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Startup apps
|
|
||||||
-- ===================================================================
|
|
||||||
-- awful.spawn.once({},false)
|
|
||||||
-- With shell
|
|
||||||
-- awful.spawn.with_shell({}, false)
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,309 +0,0 @@
|
|||||||
-- ░▀█▀░█░█░█▀▀░█▄█░█▀▀
|
|
||||||
-- ░░█░░█▀█░█▀▀░█░█░█▀▀
|
|
||||||
-- ░░▀░░▀░▀░▀▀▀░▀░▀░▀▀▀
|
|
||||||
|
|
||||||
local theme_assets = require("beautiful.theme_assets")
|
|
||||||
local xresources = require("beautiful.xresources")
|
|
||||||
local dpi = xresources.apply_dpi
|
|
||||||
local xrdb = xresources.get_current_theme()
|
|
||||||
local gears = require("gears")
|
|
||||||
local gfs = require("gears.filesystem")
|
|
||||||
local helpers = require("helpers")
|
|
||||||
local rnotification = require("ruled.notification")
|
|
||||||
local themes_path = gfs.get_themes_dir()
|
|
||||||
local theme = {}
|
|
||||||
|
|
||||||
-- Default wallpaper
|
|
||||||
theme.wallpaper = os.getenv("HOME") .. "/Pictures/wall.png"
|
|
||||||
|
|
||||||
-- ░█▀▀░█▀█░█▀█░▀█▀░█▀▀
|
|
||||||
-- ░█▀▀░█░█░█░█░░█░░▀▀█
|
|
||||||
-- ░▀░░░▀▀▀░▀░▀░░▀░░▀▀▀
|
|
||||||
|
|
||||||
theme.font_name = "monospace "
|
|
||||||
theme.font = theme.font_name .. "10"
|
|
||||||
theme.wibar_font = theme.font_name .. "Bold 10"
|
|
||||||
theme.icon_font_name = "monospace "
|
|
||||||
theme.wibar_icon_font = theme.font_name .. "12"
|
|
||||||
|
|
||||||
-- ░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀
|
|
||||||
-- ░█░░░█░█░█░░░█░█░█▀▄░▀▀█
|
|
||||||
-- ░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀
|
|
||||||
|
|
||||||
-- Colors
|
|
||||||
theme.black = xrdb.color0
|
|
||||||
theme.black_alt = xrdb.color8
|
|
||||||
theme.red = xrdb.color1
|
|
||||||
theme.darkred = helpers.lighten(theme.red, -10)
|
|
||||||
theme.green = xrdb.color2
|
|
||||||
theme.darkgreen = helpers.lighten(theme.green, -10)
|
|
||||||
theme.yellow = xrdb.color3
|
|
||||||
theme.darkyellow = helpers.lighten(theme.yellow, -10)
|
|
||||||
theme.blue = xrdb.color4
|
|
||||||
theme.darkblue = helpers.lighten(theme.blue, -10)
|
|
||||||
theme.magenta = xrdb.color5
|
|
||||||
theme.darkmagenta = helpers.lighten(theme.magenta, -10)
|
|
||||||
theme.cyan = xrdb.color6
|
|
||||||
theme.darkcyan = helpers.lighten(theme.cyan, -10)
|
|
||||||
theme.white = xrdb.color7
|
|
||||||
theme.white_alt = xrdb.color15
|
|
||||||
theme.light_bg = helpers.lighten(theme.black, 5)
|
|
||||||
theme.transparent = "#00000000"
|
|
||||||
|
|
||||||
-- Background Colors
|
|
||||||
theme.bg_normal = theme.black
|
|
||||||
theme.bg_focus = theme.blue
|
|
||||||
theme.bg_urgent = theme.red
|
|
||||||
theme.bg_minimize = theme.black
|
|
||||||
|
|
||||||
-- Foreground Colors
|
|
||||||
theme.fg_normal = theme.white
|
|
||||||
theme.fg_focus = theme.black
|
|
||||||
theme.fg_urgent = theme.white
|
|
||||||
theme.fg_minimize = theme.black_alt
|
|
||||||
|
|
||||||
--- ░█░█░▀█▀░░░█▀▀░█░░░█▀▀░█▄█░█▀▀░█▀█░▀█▀░█▀▀
|
|
||||||
--- ░█░█░░█░░░░█▀▀░█░░░█▀▀░█░█░█▀▀░█░█░░█░░▀▀█
|
|
||||||
--- ░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░░▀░░▀▀▀
|
|
||||||
|
|
||||||
-- Borders
|
|
||||||
-- ===================================================================
|
|
||||||
theme.border_width = dpi(3)
|
|
||||||
theme.border_normal = theme.light_bg
|
|
||||||
theme.border_focus = theme.blue
|
|
||||||
theme.border_radius = dpi(15)
|
|
||||||
theme.widget_border_width = dpi(2)
|
|
||||||
theme.widget_border_color = theme.light_bg
|
|
||||||
|
|
||||||
-- Wibar
|
|
||||||
-- ===================================================================
|
|
||||||
theme.wibar_position = "top"
|
|
||||||
theme.wibar_height = dpi(27)
|
|
||||||
theme.wibar_width = dpi(1366)
|
|
||||||
theme.wibar_bg = theme.black
|
|
||||||
theme.wibar_fg = theme.white
|
|
||||||
theme.wibar_border_color = theme.black
|
|
||||||
theme.wibar_border_width = dpi(0)
|
|
||||||
theme.wibar_border_radius = dpi(0)
|
|
||||||
|
|
||||||
-- Taglist
|
|
||||||
-- ===================================================================
|
|
||||||
theme.taglist_text_font = theme.wibar_ico_font
|
|
||||||
theme.taglist_text_empty = { "", "", "", "", "", "", "[]=", "", "", "" }
|
|
||||||
theme.taglist_text_occupied = { "", "", "", "", "", "", "[]=", "", "", "" }
|
|
||||||
theme.taglist_text_focused = { "", "", "", "", "", "", "[]=", "", "", "" }
|
|
||||||
theme.taglist_text_urgent = { "", "", "", "", "", "", "", "", "", "" }
|
|
||||||
|
|
||||||
theme.taglist_text_color_empty = {
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
theme.black_alt,
|
|
||||||
}
|
|
||||||
theme.taglist_text_color_occupied = {
|
|
||||||
theme.blue,
|
|
||||||
theme.green,
|
|
||||||
theme.yellow,
|
|
||||||
theme.red,
|
|
||||||
theme.cyan,
|
|
||||||
theme.magenta,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
}
|
|
||||||
theme.taglist_text_color_focused = {
|
|
||||||
theme.blue,
|
|
||||||
theme.green,
|
|
||||||
theme.yellow,
|
|
||||||
theme.red,
|
|
||||||
theme.cyan,
|
|
||||||
theme.magenta,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
}
|
|
||||||
theme.taglist_text_color_urgent = {
|
|
||||||
theme.blue,
|
|
||||||
theme.green,
|
|
||||||
theme.yellow,
|
|
||||||
theme.red,
|
|
||||||
theme.cyan,
|
|
||||||
theme.magenta,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
theme.cyan,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Text Taglist (default)
|
|
||||||
theme.taglist_font = theme.wibar_font
|
|
||||||
theme.taglist_bg_focus = theme.wibar_bg
|
|
||||||
theme.taglist_fg_focus = theme.fg_focus
|
|
||||||
theme.taglist_bg_occupied = theme.wibar_bg
|
|
||||||
theme.taglist_fg_occupied = theme.fg_normal
|
|
||||||
theme.taglist_bg_empty = theme.wibar_bg
|
|
||||||
theme.taglist_fg_empty = theme.black_alt
|
|
||||||
theme.taglist_bg_urgent = theme.wibar_bg
|
|
||||||
theme.taglist_fg_urgent = theme.fg_urgent
|
|
||||||
theme.taglist_disable_icon = true
|
|
||||||
theme.taglist_spacing = dpi(0)
|
|
||||||
local taglist_square_size = dpi(0)
|
|
||||||
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(taglist_square_size, theme.fg_focus)
|
|
||||||
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(taglist_square_size, theme.fg_normal)
|
|
||||||
|
|
||||||
-- Tasklist
|
|
||||||
-- ===================================================================
|
|
||||||
theme.tasklist_font = theme.font
|
|
||||||
theme.tasklist_disable_icon = false
|
|
||||||
theme.tasklist_plain_task_name = true
|
|
||||||
theme.tasklist_bg_focus = theme.wibar_bg
|
|
||||||
theme.tasklist_fg_focus = theme.fg_normal
|
|
||||||
theme.tasklist_bg_normal = theme.wibar_bg
|
|
||||||
theme.tasklist_fg_normal = theme.black_alt
|
|
||||||
theme.tasklist_bg_minimize = theme.bg_minimize
|
|
||||||
theme.tasklist_fg_minimize = theme.fg_minimize
|
|
||||||
theme.tasklist_bg_urgent = theme.bg_urgent
|
|
||||||
theme.tasklist_fg_urgent = theme.fg_urgent
|
|
||||||
theme.tasklist_align = "left"
|
|
||||||
|
|
||||||
--- Titlebar
|
|
||||||
-- ===================================================================
|
|
||||||
theme.titlebars_enabled = false
|
|
||||||
theme.titlebar_size = dpi(32)
|
|
||||||
theme.titlebar_title_enabled = true
|
|
||||||
theme.titlebar_font = theme.font
|
|
||||||
theme.titlebar_title_align = "right"
|
|
||||||
theme.titlebar_position = "top"
|
|
||||||
theme.titlebar_bg = theme.bg_normal
|
|
||||||
-- theme.titlebar_bg_focus = theme.bg_focus
|
|
||||||
-- theme.titlebar_bg_normal = theme.bg_normal
|
|
||||||
-- theme.titlebar_fg = theme.fg_normal
|
|
||||||
-- theme.titlebar_fg_focus = theme.fg_focus
|
|
||||||
-- theme.titlebar_fg_normal = theme.fg_normal
|
|
||||||
|
|
||||||
-- Menu
|
|
||||||
-- Variables set for theming the menu:
|
|
||||||
-- ===================================================================
|
|
||||||
theme.menu_height = dpi(30)
|
|
||||||
theme.menu_width = dpi(150)
|
|
||||||
theme.menu_bg_normal = theme.bg_normal
|
|
||||||
theme.menu_fg_normal = theme.fg_normal
|
|
||||||
theme.menu_bg_focus = theme.bg_focus
|
|
||||||
theme.menu_fg_focus = theme.fg_focus
|
|
||||||
theme.menu_border_width = theme.widget_border_width
|
|
||||||
theme.menu_border_color = theme.widget_border_color
|
|
||||||
|
|
||||||
-- Gaps
|
|
||||||
-- ===================================================================
|
|
||||||
theme.useless_gap = dpi(8)
|
|
||||||
theme.screen_margin = dpi(3)
|
|
||||||
|
|
||||||
-- Systray
|
|
||||||
-- ===================================================================
|
|
||||||
theme.bg_systray = theme.wibar_bg
|
|
||||||
|
|
||||||
-- Notifications
|
|
||||||
-- ===================================================================
|
|
||||||
theme.notification_font = theme.font
|
|
||||||
theme.notification_bg = theme.bg_normal
|
|
||||||
theme.notification_fg = theme.fg_normal
|
|
||||||
theme.notification_border_width = theme.widget_border_width
|
|
||||||
theme.notification_border_color = theme.widget_border_color
|
|
||||||
theme.notification_max_width = dpi(300)
|
|
||||||
theme.notification_max_height = dpi(190)
|
|
||||||
theme.notification_position = "top_right"
|
|
||||||
theme.notification_border_radius = theme.border_radius
|
|
||||||
theme.notification_spacing = theme.screen_margin * 2
|
|
||||||
theme.notification_shape = helpers.rrect(theme.notification_border_radius)
|
|
||||||
|
|
||||||
-- Set different colors for notifications.
|
|
||||||
rnotification.connect_signal("request::rules", function()
|
|
||||||
rnotification.append_rule({
|
|
||||||
rule = { urgency = "critical" },
|
|
||||||
properties = {
|
|
||||||
implicit_timeout = 4,
|
|
||||||
bg = theme.bg_urgent,
|
|
||||||
fg = theme.fg_urgent,
|
|
||||||
font = theme.notification_font,
|
|
||||||
position = theme.notification_position,
|
|
||||||
border_color = theme.notification_border_color,
|
|
||||||
margin = theme.notification_margin,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
rnotification.append_rule({
|
|
||||||
rule = { urgency = "normal" },
|
|
||||||
properties = {
|
|
||||||
implicit_timeout = 4,
|
|
||||||
bg = theme.bg_normal,
|
|
||||||
fg = theme.fg_normal,
|
|
||||||
font = theme.notification_font,
|
|
||||||
position = theme.notification_position,
|
|
||||||
border_color = theme.notification_border_color,
|
|
||||||
margin = theme.notification_margin,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
rnotification.append_rule({
|
|
||||||
rule = { urgency = "low" },
|
|
||||||
properties = {
|
|
||||||
implicit_timeout = 4,
|
|
||||||
bg = theme.bg_normal,
|
|
||||||
fg = theme.fg_normal,
|
|
||||||
font = theme.notification_font,
|
|
||||||
position = theme.notification_position,
|
|
||||||
border_color = theme.notification_border_color,
|
|
||||||
margin = theme.notification_margin,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Layout icons
|
|
||||||
-- ===================================================================
|
|
||||||
theme.layout_max = themes_path .. "default/layouts/maxw.png"
|
|
||||||
theme.layout_tile = themes_path .. "default/layouts/tilew.png"
|
|
||||||
theme.layout_floating = themes_path .. "default/layouts/floatingw.png"
|
|
||||||
-- not in use layouts
|
|
||||||
theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png"
|
|
||||||
theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png"
|
|
||||||
theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png"
|
|
||||||
theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png"
|
|
||||||
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"
|
|
||||||
theme.layout_fairv = themes_path .. "default/layouts/fairvw.png"
|
|
||||||
theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png"
|
|
||||||
theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png"
|
|
||||||
theme.layout_spiral = themes_path .. "default/layouts/spiralw.png"
|
|
||||||
theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png"
|
|
||||||
theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png"
|
|
||||||
theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png"
|
|
||||||
theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png"
|
|
||||||
-- Recolor layout icons
|
|
||||||
theme = theme_assets.recolor_layout(theme, theme.red)
|
|
||||||
-- Layoutlist
|
|
||||||
theme.layoutlist_shape_selected = gears.shape.rounded_rect
|
|
||||||
theme.layoutlist_bg_selected = theme.bg_focus
|
|
||||||
|
|
||||||
-- Misc
|
|
||||||
-- ===================================================================
|
|
||||||
-- Edge snap
|
|
||||||
theme.snap_bg = theme.light_bg
|
|
||||||
theme.snap_shape = helpers.rrect(theme.border_radius)
|
|
||||||
theme.snap_border_width = theme.widget_border_width
|
|
||||||
|
|
||||||
-- Hotkeys popup
|
|
||||||
theme.hotkeys_modifiers_fg = theme.blue
|
|
||||||
|
|
||||||
-- Generate Awesome icon:
|
|
||||||
theme.awesome_icon = theme_assets.awesome_icon(theme.menu_height, theme.bg_focus, theme.fg_focus)
|
|
||||||
-- Define the icon theme for application icons. If not set then the icons
|
|
||||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
|
||||||
theme.icon_theme = nil
|
|
||||||
|
|
||||||
return theme
|
|
||||||
-- EOF ------------------------------------------------------------------------
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
{ inputs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.catppuccin.homeManagerModules.catppuccin
|
|
||||||
];
|
|
||||||
|
|
||||||
catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
accent = "rosewater";
|
|
||||||
flavor = "latte";
|
|
||||||
|
|
||||||
pointerCursor.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
accent = "rosewater";
|
|
||||||
flavor = "latte";
|
|
||||||
gnomeShellTheme = true;
|
|
||||||
|
|
||||||
icon = {
|
|
||||||
enable = true;
|
|
||||||
accent = "rosewater";
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.kitty.catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.neovim.catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.starship.catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.zsh.syntaxHighlighting.catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
|
|
||||||
qt.style.catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
accent = "rosewater";
|
|
||||||
apply = true;
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -8,16 +8,16 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
# GTK theming
|
# GTK theming
|
||||||
gtk.enable = true;
|
#gtk.enable = true;
|
||||||
|
|
||||||
gtk.iconTheme.package = pkgs.gruvbox-plus-icons;
|
#gtk.iconTheme.package = pkgs.gruvbox-plus-icons;
|
||||||
gtk.iconTheme.name = "Gruvbox-Plus-Dark";
|
#gtk.iconTheme.name = "Gruvbox-Plus-Dark";
|
||||||
|
|
||||||
# Qt theming
|
# Qt theming
|
||||||
qt.enable = true;
|
#qt.enable = true;
|
||||||
qt.platformTheme = "gtk";
|
#qt.platformTheme = "gtk";
|
||||||
qt.style.name = "adwaita-dark";
|
#qt.style.name = "adwaita-dark";
|
||||||
qt.style.package = pkgs.adwaita-qt;
|
#qt.style.package = pkgs.adwaita-qt;
|
||||||
|
|
||||||
programs.yazi.enable = true;
|
programs.yazi.enable = true;
|
||||||
|
|
||||||
|
|||||||
@ -1,243 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
|
||||||
# plugins = inputs.hyprland-plugins.packages.${pkgs.system};
|
|
||||||
|
|
||||||
yt = pkgs.writeShellScript "yt" ''
|
|
||||||
notify-send "Opening video" "$(wl-paste)"
|
|
||||||
mpv "$(wl-paste)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
|
||||||
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
|
||||||
pactl = "${pkgs.pulseaudio}/bin/pactl";
|
|
||||||
in {
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./eww
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.desktopEntries."org.gnome.Settings" = {
|
|
||||||
name = "Settings";
|
|
||||||
comment = "Gnome Control Center";
|
|
||||||
icon = "org.gnome.Settings";
|
|
||||||
exec = "env XDG_CURRENT_DESKTOP=gnome ${pkgs.gnome.gnome-control-center}/bin/gnome-control-center";
|
|
||||||
categories = ["X-Preferences"];
|
|
||||||
terminal = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
package = hyprland;
|
|
||||||
systemd.enable = true;
|
|
||||||
xwayland.enable = true;
|
|
||||||
plugins = [
|
|
||||||
# inputs.hyprland-hyprspace.packages.${pkgs.system}.default
|
|
||||||
# plugins.hyprexpo
|
|
||||||
# plugins.hyprbars
|
|
||||||
# plugins.borderspp
|
|
||||||
];
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
exec-once = [
|
|
||||||
];
|
|
||||||
|
|
||||||
monitor = [
|
|
||||||
"eDP-1, preferred, auto-right, 1"
|
|
||||||
"HDMI-A-2, preferrred, auto-left, 1"
|
|
||||||
];
|
|
||||||
|
|
||||||
general = {
|
|
||||||
layout = "dwindle";
|
|
||||||
resize_on_border = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
misc = {
|
|
||||||
disable_splash_rendering = true;
|
|
||||||
force_default_wallpaper = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
input = {
|
|
||||||
kb_layout = "us";
|
|
||||||
follow_mouse = 1;
|
|
||||||
touchpad = {
|
|
||||||
natural_scroll = "yes";
|
|
||||||
disable_while_typing = true;
|
|
||||||
drag_lock = true;
|
|
||||||
};
|
|
||||||
sensitivity = 0;
|
|
||||||
float_switch_override_focus = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
binds = {
|
|
||||||
allow_workspace_cycles = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
dwindle = {
|
|
||||||
pseudotile = "yes";
|
|
||||||
preserve_split = "yes";
|
|
||||||
# no_gaps_when_only = "yes";
|
|
||||||
};
|
|
||||||
|
|
||||||
gestures = {
|
|
||||||
workspace_swipe = true;
|
|
||||||
workspace_swipe_use_r = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
windowrule = let
|
|
||||||
f = regex: "float, ^(${regex})$";
|
|
||||||
in [
|
|
||||||
(f "org.gnome.Calculator")
|
|
||||||
(f "org.gnome.Nautilus")
|
|
||||||
(f "pavucontrol")
|
|
||||||
(f "nm-connection-editor")
|
|
||||||
(f "blueberry.py")
|
|
||||||
(f "org.gnome.Settings")
|
|
||||||
(f "org.gnome.design.Palette")
|
|
||||||
(f "Color Picker")
|
|
||||||
(f "xdg-desktop-portal")
|
|
||||||
(f "xdg-desktop-portal-gnome")
|
|
||||||
(f "de.haeckerfelix.Fragments")
|
|
||||||
(f "com.github.Aylur.ags")
|
|
||||||
"workspace 7, title:Spotify"
|
|
||||||
];
|
|
||||||
|
|
||||||
bind = let
|
|
||||||
binding = mod: cmd: key: arg: "${mod}, ${key}, ${cmd}, ${arg}";
|
|
||||||
mvfocus = binding "SUPER" "movefocus";
|
|
||||||
ws = binding "SUPER" "workspace";
|
|
||||||
resizeactive = binding "SUPER CTRL" "resizeactive";
|
|
||||||
mvactive = binding "SUPER ALT" "moveactive";
|
|
||||||
mvtows = binding "SUPER SHIFT" "movetoworkspace";
|
|
||||||
e = "exec, ags -b hypr";
|
|
||||||
arr = [1 2 3 4 5 6 7];
|
|
||||||
in
|
|
||||||
[
|
|
||||||
"CTRL SHIFT, R, ${e} quit; ags -b hypr"
|
|
||||||
"SUPER, R, ${e} -t launcher"
|
|
||||||
"SUPER, Tab, ${e} -t overview"
|
|
||||||
",XF86PowerOff, ${e} -r 'powermenu.shutdown()'"
|
|
||||||
",XF86Launch4, ${e} -r 'recorder.start()'"
|
|
||||||
",Print, ${e} -r 'recorder.screenshot()'"
|
|
||||||
"SHIFT,Print, ${e} -r 'recorder.screenshot(true)'"
|
|
||||||
"SUPER, Return, exec, xterm" # xterm is a symlink, not actually xterm
|
|
||||||
"SUPER, W, exec, firefox"
|
|
||||||
"SUPER, E, exec, wezterm -e lf"
|
|
||||||
|
|
||||||
# youtube
|
|
||||||
", XF86Launch1, exec, ${yt}"
|
|
||||||
|
|
||||||
"ALT, Tab, focuscurrentorlast"
|
|
||||||
"CTRL ALT, Delete, exit"
|
|
||||||
"ALT, Q, killactive"
|
|
||||||
"SUPER, F, togglefloating"
|
|
||||||
"SUPER, G, fullscreen"
|
|
||||||
"SUPER, O, fakefullscreen"
|
|
||||||
"SUPER, P, togglesplit"
|
|
||||||
|
|
||||||
(mvfocus "k" "u")
|
|
||||||
(mvfocus "j" "d")
|
|
||||||
(mvfocus "l" "r")
|
|
||||||
(mvfocus "h" "l")
|
|
||||||
(ws "left" "e-1")
|
|
||||||
(ws "right" "e+1")
|
|
||||||
(mvtows "left" "e-1")
|
|
||||||
(mvtows "right" "e+1")
|
|
||||||
(resizeactive "k" "0 -20")
|
|
||||||
(resizeactive "j" "0 20")
|
|
||||||
(resizeactive "l" "20 0")
|
|
||||||
(resizeactive "h" "-20 0")
|
|
||||||
(mvactive "k" "0 -20")
|
|
||||||
(mvactive "j" "0 20")
|
|
||||||
(mvactive "l" "20 0")
|
|
||||||
(mvactive "h" "-20 0")
|
|
||||||
]
|
|
||||||
++ (map (i: ws (toString i) (toString i)) arr)
|
|
||||||
++ (map (i: mvtows (toString i) (toString i)) arr);
|
|
||||||
|
|
||||||
bindle = [
|
|
||||||
",XF86MonBrightnessUp, exec, ${brightnessctl} set +5%"
|
|
||||||
",XF86MonBrightnessDown, exec, ${brightnessctl} set 5%-"
|
|
||||||
",XF86KbdBrightnessUp, exec, ${brightnessctl} -d asus::kbd_backlight set +1"
|
|
||||||
",XF86KbdBrightnessDown, exec, ${brightnessctl} -d asus::kbd_backlight set 1-"
|
|
||||||
",XF86AudioRaiseVolume, exec, ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"
|
|
||||||
",XF86AudioLowerVolume, exec, ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindl = [
|
|
||||||
",XF86AudioPlay, exec, ${playerctl} play-pause"
|
|
||||||
",XF86AudioStop, exec, ${playerctl} pause"
|
|
||||||
",XF86AudioPause, exec, ${playerctl} pause"
|
|
||||||
",XF86AudioPrev, exec, ${playerctl} previous"
|
|
||||||
",XF86AudioNext, exec, ${playerctl} next"
|
|
||||||
",XF86AudioMicMute, exec, ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"
|
|
||||||
];
|
|
||||||
|
|
||||||
bindm = [
|
|
||||||
"SUPER, mouse:273, resizewindow"
|
|
||||||
"SUPER, mouse:272, movewindow"
|
|
||||||
];
|
|
||||||
|
|
||||||
decoration = {
|
|
||||||
drop_shadow = "yes";
|
|
||||||
shadow_range = 8;
|
|
||||||
shadow_render_power = 2;
|
|
||||||
"col.shadow" = "rgba(00000044)";
|
|
||||||
|
|
||||||
dim_inactive = false;
|
|
||||||
|
|
||||||
blur = {
|
|
||||||
enabled = true;
|
|
||||||
size = 8;
|
|
||||||
passes = 3;
|
|
||||||
new_optimizations = "on";
|
|
||||||
noise = 0.01;
|
|
||||||
contrast = 0.9;
|
|
||||||
brightness = 0.8;
|
|
||||||
popups = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
animations = {
|
|
||||||
enabled = "yes";
|
|
||||||
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
|
|
||||||
animation = [
|
|
||||||
"windows, 1, 5, myBezier"
|
|
||||||
"windowsOut, 1, 7, default, popin 80%"
|
|
||||||
"border, 1, 10, default"
|
|
||||||
"fade, 1, 7, default"
|
|
||||||
"workspaces, 1, 6, default"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin = {
|
|
||||||
overview = {
|
|
||||||
centerAligned = true;
|
|
||||||
hideTopLayers = true;
|
|
||||||
hideOverlayLayers = true;
|
|
||||||
showNewWorkspace = true;
|
|
||||||
exitOnClick = true;
|
|
||||||
exitOnSwitch = true;
|
|
||||||
drawActiveWorkspace = true;
|
|
||||||
reverseSwipe = true;
|
|
||||||
};
|
|
||||||
hyprbars = {
|
|
||||||
bar_color = "rgb(2a2a2a)";
|
|
||||||
bar_height = 28;
|
|
||||||
col_text = "rgba(ffffffdd)";
|
|
||||||
bar_text_size = 11;
|
|
||||||
bar_text_font = "Ubuntu Nerd Font";
|
|
||||||
|
|
||||||
buttons = {
|
|
||||||
button_size = 0;
|
|
||||||
"col.maximize" = "rgba(ffffff11)";
|
|
||||||
"col.close" = "rgba(ff111133)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 13 KiB |
@ -1,19 +0,0 @@
|
|||||||
@mixin rounding {
|
|
||||||
border-radius: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.themes {
|
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@import "style/colors";
|
|
||||||
@import "style/bar/init";
|
|
||||||
@import "style/control/init";
|
|
||||||
@import "style/dash/init";
|
|
||||||
@import "style/moment/init";
|
|
||||||
|
|
||||||
* {
|
|
||||||
all: unset;
|
|
||||||
transition: 100ms ease;
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
(include "./yuck/_vars.yuck")
|
|
||||||
(include "./yuck/bar/_init.yuck")
|
|
||||||
(include "./yuck/control/_init.yuck")
|
|
||||||
(include "./yuck/dash/_init.yuck")
|
|
||||||
(include "./yuck/moment/_init.yuck")
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')"
|
|
||||||
|
|
||||||
|
|
||||||
toggle() {
|
|
||||||
if [[ $STATUS == "no" ]]; then
|
|
||||||
rfkill block all
|
|
||||||
notify-send --urgency=normal "Airplane Mode" "Airplane mode has been turned on!"
|
|
||||||
else
|
|
||||||
rfkill unblock all
|
|
||||||
notify-send --urgency=normal "Airplane Mode" "Airplane mode has been turned off!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
class() {
|
|
||||||
if [[ $STATUS == "no" ]]; then
|
|
||||||
echo inactive
|
|
||||||
else
|
|
||||||
echo active
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 == "--toggle" ]]; then
|
|
||||||
toggle
|
|
||||||
elif [[ $1 == "--class" ]]; then
|
|
||||||
class
|
|
||||||
fi
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
bat=/sys/class/power_supply/BAT0/
|
|
||||||
per="$(cat "$bat/capacity")"
|
|
||||||
|
|
||||||
icon() {
|
|
||||||
|
|
||||||
if [ "$per" -gt "90" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "80" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "70" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "60" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "49" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "40" ]; then
|
|
||||||
icon=""
|
|
||||||
elif [ "$per" -gt "20" ]; then
|
|
||||||
icon="assets/battery_nearly-low.png"
|
|
||||||
elif [ "$per" -gt "10" ]; then
|
|
||||||
icon="assets/battery_low.png"
|
|
||||||
notify-send -u critical "Battery Low" "Connect Charger"
|
|
||||||
elif [ "$per" -gt "0" ]; then
|
|
||||||
icon="assets/battery_low.png"
|
|
||||||
notify-send -u critical "Battery Low" "Connect Charger"
|
|
||||||
else
|
|
||||||
echo && exit
|
|
||||||
fi
|
|
||||||
echo "$icon"
|
|
||||||
}
|
|
||||||
|
|
||||||
percent() {
|
|
||||||
echo $per
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status(){
|
|
||||||
if [[ -d /sys/class/power_supply/ACAD ]]; then
|
|
||||||
echo " "
|
|
||||||
elif [[ -d /sys/class/power_supply/BAT0 ]]; then
|
|
||||||
[[ $(cat /sys/class/power_supply/BAT0/status) == "Discharging" ]] && echo "" || echo ""
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
class() {
|
|
||||||
if [ "$per" -gt "90" ]; then
|
|
||||||
class="color: #81c19b"
|
|
||||||
elif [ "$per" -gt "80" ]; then
|
|
||||||
class="color: #81c19b"
|
|
||||||
elif [ "$per" -gt "70" ]; then
|
|
||||||
class="color: #81c19b"
|
|
||||||
elif [ "$per" -gt "60" ]; then
|
|
||||||
class="color: #81c19b"
|
|
||||||
elif [ "$per" -gt "49" ]; then
|
|
||||||
class="color: #8FA7A9"
|
|
||||||
elif [ "$per" -gt "40" ]; then
|
|
||||||
class="color: #8FA7A9"
|
|
||||||
elif [ "$per" -gt "20" ]; then
|
|
||||||
class="color: #ecd28b"
|
|
||||||
elif [ "$per" -gt "10" ]; then
|
|
||||||
class="color: #df5b61"
|
|
||||||
elif [ "$per" -gt "0" ]; then
|
|
||||||
class="color: #df5b61"
|
|
||||||
else
|
|
||||||
echo "" && exit
|
|
||||||
fi
|
|
||||||
echo "$class"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ "$1" = "icon" ] && icon && exit
|
|
||||||
[ "$1" = "percent" ] && percent && exit
|
|
||||||
[ "$1" = "status" ] && status && exit
|
|
||||||
[ "$1" = "class" ] && class && exit
|
|
||||||
|
|
||||||
exit
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
toggle() {
|
|
||||||
STATUS="$(bluetoothctl show | grep Powered | awk '{print $2}')"
|
|
||||||
if [ $STATUS == "yes" ]; then
|
|
||||||
bluetoothctl power off
|
|
||||||
notify-send --icon=bluetooth-offline --urgency=normal "Bluetooth" "Bluetooth has been turned off."
|
|
||||||
else
|
|
||||||
bluetoothctl power on
|
|
||||||
notify-send --icon=volume-level-high --urgency=normal "Bluetooth" "Bluetooth has been turned on."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
class() {
|
|
||||||
# off
|
|
||||||
if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ]
|
|
||||||
then
|
|
||||||
echo inactive
|
|
||||||
else
|
|
||||||
echo active
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
status() {
|
|
||||||
# not connected
|
|
||||||
if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ]; then
|
|
||||||
echo "Off"
|
|
||||||
else
|
|
||||||
# on
|
|
||||||
if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ]; then
|
|
||||||
echo "On"
|
|
||||||
else
|
|
||||||
# get device alias
|
|
||||||
DEVICE=`echo info | bluetoothctl | grep 'Alias:' | awk -F: '{ print $2 }'`
|
|
||||||
echo "$DEVICE"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $1 == "--status" ]]; then
|
|
||||||
status
|
|
||||||
elif [[ $1 == "--icon" ]]; then
|
|
||||||
icon
|
|
||||||
elif [[ $1 == "--toggle" ]]; then
|
|
||||||
toggle
|
|
||||||
elif [[ $1 == "--class" ]]; then
|
|
||||||
class
|
|
||||||
elif [[ $1 == "--battery" ]]; then
|
|
||||||
battery
|
|
||||||
fi
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
CPU=$(cat /sys/class/thermal/thermal_zone*/temp)
|
|
||||||
TEMP=$((CPU / 1000))
|
|
||||||
echo $TEMP
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
STATUS=$(dunstctl is-paused)
|
|
||||||
|
|
||||||
toggle() {
|
|
||||||
if [ $STATUS == "false" ]; then
|
|
||||||
dunstctl set-paused true
|
|
||||||
else
|
|
||||||
dunstctl set-paused false
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class() {
|
|
||||||
if [ $STATUS == "false" ]; then
|
|
||||||
echo inactive
|
|
||||||
else
|
|
||||||
echo active
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 == "--toggle" ]]; then
|
|
||||||
toggle
|
|
||||||
elif [[ $1 == "--class" ]]; then
|
|
||||||
class
|
|
||||||
fi
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# scripts by adi1090x
|
|
||||||
|
|
||||||
## Get data
|
|
||||||
STATUS="$(mpc status)"
|
|
||||||
COVER="/tmp/.music_cover.png"
|
|
||||||
MUSIC_DIR="$HOME/Music"
|
|
||||||
|
|
||||||
## Get status
|
|
||||||
get_status() {
|
|
||||||
if [[ $STATUS == *"[playing]"* ]]; then
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Get song
|
|
||||||
get_song() {
|
|
||||||
song=`mpc -f %title% current`
|
|
||||||
if [[ -z "$song" ]]; then
|
|
||||||
echo "Offline"
|
|
||||||
else
|
|
||||||
echo "$song"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Get artist
|
|
||||||
get_artist() {
|
|
||||||
artist=`mpc -f %artist% current`
|
|
||||||
if [[ -z "$artist" ]]; then
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo "$artist"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Get time
|
|
||||||
get_time() {
|
|
||||||
time=`mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)'`
|
|
||||||
if [[ -z "$time" ]]; then
|
|
||||||
echo "0"
|
|
||||||
else
|
|
||||||
echo "$time"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
get_ctime() {
|
|
||||||
ctime=`mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g'`
|
|
||||||
if [[ -z "$ctime" ]]; then
|
|
||||||
echo "0:00"
|
|
||||||
else
|
|
||||||
echo "$ctime"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
get_ttime() {
|
|
||||||
ttime=`mpc -f %time% current`
|
|
||||||
if [[ -z "$ttime" ]]; then
|
|
||||||
echo "0:00"
|
|
||||||
else
|
|
||||||
echo "$ttime"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Get cover
|
|
||||||
get_cover() {
|
|
||||||
ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "${COVER}" -y &> /dev/null
|
|
||||||
STATUS=$?
|
|
||||||
|
|
||||||
# Check if the file has a embbeded album art
|
|
||||||
if [ "$STATUS" -eq 0 ];then
|
|
||||||
echo "$COVER"
|
|
||||||
else
|
|
||||||
echo "images/music.png"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
## Execute accordingly
|
|
||||||
if [[ "$1" == "--song" ]]; then
|
|
||||||
get_song
|
|
||||||
elif [[ "$1" == "--artist" ]]; then
|
|
||||||
get_artist
|
|
||||||
elif [[ "$1" == "--status" ]]; then
|
|
||||||
get_status
|
|
||||||
elif [[ "$1" == "--time" ]]; then
|
|
||||||
get_time
|
|
||||||
elif [[ "$1" == "--ctime" ]]; then
|
|
||||||
get_ctime
|
|
||||||
elif [[ "$1" == "--ttime" ]]; then
|
|
||||||
get_ttime
|
|
||||||
elif [[ "$1" == "--cover" ]]; then
|
|
||||||
get_cover
|
|
||||||
elif [[ "$1" == "--toggle" ]]; then
|
|
||||||
mpc -q toggle
|
|
||||||
elif [[ "$1" == "--next" ]]; then
|
|
||||||
{ mpc -q next; get_cover; }
|
|
||||||
elif [[ "$1" == "--prev" ]]; then
|
|
||||||
{ mpc -q prev; get_cover; }
|
|
||||||
fi
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
function _set_vars() {
|
|
||||||
typeset -gx DUNST_CACHE_DIR="$HOME/.cache/dunst"
|
|
||||||
typeset -gx DUNST_LOG="$DUNST_CACHE_DIR/notifications.txt"
|
|
||||||
typeset -gx DEFAULT_QUOTE="To fake it is to stand guard over emptiness. ── Arthur Herzog"
|
|
||||||
typeset -gx DUNST_QUOTES="$DUNST_CACHE_DIR/quotes.txt"
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unset_vars() {
|
|
||||||
unset DUNST_CACHE_DIR
|
|
||||||
unset DUNST_LOG
|
|
||||||
unset DUNST_QUOTES
|
|
||||||
unset DEFAULT_QUOTE
|
|
||||||
}
|
|
||||||
_set_vars
|
|
||||||
|
|
||||||
mkdir "$DUNST_CACHE_DIR" 2>/dev/null
|
|
||||||
touch "$DUNST_LOG" 2>/dev/null
|
|
||||||
|
|
||||||
function create_cache() {
|
|
||||||
local urgency
|
|
||||||
case "$DUNST_URGENCY" in
|
|
||||||
"LOW"|"NORMAL"|"CRITICAL") urgency="$DUNST_URGENCY";;
|
|
||||||
*) urgency="OTHER";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
local summary
|
|
||||||
local body
|
|
||||||
[ "$DUNST_SUMMARY" = "" ] && summary="Summary unavailable." || summary="$DUNST_SUMMARY"
|
|
||||||
[ "$DUNST_BODY" = "" ] && body="Body unavailable." || body="$(print "$DUNST_BODY" | recode html)"
|
|
||||||
|
|
||||||
local glyph
|
|
||||||
case "$urgency" in
|
|
||||||
"LOW") glyph="";;
|
|
||||||
"NORMAL") glyph=" ";;
|
|
||||||
"CRITICAL") glyph="";;
|
|
||||||
*) glyph="";;
|
|
||||||
esac
|
|
||||||
case "$DUNST_APP_NAME" in
|
|
||||||
"Spotify") glyph="";;
|
|
||||||
"mpd") glyph="";;
|
|
||||||
"picom") glyph="";;
|
|
||||||
"sxhkd") glyph="";;
|
|
||||||
"changebrightness") glyph="";;
|
|
||||||
"nightmode") glyph="";;
|
|
||||||
"microphone") glyph="";;
|
|
||||||
"changevolume") glyph="";;
|
|
||||||
"screenshot") glyph="";;
|
|
||||||
"firefox") glyph=" ";;
|
|
||||||
esac
|
|
||||||
# pipe stdout -> pipe cat stdin (cat conCATs multiple files and sends to stdout) -> absorb stdout from cat
|
|
||||||
# concat: "one" + "two" + "three" -> notice how the order matters i.e. "one" will be prepended
|
|
||||||
print '(card :width 400 :class "control-center-card control-center-card-'$urgency' control-center-card-'$DUNST_APP_NAME'" :glyph_class "control-center-'$urgency' control-center-'$DUNST_APP_NAME'" :SL "'$DUNST_ID'" :L "dunstctl history-pop '$DUNST_ID'" :body "'$body'" :summary "'$summary'" :glyph "'$glyph'")' \
|
|
||||||
| cat - "$DUNST_LOG" \
|
|
||||||
| sponge "$DUNST_LOG"
|
|
||||||
}
|
|
||||||
|
|
||||||
function compile_caches() { tr '\n' ' ' < "$DUNST_LOG" }
|
|
||||||
|
|
||||||
function make_literal() {
|
|
||||||
local caches="$(compile_caches)"
|
|
||||||
[[ "$caches" == "" ]] \
|
|
||||||
&& print '(box :class "control-center-empty-box" :width 360 :height 350 :orientation "vertical" :space-evenly false (image :class "control-center-empty-banner" :valign "center" :vexpand true :path "assets/empty-notification.svg" :image-width 200 :image-height 200) )' \
|
|
||||||
|| print "(scroll :width 360 :height 350 :vscroll true (box :hexpand true :orientation 'vertical' :class 'control-center-scroll-box' :spacing 15 :space-evenly false $caches))"
|
|
||||||
}
|
|
||||||
|
|
||||||
function clear_logs() {
|
|
||||||
killall dunst 2>/dev/null
|
|
||||||
dunst & disown
|
|
||||||
print > "$DUNST_LOG"
|
|
||||||
}
|
|
||||||
|
|
||||||
function pop() { sed -i '1d' "$DUNST_LOG" }
|
|
||||||
|
|
||||||
function drop() { sed -i '$d' "$DUNST_LOG" }
|
|
||||||
|
|
||||||
function remove_line() { sed -i '/SL "'$1'"/d' "$DUNST_LOG" }
|
|
||||||
|
|
||||||
function critical_count() {
|
|
||||||
local crits=$(cat $DUNST_LOG | grep CRITICAL | wc -l)
|
|
||||||
local total=$(cat $DUNST_LOG | wc -l)
|
|
||||||
print $(((crits*100)/total))
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribe() {
|
|
||||||
make_literal
|
|
||||||
local lines=$(cat $DUNST_LOG | wc -l)
|
|
||||||
while sleep 0.1; do
|
|
||||||
local new=$(cat $DUNST_LOG | wc -l)
|
|
||||||
[[ $lines -ne $new ]] && lines=$new && print
|
|
||||||
done | while read -r _ do; make_literal done
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
"pop") pop;;
|
|
||||||
"drop") drop;;
|
|
||||||
"clear") clear_logs;;
|
|
||||||
"subscribe") subscribe;;
|
|
||||||
"rm_id") remove_line $2;;
|
|
||||||
"crits") critical_count;;
|
|
||||||
*) create_cache;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
sed -i '/^$/d' "$DUNST_LOG"
|
|
||||||
_unset_vars
|
|
||||||
@ -1,154 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Rename This To weather.sh and add your api key
|
|
||||||
|
|
||||||
encode_to_url_format() {
|
|
||||||
echo "$1" | sed 's/ /%20/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
check_if_empty() {
|
|
||||||
[[ -z "$1" ]] && echo "0" || echo "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
KEY=""
|
|
||||||
CITY="New Delhi"
|
|
||||||
CITY=$(encode_to_url_format "$CITY")
|
|
||||||
WEATHER=$(curl -sf "api.openweathermap.org/data/2.5/weather?q=$CITY&appid=$KEY&units=metric")
|
|
||||||
|
|
||||||
WEATHER_DESC=$(echo $WEATHER | jq -r ".weather[0].main")
|
|
||||||
WEATHER_TEMP=$(echo $WEATHER | jq ".main.temp" | cut -d "." -f 1)
|
|
||||||
WEATHER_ICON_CODE=$(echo "$WEATHER" | jq -r ".weather[].icon" | head -1)
|
|
||||||
WEATHER_FEELS_LIKE=$(echo $WEATHER | jq ".main.feels_like" | cut -d "." -f 1)
|
|
||||||
WEATHER_HUMIDITY=$(echo $WEATHER | jq ".main.humidity" | cut -d "." -f 1)
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE=""
|
|
||||||
WEATHER_HEX=""
|
|
||||||
|
|
||||||
case $WEATHER_ICON_CODE in
|
|
||||||
"01d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clear-sky"
|
|
||||||
WEATHER_HEX="#ffd86b"
|
|
||||||
;;
|
|
||||||
"01n")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clear-night"
|
|
||||||
WEATHER_HEX="#fcdcf6"
|
|
||||||
;;
|
|
||||||
"02d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
"02n")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
WEATHER_IMAGE="clouds-night"
|
|
||||||
;;
|
|
||||||
"03d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
"03n")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds-night"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
"04d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
"04n")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds-night"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
"09d")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="clouds-showers-scattered"
|
|
||||||
WEATHER_HEX="#6b95ff"
|
|
||||||
;;
|
|
||||||
"09n")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="clouds-showers-scattered"
|
|
||||||
WEATHER_HEX="#6b95ff"
|
|
||||||
;;
|
|
||||||
"10d")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="clouds-showers"
|
|
||||||
WEATHER_HEX="#6b95ff"
|
|
||||||
;;
|
|
||||||
"10n")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="clouds-showers"
|
|
||||||
WEATHER_HEX="#6b95ff"
|
|
||||||
;;
|
|
||||||
"11d")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="stroms"
|
|
||||||
WEATHER_HEX="#ffeb57"
|
|
||||||
;;
|
|
||||||
"11n")
|
|
||||||
WEATHER_ICON=""
|
|
||||||
WEATHER_IMAGE="stroms"
|
|
||||||
WEATHER_HEX="#ffeb57"
|
|
||||||
;;
|
|
||||||
"13d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="snow"
|
|
||||||
WEATHER_HEX="#e3e6fc"
|
|
||||||
;;
|
|
||||||
"13n")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="snow"
|
|
||||||
WEATHER_HEX="#e3e6fc"
|
|
||||||
;;
|
|
||||||
"50d")
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="fog"
|
|
||||||
WEATHER_HEX="#84afdb"
|
|
||||||
;;
|
|
||||||
"50n")
|
|
||||||
WEATHER_IMAGE="fog"
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_HEX="#84afdb"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
WEATHER_ICON=" "
|
|
||||||
WEATHER_IMAGE="clouds"
|
|
||||||
WEATHER_HEX="#adadff"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
"current_temp")
|
|
||||||
check_if_empty $WEATHER_TEMP
|
|
||||||
;;
|
|
||||||
"current_temp_fahrenheit")
|
|
||||||
WEATHER_TEMP=$((($WEATHER_TEMP * 9 / 5) + 32))
|
|
||||||
check_if_empty $WEATHER_TEMP
|
|
||||||
;;
|
|
||||||
"feels_like")
|
|
||||||
check_if_empty $WEATHER_FEELS_LIKE
|
|
||||||
;;
|
|
||||||
"humidity")
|
|
||||||
check_if_empty $WEATHER_HUMIDITY
|
|
||||||
;;
|
|
||||||
"weather_desc")
|
|
||||||
[[ -z $WEATHER_DESC ]] && echo "Not Available." || echo "$WEATHER_DESC"
|
|
||||||
;;
|
|
||||||
"icon")
|
|
||||||
echo $WEATHER_ICON
|
|
||||||
;;
|
|
||||||
"hex")
|
|
||||||
echo $WEATHER_HEX
|
|
||||||
;;
|
|
||||||
"image")
|
|
||||||
echo $WEATHER_IMAGE
|
|
||||||
;;
|
|
||||||
"full")
|
|
||||||
echo $WEATHER
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
STATUS=$(nmcli | grep wlo1 | awk 'FNR == 1 {print $2}')
|
|
||||||
SSID=$(iwgetid | awk -F '"' '{ print $2 }')
|
|
||||||
STRENGTH=$(awk 'NR==3 {printf("%.0f",$3*10/7)}' /proc/net/wireless)
|
|
||||||
|
|
||||||
toggle() {
|
|
||||||
if [[ $STATUS == "connected" ]]; then
|
|
||||||
nmcli radio wifi off
|
|
||||||
notify-send --icon=window-close --urgency=normal "Wi-Fi" "Wi-Fi has been turned off!"
|
|
||||||
else
|
|
||||||
nmcli radio wifi on
|
|
||||||
notify-send --icon=checkmark --urgency=normal "Wi-Fi" "Wi-Fi has been turned on, you are back online!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class() {
|
|
||||||
if [[ $STATUS == "connected" ]]; then
|
|
||||||
echo active
|
|
||||||
else
|
|
||||||
echo inactive
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ssid() {
|
|
||||||
if [[ $STATUS == "connected" ]]; then
|
|
||||||
echo $(iwgetid -r)
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "n/a"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
color() {
|
|
||||||
if [[ $STATUS == "connected" ]]; then
|
|
||||||
echo "green"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "red"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
icon() {
|
|
||||||
if [[ $STATUS == "connected" ]]; then
|
|
||||||
echo " "
|
|
||||||
|
|
||||||
else
|
|
||||||
echo " "
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
speed() {
|
|
||||||
s1=$(awk 'NR==3 {print $3}''' /proc/net/wireless)
|
|
||||||
s2=${s1::-1}
|
|
||||||
echo $s2
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $1 == "--toggle" ]]; then
|
|
||||||
toggle
|
|
||||||
elif [[ $1 == "--class" ]]; then
|
|
||||||
class
|
|
||||||
elif [[ $1 == "--ssid" ]]; then
|
|
||||||
ssid
|
|
||||||
elif [[ $1 == "--color" ]]; then
|
|
||||||
color
|
|
||||||
elif [[ $1 == "--icon" ]]; then
|
|
||||||
icon
|
|
||||||
elif [[ $1 == "--speed" ]]; then
|
|
||||||
speed
|
|
||||||
fi
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
ACTIVEWS=$(hyprctl -j monitors | jq ".[0].activeWorkspace.id")
|
|
||||||
export a"$ACTIVEWS"="active"
|
|
||||||
|
|
||||||
function handle_event {
|
|
||||||
case ${1%>>*} in
|
|
||||||
workspace)
|
|
||||||
unset a"$ACTIVEWS"
|
|
||||||
ACTIVEWS=${1#*>>}
|
|
||||||
export a"$ACTIVEWS"="active"
|
|
||||||
create_taglist
|
|
||||||
;;
|
|
||||||
focusedmon)
|
|
||||||
ACTIVEWS=${1#*,}
|
|
||||||
;;
|
|
||||||
createworkspace)
|
|
||||||
local WORKSPACE=${1#*>>}
|
|
||||||
export o"$WORKSPACE"="occupied"
|
|
||||||
create_taglist
|
|
||||||
;;
|
|
||||||
destroyworkspace)
|
|
||||||
local WORKSPACE=${1#*>>}
|
|
||||||
unset o"$WORKSPACE"
|
|
||||||
create_taglist
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_taglist {
|
|
||||||
echo "[\"$o1 $a1\", \"$o2 $a2\", \"$o3 $a3\", \"$o4 $a4\", \"$o5 $a5\", \"$o6 $a6\", \"$o7 $a7\"]"
|
|
||||||
}
|
|
||||||
|
|
||||||
for NUM in {0..8}; do
|
|
||||||
WORKSPACE=$(hyprctl -j workspaces | jq ".[$NUM].id")
|
|
||||||
if [[ $WORKSPACE != "null" ]]; then
|
|
||||||
export o"$WORKSPACE"="occupied"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
create_taglist
|
|
||||||
|
|
||||||
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do
|
|
||||||
handle_event "$event"
|
|
||||||
done
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
.control {
|
|
||||||
@include rounding;
|
|
||||||
background: $background;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliders {
|
|
||||||
@include rounding;
|
|
||||||
background: $background-alt;
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.volscale trough {
|
|
||||||
min-width: 8rem;
|
|
||||||
min-height: 16px;
|
|
||||||
background: rgba($comment, 0.4);
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.volscale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.brightscale trough {
|
|
||||||
min-width: 8rem;
|
|
||||||
min-height: 16px;
|
|
||||||
background: rgba($comment, 0.4);
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.brightscale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile {
|
|
||||||
padding: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profiletime {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.music {
|
|
||||||
@include rounding;
|
|
||||||
min-height: 10rem;
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-g {
|
|
||||||
background-image: linear-gradient(to right, rgba($background, 0.95) 30%, rgba($background, 0.5));
|
|
||||||
}
|
|
||||||
|
|
||||||
.musicbutton {
|
|
||||||
font-family: "Iosevka Nerd Font";
|
|
||||||
padding: 1rem;
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.musicbuttons {
|
|
||||||
background: $background-alt;
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profileexit {
|
|
||||||
color: $red;
|
|
||||||
font-size: 28px;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 1rem 2rem 1rem 1.6rem;
|
|
||||||
background: linear-gradient(to bottom right, rgba($red, 0.05), rgba($red, 0.03));
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-scale trough {
|
|
||||||
min-width: 8rem;
|
|
||||||
min-height: 10px;
|
|
||||||
background: rgba($background-alt, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-scale trough highlight {
|
|
||||||
background: $magenta;
|
|
||||||
}
|
|
||||||
|
|
||||||
.musicinfo {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.musicname {
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setbtn {
|
|
||||||
font-family: Material Design Icons;
|
|
||||||
background: rgba($comment, 0.2);
|
|
||||||
@include rounding;
|
|
||||||
padding: 1.7rem;
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: $accent;
|
|
||||||
color: $background;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scaleicon {
|
|
||||||
font-family: Material Design Icons;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mono {
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: "Iosevka Nerd Font";
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
background: $background-alt;
|
|
||||||
padding: 16px;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
@ -1,153 +0,0 @@
|
|||||||
.dash {
|
|
||||||
background: $background;
|
|
||||||
padding: 2rem;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notifcenter {
|
|
||||||
@include rounding;
|
|
||||||
padding: 1rem;
|
|
||||||
background: rgba($background-alt, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.eon {
|
|
||||||
font-family: Rubik;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification {
|
|
||||||
font-family: Rubik;
|
|
||||||
background: rgba($background-alt, 0.6);
|
|
||||||
@include rounding;
|
|
||||||
|
|
||||||
&-close {
|
|
||||||
font-family: Material Design Icons;
|
|
||||||
color: $red;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-title {
|
|
||||||
padding: 1rem;
|
|
||||||
@include rounding;
|
|
||||||
background: $background-alt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-body {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashpfp {
|
|
||||||
min-height: 200px;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashgradient {
|
|
||||||
background-image: linear-gradient(to right, rgba($background, 0.5) 30%, rgba($background, 0.7));
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashtime {
|
|
||||||
font-family: Rubik;
|
|
||||||
background: $background-alt;
|
|
||||||
@include rounding;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timelabel {
|
|
||||||
font-family: Iosevka Nerd Font;
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timelabelu {
|
|
||||||
font-family: Rubik;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
color: $blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats {
|
|
||||||
padding: 1rem;
|
|
||||||
@include rounding;
|
|
||||||
background: rgba($background-alt, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.gridline {
|
|
||||||
background: $background-alt;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.statscale trough {
|
|
||||||
min-width: 1.5rem;
|
|
||||||
margin: .5rem 0;
|
|
||||||
min-height: 16px;
|
|
||||||
@include rounding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.magentascale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $magenta;
|
|
||||||
}
|
|
||||||
|
|
||||||
.greenscale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bluescale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.redscale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yellowscale trough highlight {
|
|
||||||
@include rounding;
|
|
||||||
background: $yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circgreen {
|
|
||||||
color: $green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circred {
|
|
||||||
color: $red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.altstat {
|
|
||||||
@include rounding;
|
|
||||||
background: rgba($background-alt, 0.8);
|
|
||||||
padding: 1rem 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tt {
|
|
||||||
font-family: Material Design Icons;
|
|
||||||
padding: 1.5rem;
|
|
||||||
font-size: 1.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clabel {
|
|
||||||
font-family: Iosevka Nerd Font;
|
|
||||||
color: $comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.dashmusic {
|
|
||||||
@include rounding;
|
|
||||||
background: rgba($background-alt, 0.8);
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashart {
|
|
||||||
@include rounding;
|
|
||||||
opacity: 0.6;
|
|
||||||
min-height: 100px;
|
|
||||||
min-width: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dmi {
|
|
||||||
margin-top: 1rem;
|
|
||||||
font-family: Rubik;
|
|
||||||
}
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
.moment {
|
|
||||||
background: $background;
|
|
||||||
padding: 1.2rem;
|
|
||||||
@include rounding;
|
|
||||||
font-family: "Rubik";
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar {
|
|
||||||
font-family: "Rubik";
|
|
||||||
|
|
||||||
&:selected {
|
|
||||||
color: $accent;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:indeterminate {
|
|
||||||
color: rgba(205, 219, 249, 0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.bgblue {
|
|
||||||
background: $blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgred {
|
|
||||||
background: $red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgpink {
|
|
||||||
background: $magenta;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moment_calendar {
|
|
||||||
background-color: $background-alt;
|
|
||||||
@include rounding;
|
|
||||||
border-radius: 10px;
|
|
||||||
|
|
||||||
.moment_cal-box {
|
|
||||||
padding: 0 1rem;
|
|
||||||
background-color: $background-alt;
|
|
||||||
@include rounding;
|
|
||||||
border-radius: inherit;
|
|
||||||
|
|
||||||
margin: 0.4em;
|
|
||||||
|
|
||||||
|
|
||||||
.moment_day-names {
|
|
||||||
font-family: "Rubik";
|
|
||||||
margin: 0.1em 0.5em 0.5em;
|
|
||||||
font-size: 16px;
|
|
||||||
color: $red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moment_cal {
|
|
||||||
font-size: 17px;
|
|
||||||
padding: 1em .6em 0.3em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.m {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 1.3rem;
|
|
||||||
color: $blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moment_month-year {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 1.3rem;
|
|
||||||
color: $foreground;
|
|
||||||
margin: 1rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moment_up {
|
|
||||||
padding: 18px;
|
|
||||||
background: $background;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mo {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.woverlay {
|
|
||||||
background: linear-gradient(to right, rgba($background, 0.94), rgba($background-alt, 0.86));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.wicon {
|
|
||||||
font-size: 4.3rem;
|
|
||||||
color: $foreground;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wdesc {
|
|
||||||
font-family: "Rubik";
|
|
||||||
font-size: 1.4rem;
|
|
||||||
color: $foreground;
|
|
||||||
}
|
|
||||||
|
|
||||||
.weatherimage {
|
|
||||||
min-height: 150px;
|
|
||||||
min-width: 400px;
|
|
||||||
@include rounding;
|
|
||||||
background-position: bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ok {
|
|
||||||
padding: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wtemp {
|
|
||||||
font-size: 2.3em;
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
(defpoll hour :interval "1s" `date +%H`)
|
|
||||||
(defpoll minute :interval "1s" `date +%M`)
|
|
||||||
(defpoll day :interval "1s" `date "+%A"`)
|
|
||||||
(defpoll ampm :interval "1s" `date "+%p"`)
|
|
||||||
(defpoll date :interval "1s" `date "+%D"`)
|
|
||||||
(defpoll month_year :interval "24h"
|
|
||||||
"date '+%B %Y'")
|
|
||||||
(defpoll calendar_day :interval "10h"
|
|
||||||
"date '+%d'")
|
|
||||||
(defpoll calendar_year :interval "10h"
|
|
||||||
"date '+%Y'")
|
|
||||||
(defpoll thourtime :interval "40s" `date +"%a %I:%M %p"`)
|
|
||||||
|
|
||||||
;; SYSTEM VARS
|
|
||||||
(defpoll volume :interval "1s" `pamixer --get-volume`)
|
|
||||||
(defpoll brightness :interval "1s" `brightnessctl -m -d amdgpu_bl0 | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'`)
|
|
||||||
|
|
||||||
(defvar pfp "/home/namish/.config/eww/assets/pfp.png")
|
|
||||||
(defvar fullpfp "/home/namish/.config/eww/assets/fullpfp.png")
|
|
||||||
|
|
||||||
(defpoll cputemp :interval "1s" "~/.config/eww/scripts/cpu.sh")
|
|
||||||
(defpoll wifisped :interval "1s" "~/.config/eww/scripts/wifi.sh --speed")
|
|
||||||
|
|
||||||
(defpoll battery :interval "1s" `~/.config/eww/scripts/bat.sh percent`)
|
|
||||||
(defpoll wifiConnected :interval "2s" `~/.config/eww/scripts/wifi.sh --icon`)
|
|
||||||
|
|
||||||
(defpoll song :interval "2s" "~/.config/eww/scripts/ms.sh --song")
|
|
||||||
(defpoll song_artist :interval "2s" "~/.config/eww/scripts/ms.sh --artist")
|
|
||||||
(defpoll current_status :interval "1s" "~/.config/eww/scripts/ms.sh --time")
|
|
||||||
(defpoll song_status :interval "1s" "~/.config/eww/scripts/ms.sh --status")
|
|
||||||
(defpoll cover_art :interval "2s" "~/.config/eww/scripts/ms.sh --cover")
|
|
||||||
|
|
||||||
(defpoll username :interval "48h" "whoami")
|
|
||||||
(defpoll hostname :interval "48h" "hostname")
|
|
||||||
(defpoll uptime :interval "1m" "uptime -p | sed -e 's/up //;s/ hours,/h/;s/ hour,/h/;s/ minutes/m/;s/ minute/m/'")
|
|
||||||
|
|
||||||
(defpoll apactive :interval '1s' "~/.config/eww/scripts/ap.sh --class")
|
|
||||||
(defpoll dndactive :interval '1s' "~/.config/eww/scripts/dnd.sh --class")
|
|
||||||
(defpoll wifiactive :interval '1s' "~/.config/eww/scripts/wifi.sh --class")
|
|
||||||
(defpoll btactive :interval '1s' "~/.config/eww/scripts/bl.sh --class")
|
|
||||||
(defpoll wallpaper :interval "1h" "source ~/.local/bin/upw && echo $WALLPAPER")
|
|
||||||
|
|
||||||
(defpoll weathericon :interval "2h" "~/.config/eww/scripts/weather.sh icon")
|
|
||||||
(defpoll weatherimage :interval "2h" "~/.config/eww/scripts/weather.sh image")
|
|
||||||
(defpoll current_temp :interval "2h" "~/.config/eww/scripts/weather.sh current_temp")
|
|
||||||
(defpoll current_desc :interval "2h" "~/.config/eww/scripts/weather.sh weather_desc")
|
|
||||||
|
|
||||||
(defpoll dunsthistory :interval "250ms" "dunstctl history")
|
|
||||||
(defpoll dunstcount :interval "250ms" "dunstctl count history")
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
(defwidget profile[]
|
|
||||||
(box :orientation 'h' :space-evenly false :class "profile" :spacing 20
|
|
||||||
(image :hexpand true :halign "start" :image-width 50 :path pfp)
|
|
||||||
(box :orientation 'v' :valign 'center' :space-evenly false :halign "end" :spacing 3
|
|
||||||
(box :class "profiletime" :halign "end" "${username}@${hostname}")
|
|
||||||
(box :class "profiletime" :halign "end" "${uptime}")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget music[]
|
|
||||||
(box :orientation "h" :space-evenly false :spacing 15
|
|
||||||
(overlay :hexpand true
|
|
||||||
(box :orientation 'v' :space-evenly false :class "music" :style "background-image: url('${cover_art}');"
|
|
||||||
)
|
|
||||||
(box :class "music-g")
|
|
||||||
(box :orientation 'v' :space-evenly false
|
|
||||||
(box :orientation 'v' :space-evenly false :vexpand true :class "musicinfo"
|
|
||||||
(box :orientation "v" :halign 'start' :space-evenly false :spacing 3
|
|
||||||
(box :halign 'start' :class "musicname" song)
|
|
||||||
(box :halign 'start' :class "musicartist" song_artist)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(scale :onchange "mpc seek {}%" :class "scale music-scale" :value current_status )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :orientation 'v' :class "musicbuttons"
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --prev":valign 'center' :class "musicbutton" "")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --toggle" :valign 'center' :class "musicbutton" "${song_status}")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --next" :valign 'center' :class "musicbutton" "")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget setbtn[?icon active func label]
|
|
||||||
(button :halign 'center' :class "${active == 'active' ? 'active' : ''} setbtn" :onclick "${func}"
|
|
||||||
(box :hexpand true :halign "start" "${icon}" )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget slider[value icon function class]
|
|
||||||
(box :orientation "h" :hexpand true :space-evenly false :spacing 20
|
|
||||||
(box :class "scaleicon" icon)
|
|
||||||
(box :class "${class}" :hexpand true
|
|
||||||
(scale :class "scale ${class}"
|
|
||||||
:min 0
|
|
||||||
:max 100
|
|
||||||
:orientation "h"
|
|
||||||
:value value
|
|
||||||
:onchange function
|
|
||||||
:active true
|
|
||||||
:valign 'center')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget buttons[]
|
|
||||||
(box :orientation 'h' :class "buttons" :spacing 5
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/wifi.sh --toggle" :label "wifi" :active wifiactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/bl.sh --toggle" :label "bluetooth" :active btactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/dnd.sh --toggle" :label "silent" :active dndactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/ap.sh --toggle" :label "airplane" :active apactive)
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
(defwidget control[]
|
|
||||||
(box :orientation "v" :class "control" :space-evenly false :spacing 15
|
|
||||||
(profile)
|
|
||||||
(box :orientation "v" :class "sliders" :space-evenly false :spacing 25
|
|
||||||
(slider :class "brightscale" :icon "" :value brightness :function "brightnessctl s {}%")
|
|
||||||
(slider :class "volscale" :icon "" :value volume :round-digits 0 :function "pamixer --set-volume {}")
|
|
||||||
)
|
|
||||||
(music)
|
|
||||||
(buttons)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwindow control
|
|
||||||
:monitor 0
|
|
||||||
:geometry (geometry :x "290px"
|
|
||||||
:y "20px"
|
|
||||||
:width "450px"
|
|
||||||
:height "580px"
|
|
||||||
:anchor "top right")
|
|
||||||
:stacking "fg"
|
|
||||||
:exclusive true
|
|
||||||
(control))
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
(defwidget profile[]
|
|
||||||
(box :orientation 'h' :space-evenly false :class "profile" :spacing 20
|
|
||||||
(image :hexpand true :halign "start" :image-width 50 :path pfp)
|
|
||||||
(box :orientation 'v' :valign 'center' :space-evenly false :halign "end" :spacing 3
|
|
||||||
(box :class "profiletime" :halign "end" "${username}@${hostname}")
|
|
||||||
(box :class "profiletime" :halign "end" "${uptime}")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget music[]
|
|
||||||
(box :orientation "h" :space-evenly false :spacing 15
|
|
||||||
(overlay :hexpand true
|
|
||||||
(box :orientation 'v' :space-evenly false :class "music" :style "background-image: url('${cover_art}');"
|
|
||||||
)
|
|
||||||
(box :class "music-g")
|
|
||||||
(box :orientation 'v' :space-evenly false
|
|
||||||
(box :orientation 'v' :space-evenly false :vexpand true :class "musicinfo"
|
|
||||||
(box :orientation "v" :halign 'start' :space-evenly false :spacing 3
|
|
||||||
(box :halign 'start' :class "musicname" song)
|
|
||||||
(box :halign 'start' :class "musicartist" song_artist)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(scale :onchange "mpc seek {}%" :class "scale music-scale" :value current_status )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :orientation 'v' :class "musicbuttons"
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --prev":valign 'center' :class "musicbutton" "")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --toggle" :valign 'center' :class "musicbutton" "${song_status}")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --next" :valign 'center' :class "musicbutton" "")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget setbtn[?icon active func label]
|
|
||||||
(button :halign 'center' :class "${active == 'active' ? 'active' : ''} setbtn" :onclick "${func}"
|
|
||||||
(box :hexpand true :halign "start" "${icon}" )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget slider[value icon function class]
|
|
||||||
(box :orientation "h" :hexpand true :space-evenly false :spacing 20
|
|
||||||
(box :class "scaleicon" icon)
|
|
||||||
(box :class "${class}" :hexpand true
|
|
||||||
(scale :class "scale ${class}"
|
|
||||||
:min 0
|
|
||||||
:max 100
|
|
||||||
:orientation "h"
|
|
||||||
:value value
|
|
||||||
:onchange function
|
|
||||||
:active true
|
|
||||||
:valign 'center')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget buttons[]
|
|
||||||
(box :orientation 'h' :class "buttons" :spacing 5
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/wifi.sh --toggle" :label "wifi" :active wifiactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/bl.sh --toggle" :label "bluetooth" :active btactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/dnd.sh --toggle" :label "silent" :active dndactive)
|
|
||||||
(setbtn :icon "" :func "~/.config/eww/scripts/ap.sh --toggle" :label "airplane" :active apactive)
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
(defwidget control[]
|
|
||||||
(box :orientation "v" :class "control" :space-evenly false :spacing 15
|
|
||||||
(profile)
|
|
||||||
(box :orientation "v" :class "sliders" :space-evenly false :spacing 25
|
|
||||||
(slider :class "brightscale" :icon "" :value brightness :function "brightnessctl s {}%")
|
|
||||||
(slider :class "volscale" :icon "" :value volume :round-digits 0 :function "pamixer --set-volume {}")
|
|
||||||
)
|
|
||||||
(music)
|
|
||||||
(buttons)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwindow control
|
|
||||||
:monitor 0
|
|
||||||
:geometry (geometry :x "290px"
|
|
||||||
:y "20px"
|
|
||||||
:width "450px"
|
|
||||||
:height "580px"
|
|
||||||
:anchor "top right")
|
|
||||||
:stacking "fg"
|
|
||||||
:exclusive true
|
|
||||||
(control))
|
|
||||||
@ -1,157 +0,0 @@
|
|||||||
(defwidget notification [title summary body id icon ?LC ?reveal_close_icon]
|
|
||||||
(box :class "notification" :orientation "v" :height 150 :space-evenly "false"
|
|
||||||
(box :class "notification-title"
|
|
||||||
(label :class "notification-title-text" :halign "start" :text title)
|
|
||||||
(box :halign "end"
|
|
||||||
(button :class "notification-close"
|
|
||||||
:onclick "dunstctl history-rm ${id}"
|
|
||||||
"")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :class "notification-body" :space-evenly "false" :orientation "v"
|
|
||||||
(box :space-evenly "false" :spacing 20 :orientation "h"
|
|
||||||
(image :path icon :image-height 70)
|
|
||||||
(box
|
|
||||||
(box :class "notification-content" :orientation "v" :space-evenly "false"
|
|
||||||
(label :class "notification-summary" :halign "start" :valign "start"
|
|
||||||
:limit-width 15
|
|
||||||
:text summary)
|
|
||||||
(label :class "notification-message" :halign "start" :valign "start"
|
|
||||||
:limit-width 45 :wrap true :tooltip body
|
|
||||||
:xalign 0
|
|
||||||
:text body)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget sc[color val]
|
|
||||||
(box
|
|
||||||
(scale :orientation 'v' :flipped true :min 0 :max 100 :active false :class "${color}scale statscale" :value val)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget circprog[value icon label color]
|
|
||||||
(box :class "altstat" :orientation 'v' :spacing 10 :space-evenly false
|
|
||||||
(box :class "clabel" :halign "start" label)
|
|
||||||
(box :class "circbar"
|
|
||||||
(circular-progress :class " circ${color}"
|
|
||||||
:value value
|
|
||||||
:thickness 3
|
|
||||||
:clockwise true
|
|
||||||
:start-at 30
|
|
||||||
(box :class "tt" icon)
|
|
||||||
))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(defwidget dash[]
|
|
||||||
(box :class "dash" :spacing 20 :orientation "h"
|
|
||||||
(box :class "leftthing" :orientation 'v' :space-evenly false :spacing 20
|
|
||||||
(box :orientation 'h' :spacing 20
|
|
||||||
(overlay
|
|
||||||
(box :class "dashpfp" :style "background: url('${fullpfp}'); background-size: cover;")
|
|
||||||
(box :class "dashgradient")
|
|
||||||
)
|
|
||||||
(box :orientation 'v' :spacing 20
|
|
||||||
(box :class "dashtime" :orientation 'v' :space-evenly false
|
|
||||||
(box :orientation 'v' :space-evenly false :valign "center" :spacing 3 :vexpand true
|
|
||||||
(box :valign "center" :halign "start" :class "timelabelu" "Hello There")
|
|
||||||
(box :valign "center" :halign "start" :class "timelabel" uptime)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :class "dashtime" :orientation 'v' :space-evenly false :spacing 5
|
|
||||||
(box :orientation 'v' :space-evenly false :valign "center" :spacing 3 :vexpand true
|
|
||||||
(box :valign "center" :halign "start" :class "timelabelu" "Time")
|
|
||||||
(box :valign "center" :halign "start" :class "timelabel" thourtime)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :orientation 'h' :space-evenly false :spacing 20
|
|
||||||
(box :class "altstats" :orientation 'v' :spacing 20
|
|
||||||
(circprog :value {EWW_CPU.avg} :icon "" :label "CPU" :color "red")
|
|
||||||
(circprog :value cputemp :icon "" :label "TEMP" :color "green")
|
|
||||||
)
|
|
||||||
(box :class "stats" :orientation 'h' :hexpand true
|
|
||||||
(overlay
|
|
||||||
(box :orientation 'v' :spacing 60
|
|
||||||
(box :height 3 :class "gridline")
|
|
||||||
(box :height 3 :class "gridline")
|
|
||||||
(box :height 3 :class "gridline")
|
|
||||||
(box :height 3 :class "gridline")
|
|
||||||
(box :height 3 :class "gridline")
|
|
||||||
)
|
|
||||||
(box :orientation 'h' :spacing 75
|
|
||||||
(box :width 3 :class "gridline")
|
|
||||||
(box :width 3 :class "gridline")
|
|
||||||
(box :width 3 :class "gridline")
|
|
||||||
(box :width 3 :class "gridline")
|
|
||||||
)
|
|
||||||
(box :orientation 'h'
|
|
||||||
(sc :val {EWW_RAM.used_mem_perc} :color "red")
|
|
||||||
(sc :val wifisped :color "blue")
|
|
||||||
(sc :val {EWW_DISK["/"].used_perc} :color "magenta")
|
|
||||||
(sc :val battery :color "green")
|
|
||||||
)
|
|
||||||
))
|
|
||||||
)
|
|
||||||
(box :orientation "h" :vexpand true :class "dashmusic" :space-evenly false :spacing 20
|
|
||||||
(box :class "dashart" :style "background-image: url('${cover_art}'); background-size:cover;")
|
|
||||||
(box :orientation 'v' :halign "center" :hexpand true :valign "center" :vexpand true :space-evenly false :class "dmi"
|
|
||||||
(box :halign 'center' :class "musicname" song)
|
|
||||||
(box :halign 'center' :class "musicartist" song_artist)
|
|
||||||
(box :orientation 'h' (button :onclick "~/.config/eww/scripts/ms.sh --prev":valign 'center' :class "musicbutton" "")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --toggle" :valign 'center' :class "musicbutton" "${song_status}")
|
|
||||||
(button :onclick "~/.config/eww/scripts/ms.sh --next" :valign 'center' :class "musicbutton" "")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box :class "notifcenter" :orientation 'v' :space-evenly true
|
|
||||||
(scroll :vscroll true
|
|
||||||
(box :orientation 'v' :space-evenly false
|
|
||||||
(box :orientation "v" :space-evenly false :spacing 20
|
|
||||||
(for entry in {dunsthistory["data"][0]}
|
|
||||||
(box :class "notification-history" :orientation "v" :space-evenly "false"
|
|
||||||
(box :orientation 'v' :space-evenly false
|
|
||||||
(notification :class 'notif-${entry["id"]["data"]}'
|
|
||||||
:title {entry["appname"]["data"]}
|
|
||||||
:id {entry["id"]["data"]}
|
|
||||||
:summary {entry["summary"]["data"]}
|
|
||||||
:body {entry["body"]["data"]}
|
|
||||||
:icon {(entry["icon_path"]["data"] ?: "/home/namish/.config/awesome/theme/assets/notif.png")}
|
|
||||||
:reveal_close_icon "false"
|
|
||||||
:is_ss {entry["appname"]["data"] == "Screenshot Tool" ? "true" : "false"}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(revealer :valign "center" :vexpand true :reveal {dunstcount <= 0} :transition "crossfade"
|
|
||||||
(box :orientation "v" :space-evenly "false" :spacing 10 :valign "center"
|
|
||||||
(image :image-height 200 :path "/home/namish/.config/eww/assets/empty-notification.png")
|
|
||||||
(label :class "eon"
|
|
||||||
:valign "center"
|
|
||||||
:text "No Notifications."
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(defwindow dash
|
|
||||||
:monitor 0
|
|
||||||
:geometry (geometry :x "0px"
|
|
||||||
:y "20px"
|
|
||||||
:width "900px"
|
|
||||||
:height "700px"
|
|
||||||
:anchor "top center")
|
|
||||||
:stacking "fg"
|
|
||||||
:exclusive false
|
|
||||||
(dash))
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
(defwidget moment_calendar[]
|
|
||||||
(box :class " moment_calendar" :orientation "v" :space-evenly false
|
|
||||||
(box :class "moment_up" :space-evenly false :orientation "v" :spacing 20 (mtime) (label :class "m" :halign 'center' :hexpand true :text "${day}, ${calendar_day} ${month_year}") )
|
|
||||||
(box :class "moment_cal-box"
|
|
||||||
:orientation "v"
|
|
||||||
:space-evenly "false"
|
|
||||||
(label :class "moment_month-year" :text month_year)
|
|
||||||
(box :class "moment_day-names" :orientation "h" :space-evenly "true"
|
|
||||||
(label :text "Su")
|
|
||||||
(label :text "Mo")
|
|
||||||
(label :text "Tu")
|
|
||||||
(label :text "We")
|
|
||||||
(label :text "Th")
|
|
||||||
(label :text "Fr")
|
|
||||||
(label :text "Sa")
|
|
||||||
)
|
|
||||||
(calendar :class "moment_cal"
|
|
||||||
:show-details false :show-heading false :show-day-names false)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget mtime[]
|
|
||||||
(box :space-evenly false :halign "center" :orientation 'h' :spacing 15
|
|
||||||
(label :class "mo" :halign 'center' :text "${hour}")
|
|
||||||
(box :class "sep" :valign "center" :space-evenly false :orientation 'v'
|
|
||||||
(box :width 3 :height 20 :class "bgblue")
|
|
||||||
(box :width 3 :height 20 :class "bgpink")
|
|
||||||
(box :width 3 :height 20 :class "bgred")
|
|
||||||
)
|
|
||||||
(label :class "mo" :halign 'center':text "${minute}")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget weather[]
|
|
||||||
(box :orientation 'v'
|
|
||||||
(overlay :vexpand true
|
|
||||||
(box :orientation 'v' :hexpand true :space-evenly false :halign 'center' :class "weatherimage" :style "background: url('/home/namish/.config/eww/assets/weather/weather-${weatherimage}.jpg'); background-size:cover;")
|
|
||||||
(box :class "woverlay" :hexpand true :vexpand true)
|
|
||||||
(box :class "ok" :hexpand true :valign "center"
|
|
||||||
(box :orientation 'v' :halign "start" :space-evenly false
|
|
||||||
(box :class "wicon" weathericon)
|
|
||||||
)
|
|
||||||
(box :orientation 'v' :space-evenly false :valign "center"
|
|
||||||
(box :class "wtemp" :halign "end" "${current_temp}°C")
|
|
||||||
(box :class "wdesc" :halign "end" current_desc)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget moment[]
|
|
||||||
(box :orientation 'v' :spacing 20 :class 'moment' :space-evenly false
|
|
||||||
(moment_calendar) (weather))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
(defwindow moment
|
|
||||||
:monitor 0
|
|
||||||
:geometry (geometry :x "290px"
|
|
||||||
:y "20px"
|
|
||||||
:width "360px"
|
|
||||||
:height "650px"
|
|
||||||
:anchor "top right")
|
|
||||||
:stacking "fg"
|
|
||||||
:exclusive true
|
|
||||||
(moment))
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
programs.eww = {
|
|
||||||
configDir = ./config;
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,199 +0,0 @@
|
|||||||
* {
|
|
||||||
active: #b8bb26ff;
|
|
||||||
active-background: var(active);
|
|
||||||
active-foreground: var(background);
|
|
||||||
alternate-active-background: var(active);
|
|
||||||
alternate-active-foreground: var(background);
|
|
||||||
alternate-background: var(background-alt);
|
|
||||||
alternate-normal-background: var(background-alt);
|
|
||||||
alternate-normal-foreground: var(foreground);
|
|
||||||
alternate-urgent-background: var(urgent);
|
|
||||||
alternate-urgent-foreground: var(background);
|
|
||||||
background: #282828ff;
|
|
||||||
background-alt: #3c3836ff;
|
|
||||||
background-colour: var(background);
|
|
||||||
border-colour: var(selected);
|
|
||||||
font: "monospace bold 10";
|
|
||||||
foreground: #d5c4a1ff;
|
|
||||||
foreground-colour: var(foreground);
|
|
||||||
handle-colour: var(selected);
|
|
||||||
normal-background: var(background-alt);
|
|
||||||
normal-foreground: var(foreground);
|
|
||||||
selected: #83a598ff;
|
|
||||||
selected-active-background: var(urgent);
|
|
||||||
selected-active-foreground: var(background);
|
|
||||||
selected-normal-background: var(selected);
|
|
||||||
selected-normal-foreground: var(background);
|
|
||||||
selected-urgent-background: var(active);
|
|
||||||
selected-urgent-foreground: var(background);
|
|
||||||
urgent: #fb4934ff;
|
|
||||||
urgent-background: var(urgent);
|
|
||||||
urgent-foreground: var(background);
|
|
||||||
}
|
|
||||||
|
|
||||||
configuration {
|
|
||||||
display-clipboard: ">";
|
|
||||||
display-combi: ">";
|
|
||||||
display-drun: ">";
|
|
||||||
display-emoji: ">";
|
|
||||||
drun-display-format: "{name}";
|
|
||||||
modi: "drun,combi,emoji";
|
|
||||||
show-icons: false;
|
|
||||||
window-format: "{w} · {c} · {t}";
|
|
||||||
}
|
|
||||||
|
|
||||||
element {
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0px solid;
|
|
||||||
border-color: @border-colour;
|
|
||||||
border-radius: 0px;
|
|
||||||
cursor: pointer;
|
|
||||||
enabled: true;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 12px;
|
|
||||||
spacing: 10px;
|
|
||||||
text-color: @foreground-colour;
|
|
||||||
}
|
|
||||||
|
|
||||||
element alternate.active {
|
|
||||||
background-color: var(alternate-active-background);
|
|
||||||
text-color: var(alternate-active-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element alternate.normal {
|
|
||||||
background-color: var(alternate-normal-background);
|
|
||||||
text-color: var(alternate-normal-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element alternate.urgent {
|
|
||||||
background-color: var(alternate-urgent-background);
|
|
||||||
text-color: var(alternate-urgent-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element normal.active {
|
|
||||||
background-color: var(active-background);
|
|
||||||
text-color: var(active-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element normal.normal {
|
|
||||||
background-color: var(normal-background);
|
|
||||||
text-color: var(normal-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element normal.urgent {
|
|
||||||
background-color: var(urgent-background);
|
|
||||||
text-color: var(urgent-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element selected.active {
|
|
||||||
background-color: var(selected-active-background);
|
|
||||||
text-color: var(selected-active-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element selected.normal {
|
|
||||||
background-color: var(selected-normal-background);
|
|
||||||
text-color: var(selected-normal-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element selected.urgent {
|
|
||||||
background-color: var(selected-urgent-background);
|
|
||||||
text-color: var(selected-urgent-foreground);
|
|
||||||
}
|
|
||||||
|
|
||||||
element-icon {
|
|
||||||
background-color: transparent;
|
|
||||||
cursor: inherit;
|
|
||||||
size: 24px;
|
|
||||||
text-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
element-text {
|
|
||||||
background-color: transparent;
|
|
||||||
cursor: inherit;
|
|
||||||
highlight: inherit;
|
|
||||||
horizontal-align: 0.0;
|
|
||||||
text-color: inherit;
|
|
||||||
vertical-align: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
entry {
|
|
||||||
background-color: inherit;
|
|
||||||
cursor: text;
|
|
||||||
enabled: true;
|
|
||||||
margin: 8px 0px 0px 14px;
|
|
||||||
placeholder: "Search...";
|
|
||||||
placeholder-color: inherit;
|
|
||||||
text-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
inputbar {
|
|
||||||
background-color: @background-colour;
|
|
||||||
border: 0px;
|
|
||||||
border-color: @border-colour;
|
|
||||||
border-radius: 0px;
|
|
||||||
children: [ prompt, entry ];
|
|
||||||
enabled: true;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px 0px 6px 0px;
|
|
||||||
spacing: 10px;
|
|
||||||
text-color: @foreground-colour;
|
|
||||||
}
|
|
||||||
|
|
||||||
listview {
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0px solid;
|
|
||||||
border-color: @border-colour;
|
|
||||||
border-radius: 0px;
|
|
||||||
columns: 1;
|
|
||||||
cursor: "default";
|
|
||||||
cycle: true;
|
|
||||||
dynamic: true;
|
|
||||||
enabled: true;
|
|
||||||
fixed-columns: true;
|
|
||||||
fixed-height: true;
|
|
||||||
layout: vertical;
|
|
||||||
lines: 7;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
reverse: false;
|
|
||||||
scrollbar: false;
|
|
||||||
spacing: 10px;
|
|
||||||
text-color: @foreground-colour;
|
|
||||||
}
|
|
||||||
|
|
||||||
mainbox {
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0px solid;
|
|
||||||
border-color: @border-colour;
|
|
||||||
border-radius: 0px 0px 0px 0px;
|
|
||||||
children: [ inputbar, listview];
|
|
||||||
enabled: true;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 10px;
|
|
||||||
spacing: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt {
|
|
||||||
background-color: @background-alt;
|
|
||||||
enabled: true;
|
|
||||||
padding: 2px 14px 4px 14px;
|
|
||||||
text-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
window {
|
|
||||||
anchor: center;
|
|
||||||
background-color: @background-colour;
|
|
||||||
border: 2px solid;
|
|
||||||
border-color: @border-colour;
|
|
||||||
border-radius: 0px;
|
|
||||||
cursor: "default";
|
|
||||||
enabled: true;
|
|
||||||
fullscreen: false;
|
|
||||||
location: center;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
transparency: "real";
|
|
||||||
width: 420px;
|
|
||||||
x-offset: 0px;
|
|
||||||
y-offset: 0px;
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
rofi
|
|
||||||
rofi-emoji
|
|
||||||
];
|
|
||||||
|
|
||||||
home.file.".config" = {
|
|
||||||
recursive = true;
|
|
||||||
source = ./config;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
stylix = {
|
|
||||||
enable = true;
|
|
||||||
autoEnable = false;
|
|
||||||
|
|
||||||
image = ../../../wallpapers/maze.png;
|
|
||||||
|
|
||||||
targets = {
|
|
||||||
gnome.enable = true;
|
|
||||||
gtk.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./shell
|
|
||||||
./kitty
|
./kitty
|
||||||
./wezterm
|
./shell
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.wezterm.colorSchemes = {
|
|
||||||
ansi = [
|
|
||||||
"282828" "fb4934" "b8bb26" "fabd2f"
|
|
||||||
"83a598" "d3869b" "8ec07c" "d5c4a1"
|
|
||||||
];
|
|
||||||
|
|
||||||
background = "282828";
|
|
||||||
|
|
||||||
brights = [
|
|
||||||
"665c54" "fb4934" "b8bb26" "fabd2f"
|
|
||||||
"83a598" "d3869b" "8ec07c" "fbf1c7"
|
|
||||||
];
|
|
||||||
|
|
||||||
cursor_bg = "d5c4a1";
|
|
||||||
cursor_fg = "282828";
|
|
||||||
foreground = "d5c4a1";
|
|
||||||
selection_bg = "d5c4a1";
|
|
||||||
selection_fg = "282828";
|
|
||||||
|
|
||||||
tab_bar = {
|
|
||||||
background = "282828";
|
|
||||||
inactive_tab_edge = "282828";
|
|
||||||
|
|
||||||
active_tab = {
|
|
||||||
bg_color = "83a598";
|
|
||||||
fg_color = "d5c4a1";
|
|
||||||
};
|
|
||||||
|
|
||||||
inactive_tab = {
|
|
||||||
bg_color = "282828";
|
|
||||||
fg_color = "d5c4a1";
|
|
||||||
};
|
|
||||||
|
|
||||||
new_tab = {
|
|
||||||
bg_color = "282828";
|
|
||||||
fg_color = "83a598";
|
|
||||||
};
|
|
||||||
|
|
||||||
new_tab_hover = {
|
|
||||||
bg_color = "282828";
|
|
||||||
fg_color = "d5c4a1";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.wezterm.extraConfig = ''
|
|
||||||
-- ~/.config/wezterm/wezterm.lua
|
|
||||||
-- See https://wezfurlong.org/wezterm/
|
|
||||||
|
|
||||||
-- Add config folder to watchlist for config reloads.
|
|
||||||
local wezterm = require 'wezterm';
|
|
||||||
wezterm.add_to_config_reload_watch_list(wezterm.config_dir)
|
|
||||||
|
|
||||||
function font_with_fallback(name, params)
|
|
||||||
local names = { name, "emoji" }
|
|
||||||
return wezterm.font_with_fallback(names, params)
|
|
||||||
end
|
|
||||||
|
|
||||||
local font_name = "monospace"
|
|
||||||
|
|
||||||
return {
|
|
||||||
-- Font config
|
|
||||||
font = font_with_fallback(font_name),
|
|
||||||
font_rules = {
|
|
||||||
{
|
|
||||||
italic = true,
|
|
||||||
font = font_with_fallback(font_name, { italic = true })
|
|
||||||
},
|
|
||||||
{
|
|
||||||
italic = true,
|
|
||||||
intensity = "Bold",
|
|
||||||
font = font_with_fallback(font_name, { bold = true, italic = true })
|
|
||||||
},
|
|
||||||
{
|
|
||||||
intensity = "Bold",
|
|
||||||
font = font_with_fallback(font_name, { bold = true })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
font_size = 10,
|
|
||||||
line_height = 1.0,
|
|
||||||
default_cursor_style = "SteadyUnderline",
|
|
||||||
|
|
||||||
-- Keys
|
|
||||||
disable_default_key_bindings = true,
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
mods = "CTRL|SHIFT",
|
|
||||||
key = [[\]],
|
|
||||||
action = wezterm.action {
|
|
||||||
SplitHorizontal = { domain = "CurrentPaneDomain" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
mods = "CTRL",
|
|
||||||
key = [[\]],
|
|
||||||
action = wezterm.action {
|
|
||||||
SplitVertical = { domain = "CurrentPaneDomain" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = "t",
|
|
||||||
mods = "CTRL",
|
|
||||||
action = wezterm.action { SpawnTab = "CurrentPaneDomain" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = "w",
|
|
||||||
mods = "CTRL",
|
|
||||||
action = wezterm.action { CloseCurrentTab = { confirm = false } }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
mods = "CTRL",
|
|
||||||
key = "Tab",
|
|
||||||
action = wezterm.action { ActivateTabRelative = 1 }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
mods = "CTRL|SHIFT",
|
|
||||||
key = "Tab",
|
|
||||||
action = wezterm.action { ActivateTabRelative = -1 }
|
|
||||||
},
|
|
||||||
{ key = "x", mods = "CTRL", action = "ActivateCopyMode" },
|
|
||||||
{
|
|
||||||
key = "v",
|
|
||||||
mods = "CTRL|SHIFT",
|
|
||||||
action = wezterm.action { PasteFrom = "Clipboard" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = "c",
|
|
||||||
mods = "CTRL|SHIFT",
|
|
||||||
action = wezterm.action { CopyTo = "ClipboardAndPrimarySelection" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = "L",
|
|
||||||
mods = "CTRL",
|
|
||||||
action = wezterm.action.ShowDebugOverlay
|
|
||||||
}
|
|
||||||
},
|
|
||||||
front_end = "WebGpu",
|
|
||||||
enable_wayland = true,
|
|
||||||
check_for_updates = false,
|
|
||||||
color_scheme = "gruvbox-dark-medium",
|
|
||||||
window_padding = { left = "30pt", right = "30pt", top = "30pt", bottom = "30pt" },
|
|
||||||
inactive_pane_hsb = { saturation = 1.0, brightness = 1.0 },
|
|
||||||
enable_tab_bar = true,
|
|
||||||
use_fancy_tab_bar = false,
|
|
||||||
hide_tab_bar_if_only_one_tab = true,
|
|
||||||
show_tab_index_in_tab_bar = false,
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./colors.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.wezterm = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# global
|
|
||||||
catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
accent = "rosewater";
|
|
||||||
flavor = "latte";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
stylix = {
|
|
||||||
enable = true;
|
|
||||||
autoEnable = true;
|
|
||||||
|
|
||||||
homeManagerIntegration.autoImport = false;
|
|
||||||
|
|
||||||
image = ../../wallpapers/maze.png;
|
|
||||||
|
|
||||||
polarity = "dark";
|
|
||||||
|
|
||||||
targets.grub.useImage = true;
|
|
||||||
|
|
||||||
cursor = {
|
|
||||||
package = pkgs.bibata-cursors;
|
|
||||||
name = "Bibata-Modern-Ice";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||