Merge branch 'illogical-impulse' into illogical-impulse

This commit is contained in:
avisekh007
2024-02-03 19:54:40 +05:30
committed by GitHub
19 changed files with 123 additions and 2410 deletions
+13 -13
View File
@@ -83,22 +83,22 @@ export const AnimatedCircProg = ({
// Init animation
if (initFrom != initTo) {
// area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
Utils.timeout(20, () => {
area.css = `font-size: ${initTo}px;`;
}, area)
// const transitionDistance = initTo - initFrom;
// const oneStep = initAnimTime / initAnimPoints;
// area.css = `
// font-size: ${initFrom}px;
// transition: ${oneStep}ms linear;
// `;
// for (let i = 0; i < initAnimPoints; i++) {
// Utils.timeout(Math.max(10, i * oneStep), () => {
// if(!area) return;
// area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
// });
// }
const transitionDistance = initTo - initFrom;
const oneStep = initAnimTime / initAnimPoints;
area.css = `
font-size: ${initFrom}px;
transition: ${oneStep}ms linear;
`;
for (let i = 0; i < initAnimPoints; i++) {
Utils.timeout(Math.max(10, i * oneStep), () => {
if(!area) return;
area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
});
}
}
else area.css = 'font-size: 0px;';
extraSetup(area);
+31 -10
View File
@@ -20,6 +20,10 @@ function guessMessageType(summary) {
return 'chat';
}
function exists(widget) {
return widget !== null;
}
const NotificationIcon = (notifObject) => {
// { appEntry, appIcon, image }, urgency = 'normal'
if (notifObject.image) {
@@ -71,9 +75,9 @@ const NotificationIcon = (notifObject) => {
export default ({
notifObject,
isPopup = false,
popupTimeout = 3000,
props = {},
} = {}) => {
const popupTimeout = notifObject.timeout || (notifObject.urgency == 'critical' ? 8000 : 3000);
const command = (isPopup ?
() => notifObject.dismiss() :
() => notifObject.close()
@@ -82,11 +86,14 @@ export default ({
widget.sensitive = false;
notificationBox.setCss(middleClickClose);
Utils.timeout(200, () => {
wholeThing.revealChild = false;
if (wholeThing) wholeThing.revealChild = false;
}, wholeThing);
Utils.timeout(400, () => {
command();
wholeThing.destroy();
if (wholeThing) {
wholeThing.destroy();
wholeThing = null;
}
}, wholeThing);
}
const widget = EventBox({
@@ -111,7 +118,7 @@ export default ({
wholeThing.attribute.held = true;
notificationContent.toggleClassName(`${isPopup ? 'popup-' : ''}notif-clicked-${notifObject.urgency}`, true);
Utils.timeout(800, () => {
if (wholeThing.attribute.held) {
if (wholeThing?.attribute.held) {
Utils.execAsync(['wl-copy', `${notifObject.body}`])
notifTextSummary.label = notifObject.summary + " (copied)";
Utils.timeout(3000, () => notifTextSummary.label = notifObject.summary)
@@ -123,10 +130,10 @@ export default ({
})
}
});
const wholeThing = Revealer({
let wholeThing = Revealer({
attribute: {
'close': undefined,
'destroyWithAnims': () => destroyWithAnims,
'destroyWithAnims': destroyWithAnims,
'dragging': false,
'held': false,
'hovered': false,
@@ -137,7 +144,7 @@ export default ({
transitionDuration: 200,
child: Box({ // Box to make sure css-based spacing works
homogeneous: true,
})
}),
});
const display = Gdk.Display.get_default();
@@ -400,11 +407,14 @@ export default ({
widget.sensitive = false;
}
Utils.timeout(200, () => {
wholeThing.revealChild = false
if (wholeThing) wholeThing.revealChild = false;
}, wholeThing);
Utils.timeout(400, () => {
command();
wholeThing.destroy();
if (wholeThing) {
wholeThing.destroy();
wholeThing = null;
}
}, wholeThing);
}
else {
@@ -425,6 +435,17 @@ export default ({
})
widget.add(notificationBox);
wholeThing.child.children = [widget];
if (isPopup) Utils.timeout(popupTimeout, () => {
if (wholeThing) {
wholeThing.revealChild = false;
Utils.timeout(200, () => {
if (wholeThing) {
wholeThing.destroy();
wholeThing = null;
}
command();
}, wholeThing);
}
})
return wholeThing;
}
File diff suppressed because it is too large Load Diff
+2 -3
View File
@@ -144,7 +144,6 @@ export default () => {
})
const systemResources = BarGroup({
child: Box({
className: 'spacing-h-10',
children: [
BarResource('RAM Usage', 'memory', `free | awk '/^Mem/ {printf("%.2f\\n", ($3/$2) * 100)}'`),
Revealer({
@@ -152,7 +151,7 @@ export default () => {
transition: 'slide_left',
transitionDuration: 200,
child: Box({
className: 'spacing-h-10',
className: 'spacing-h-10 margin-left-10',
children: [
BarResource('Swap Usage', 'swap_horiz', `free | awk '/^Swap/ {if ($2 > 0) printf("%.2f\\n", ($3/$2) * 100); else print "0";}'`),
BarResource('CPU Usage', 'settings_motion_mode', `top -bn1 | grep Cpu | awk '{print $2}'`),
@@ -180,4 +179,4 @@ export default () => {
]
})
});
}
}
-1
View File
@@ -208,7 +208,6 @@ const switchToRelativeWorkspace = async (self, num) => {
}
}
export default () => Widget.EventBox({
onScrollUp: (self) => switchToRelativeWorkspace(self, -1),
onScrollDown: (self) => switchToRelativeWorkspace(self, +1),
@@ -365,6 +365,7 @@ export default () => MarginRevealer({
for (let i = 0; i < children.length; i++) {
const child = children[i];
child.destroy();
child = null;
}
return;
}
@@ -10,12 +10,14 @@ export default () => Box({
attribute: {
'map': new Map(),
'dismiss': (box, id, force = false) => {
if (!id || !box.attribute.map.has(id) || box.attribute.map.get(id).attribute.hovered && !force)
if (!id || !box.attribute.map.has(id))
return;
const notifWidget = box.attribute.map.get(id);
if (notifWidget == null || notifWidget.attribute.hovered && !force)
return; // cuz already destroyed
const notif = box.attribute.map.get(id);
notif.revealChild = false;
notif.attribute.destroyWithAnims();
notifWidget.revealChild = false;
notifWidget.attribute.destroyWithAnims();
box.attribute.map.delete(id);
},
'notify': (box, id) => {
@@ -32,8 +34,6 @@ export default () => Box({
box.attribute.map.set(id, newNotif);
box.pack_end(box.attribute.map.get(id), false, false, 0);
box.show_all();
// box.children = Array.from(box.attribute.map.values()).reverse();
},
},
setup: (self) => self
@@ -273,10 +273,12 @@ const OverviewRow = ({ startWorkspace, workspaces, windowName = 'overview' }) =>
kids.forEach(kid => kid.clear());
for (let i = 0; i < allClients.length; i++) {
const client = allClients[i];
if (offset + startWorkspace <= client.workspace.id && client.workspace.id <= offset + startWorkspace + workspaces) {
if (offset + startWorkspace <= client.workspace.id &&
client.workspace.id <= offset + startWorkspace + workspaces) {
const screenCoords = box.attribute.monitorMap[client.monitor];
kids[client.workspace.id - (offset + startWorkspace)]
.set(client, screenCoords);
?.set(client, screenCoords);
}
}
kids.forEach(kid => kid.show());
+1 -7
View File
@@ -13,13 +13,7 @@ import Gemini from '../../services/gemini.js';
import { geminiView, geminiCommands, sendMessage as geminiSendMessage, geminiTabIcon } from './apis/gemini.js';
import { chatGPTView, chatGPTCommands, sendMessage as chatGPTSendMessage, chatGPTTabIcon } from './apis/chatgpt.js';
import { waifuView, waifuCommands, sendMessage as waifuSendMessage, waifuTabIcon } from './apis/waifu.js';
class AgsTextView extends AgsWidget(Gtk.TextView, "AgsTextView") {
static { AgsWidget.register(this, {}); }
constructor(params) {
super(params);
}
}
const TextView = Widget.createCtor(AgsTextView);
const TextView = Widget.subclass(Gtk.TextView, "AgsTextView");
const EXPAND_INPUT_THRESHOLD = 30;
@@ -85,7 +85,8 @@ export default (props) => {
self.toggleClassName('notif-listaction-btn-enabled', Notifications.dnd);
});
const clearButton = ListActionButton('clear_all', 'Clear', () => {
notificationList.get_children().forEach(ch => ch.destroy());
// Manual destruction is not necessary
// since Notifications.clear() sends destroy signals to every notif
Notifications.clear();
});
const listTitle = Box({
+6 -1
View File
@@ -1,7 +1,12 @@
########## Input method ##########
env = GTK_IM_MODULE, fcitx
## See https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
env = QT_IM_MODULE, fcitx
env = XMODIFIERS, @im=fcitx
# env = GTK_IM_MODULE, wayland # Crashes electron apps in xwayland
# env = GTK_IM_MODULE, fcitx # My Gtk apps no longer require this to work with fcitx5 hmm
env = SDL_IM_MODULE, fcitx
env = GLFW_IM_MODULE, ibus
env = INPUT_METHOD, fcitx
############# Themes #############
env = QT_QPA_PLATFORM, wayland
+1 -1
View File
@@ -81,7 +81,7 @@ show_always = true
home_symbol = "  "
read_only = "  "
style = "bg:blue fg:black"
truncation_length = 30
truncation_length = 6
truncation_symbol = "••/"
format = '[](bold fg:blue)[$path ]($style)[](bold fg:blue)'
+1 -2
View File
@@ -1,7 +1,6 @@
.config/ags/style.css
.config/ags/scripts/templates/gradience/preset.json
.config/ags/scss/_musicmaterial.scss
.config/ags/style.css
.config/ags/scss/_material.scss
.config/hypr/colors.conf
#.config/hypr/colors.conf
/cache
+5 -2
View File
@@ -9,8 +9,11 @@ source ./scriptdata/functions
source ./scriptdata/installers
pkglistfile=$(mktemp)
pkglistfile_orig=./scriptdata/dependencies.txt
cat $pkglistfile_orig | sed "s_\ _\n_g" > $pkglistfile
pkglistfile_orig=./scriptdata/dependencies.conf
pkglistfile_orig_s=./cache/dependencies_stripped.conf
remove_bashcomments_emptylines $pkglistfile_orig $pkglistfile_orig_s
cat $pkglistfile_orig_s | sed "s_\ _\n_g" > $pkglistfile
echo "The non-existent pkgs in $pkglistfile_orig are listed as follows."
# Borrowed from https://bbs.archlinux.org/viewtopic.php?pid=1490795#p1490795
+7 -7
View File
@@ -6,6 +6,7 @@ source ./scriptdata/installers
#####################################################################################
if ! command -v pacman >/dev/null 2>&1;then printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n";exit 1;fi
prevent_sudo_or_root
startask (){
printf "\e[34m[$0]: Hi there!\n"
printf 'This script 1. only works for ArchLinux and Arch-based distros.\n'
@@ -38,9 +39,8 @@ set -e
#####################################################################################
printf "\e[36m[$0]: 1. Get packages and add user to video/input groups\n\e[97m"
# Each line as an element of the array $pkglist
readarray -t pkglist < ./scriptdata/dependencies.txt
# NOTE: wayland-idle-inhibitor-git is for providing `wayland-idle-inhibitor.py' used by the `Keep system awake' button in `.config/ags/widgets/sideright/quicktoggles.js'.
remove_bashcomments_emptylines ./scriptdata/dependencies.conf ./cache/dependencies_stripped.conf
readarray -t pkglist < ./cache/dependencies_stripped.conf
if ! command -v yay >/dev/null 2>&1;then
echo -e "\e[33m[$0]: \"yay\" not found.\e[0m"
@@ -111,10 +111,10 @@ do
fi
done
target="$HOME/.config/hypr/colors.conf"
test -f $target || { \
echo -e "\e[34m[$0]: File \"$target\" not found.\e[0m" && \
v cp "$HOME/.config/hypr/colors_default.conf" $target ; }
# target="$HOME/.config/hypr/colors.conf"
# test -f $target || { \
# echo -e "\e[34m[$0]: File \"$target\" not found.\e[0m" && \
# v cp "$HOME/.config/hypr/colors_default.conf" $target ; }
# some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync,
# since the files here come from different places, not only about one program.
+33
View File
@@ -0,0 +1,33 @@
### This file support bash-style comments, and blank lines.
### PKGs on same line will be send to `yay` together, unless `-f` is specified.
### Basic
coreutils cliphist curl fuzzel rsync wget ripgrep gojq npm meson typescript gjs sassc
### Python
# Add `python-setuptools-scm` and `python-wheel` explicitly to fix #197
python-build python-material-color-utilities python-pillow python-poetry python-pywal python-setuptools-scm python-wheel
### Basic graphic env
hyprland-git xorg-xrandr
# xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-hyprland-git
### Player and Audio
pavucontrol wireplumber libdbusmenu-gtk3 plasma-browser-integration playerctl swww
### GTK
webp-pixbuf-loader gtk-layer-shell gtk3 gtksourceview3 gobject-introspection upower yad ydotool
### Gnome
polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager brightnessctl wlsunset gnome-bluetooth-3.0
### Widgets
# wayland-idle-inhibitor-git : providing `wayland-idle-inhibitor.py' used by the `Keep system awake' button in `.config/ags/widgets/sideright/quicktoggles.js'.
wayland-idle-inhibitor-git swayidle swaylock-effects-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp
### Fonts and Themes
adw-gtk3-git gradience-git fontconfig lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd fish foot starship
### Screenshot and Recoder
swappy wf-recorder
-8
View File
@@ -1,8 +0,0 @@
coreutils cliphist curl fuzzel rsync wget ripgrep gojq npm meson typescript gjs sassc
python-build python-material-color-utilities python-pillow python-poetry python-pywal hyprland-git xorg-xrandr
cava pavucontrol wireplumber libdbusmenu-gtk3 plasma-browser-integration playerctl swww
webp-pixbuf-loader gtk-layer-shell gtk3 gtksourceview3 gobject-introspection upower yad ydotool
polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager brightnessctl wlsunset gnome-bluetooth-3.0
wayland-idle-inhibitor-git swayidle swaylock-effects-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp
adw-gtk3-git gradience-git fontconfig lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd fish foot starship
swappy wf-recorder
+9
View File
@@ -63,3 +63,12 @@ function showfun() {
type -a $1
printf "\e[97m"
}
function remove_bashcomments_emptylines(){
mkdir -p $(dirname $2)
cat $1 | sed -e '/^[[:blank:]]*#/d;s/#.*//' -e '/^[[:space:]]*$/d' > $2
}
function prevent_sudo_or_root(){
case $(whoami) in
root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;;
esac
}
+1 -1
View File
@@ -24,7 +24,7 @@ install-ags (){
try git init -b main
try git remote add origin https://github.com/Aylur/ags.git
x git pull origin main && git submodule update --init --recursive
x git checkout 8e94d3b465e76372056c76242e5c013950113be9 # "update changelog"
x git checkout 942f824c402631e4c1a9b67542a4db7a7f6d6359 # "export gobject utils in Utils"
x npm install
x meson setup build
x meson install -C build