From a33238c45448eabb4dacbf5e86ba869d471db28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 3 Nov 2023 00:37:39 +0100 Subject: [PATCH 1/2] Fix ansible-lint --fix mistakes --- .../automatrop/roles/desktop_environment/handlers/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/automatrop/roles/desktop_environment/handlers/main.yml b/config/automatrop/roles/desktop_environment/handlers/main.yml index 5eaac96..9234eda 100644 --- a/config/automatrop/roles/desktop_environment/handlers/main.yml +++ b/config/automatrop/roles/desktop_environment/handlers/main.yml @@ -1,11 +1,16 @@ --- - name: Xrdb-reload ansible.builtin.command: xrdb -I{{ ansible_env.HOME }} {{ ansible_env.HOME }}/.config/Xresources/main + listen: xrdb-reload - name: I3-reload ansible.builtin.command: i3-msg reload + listen: i3-reload - name: Shell-reload ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" + listen: shell-reload - name: Fzf-reload - ansible.builtin.command: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf + ansible.builtin.shell: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf + listen: fzf-reload - name: Qutebrowser-reload ansible.builtin.shell: "! pgrep qutebrowser || qutebrowser :config-source" + listen: qutebrowser-reload From 626f274d4690d6458fe2001d443b8ee31def52f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 3 Nov 2023 20:47:43 +0100 Subject: [PATCH 2/2] i3: Remove unused stuff --- config/i3/ashuffle | 7 ----- config/i3/aw_start | 16 ---------- config/i3/config.j2 | 2 -- config/i3/dmenu_cmd | 2 -- config/i3/dmenu_run | 15 --------- config/i3/multimediaKey | 26 ---------------- config/i3/pitch.png | Bin 67 -> 0 bytes config/i3/screentime | 67 ---------------------------------------- 8 files changed, 135 deletions(-) delete mode 100755 config/i3/ashuffle delete mode 100755 config/i3/aw_start delete mode 100755 config/i3/dmenu_cmd delete mode 100755 config/i3/dmenu_run delete mode 100755 config/i3/multimediaKey delete mode 100644 config/i3/pitch.png delete mode 100755 config/i3/screentime diff --git a/config/i3/ashuffle b/config/i3/ashuffle deleted file mode 100755 index 77168ef..0000000 --- a/config/i3/ashuffle +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -while true -do - ashuffle - sleep 1 -done diff --git a/config/i3/aw_start b/config/i3/aw_start deleted file mode 100755 index 2cfb9ca..0000000 --- a/config/i3/aw_start +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# TODO Make a good service out of this - -cd /opt/activitywatch # Put your ActivityWatch install folder here - -killall aw-server -killall aw-watcher-afk -killall aw-watcher-window - -./aw-server/aw-server & -./aw-watcher-afk/aw-watcher-afk & -./aw-watcher-window/aw-watcher-window & # you can add --exclude-title here to exclude window title tracking for this session only - -notify-send "ActivityWatch started" # Optional, sends a notification when ActivityWatch is started - diff --git a/config/i3/config.j2 b/config/i3/config.j2 index 95f4963..f122460 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -374,12 +374,10 @@ exec --no-startup-id unclutter -root # Hide mouse cursor after some time #exec --no-startup-id dunst # Notifications (handled by systemd) exec --no-startup-id keynav # Keyboard cursor controller #exec --no-startup-id mpd # Music Player Daemon (handled by systemd) -# exec --no-startup-id ~/.config/i3/ashuffle # MPD Auto-refill exec --no-startup-id autorandr --change --force # Screen configuration and everything that depends on it {% if has_battery %} exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification {% endif %} -# exec --no-startup-id ~/.config/i3/aw_start # Activity tracker {{ base16_schemes['schemes'][base16_scheme]['i3']['colors']['base16-' + base16_scheme + '.config'] }} diff --git a/config/i3/dmenu_cmd b/config/i3/dmenu_cmd deleted file mode 100755 index 2806540..0000000 --- a/config/i3/dmenu_cmd +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -dmenu -fn 'DejaVu Sans Mono-10' -nb '#48483e' -nf '#f1ebeb' -sb '#8fc029' -sf '#272822' -i -l 8 -f "$@" diff --git a/config/i3/dmenu_run b/config/i3/dmenu_run deleted file mode 100755 index 9892aab..0000000 --- a/config/i3/dmenu_run +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} -if [ -d "$cachedir" ]; then - cache=$cachedir/dmenu_run -else - cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ -fi -( - IFS=: - if stest -dqr -n "$cache" $PATH; then - stest -flx $PATH | sort -u | tee "$cache" | $HOME/.config/i3/dmenu_cmd -p 'Run' "$@" - else - $HOME/.config/i3/dmenu_cmd -p 'Run' "$@" < "$cache" - fi -) | ${SHELL:-"/bin/sh"} & diff --git a/config/i3/multimediaKey b/config/i3/multimediaKey deleted file mode 100755 index 3a4a808..0000000 --- a/config/i3/multimediaKey +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Send a key event to the current multimedia application or to MPD - -# Currently since I did not found a way to test if a keystroke -# is grabbed by a windows or not, we test if MPD is playing - -echo 8 "$1" "$2" "$(xdotool getactivewindow)" >> /tmp/dbg - -if [ $# != 2 ]; then - echo "Usage: $0 KEY MPC_COMMAND" - exit 1 -fi - -if [ $(mpc status | wc -l) -ne 1 ]; then - # If mpd is running - mpc $2 -else - # If mpd is not running - # echo "$1" "$2" "$(xdotool getactivewindow)" >> /tmp/dbg - xdotool key --window $(xdotool getactivewindow) $1 - echo xdotool key --window $(xdotool getactivewindow) $1 >> /tmp/dbg -fi -exit 0 - - diff --git a/config/i3/pitch.png b/config/i3/pitch.png deleted file mode 100644 index aac403dbb1251e8b8d3552445ad6bf0ee1f5607c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q75DwYo1R$G None: - now = datetime.datetime.now() - line["date"] = now.timestamp() - - print("WROTE", line) - with open(self.csv_path, "a") as typedfd: - writer = csv.DictWriter(typedfd, fieldnames=self.FIELDS) - writer.writerow(line) - - def on_window_event( - self, _: i3ipc.connection.Connection, e: i3ipc.events.WindowEvent - ) -> None: - focused = self.i3.get_tree().find_focused() - self.write( - { - "type": "window_" + e.change, - "class": focused.window_class, - "role": focused.window_role, - "title": focused.window_title, - "instance": focused.window_instance, - } - ) - - def on_mode_event( - self, _: i3ipc.connection.Connection, e: i3ipc.events.ModeEvent - ) -> None: - self.write({"type": "mode", "title": e.change}) - - def __init__(self) -> None: - self.i3 = i3ipc.Connection() - self.i3.on(i3ipc.Event.WINDOW, self.on_window_event) - self.i3.on(i3ipc.Event.MODE, self.on_mode_event) - - self.csv_path = os.path.join( - os.path.expanduser(os.getenv("XDG_CACHE_PATH", "~/.cache/")), - "screentime.csv", - ) - if not os.path.isfile(self.csv_path): - with open(self.csv_path, "w") as typedfd: - writer = csv.DictWriter(typedfd, fieldnames=self.FIELDS) - writer.writeheader() - self.write({"type": "start"}) - - def main(self) -> None: - self.i3.main() - - -if __name__ == "__main__": - ST = ScreenTime() - ST.main()