Compare commits

..

6 commits

Author SHA1 Message Date
Geoffrey Frogeye d0c743ec30
nix: Even more misc config 2023-11-19 23:20:20 +01:00
Geoffrey Frogeye dfb47f17f5
nix: Add qutebrowser 2023-11-19 23:09:10 +01:00
Geoffrey Frogeye fe1303ccc9
nix: More misc config 2023-11-19 22:41:09 +01:00
Geoffrey Frogeye c9e0c79ab2
nix: Add mpv 2023-11-19 21:48:35 +01:00
Geoffrey Frogeye 2d89e1b224
nix: add mpd conf 2023-11-19 21:28:42 +01:00
Geoffrey Frogeye 47a19d7f82
nix: frobar
Semi-proper Python packaging, and non-conflicting names, yahoo!
2023-11-19 20:51:05 +01:00
52 changed files with 248 additions and 685 deletions

View file

@ -1,13 +0,0 @@
#!/usr/bin/env sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ex="$DIR/bar.py"
# Terminate already running bar instances
ps x | grep "python3 $ex" | grep -v grep | awk '{print $1}' | while read p; do kill $p; done
killall -q lemonbar
$ex

View file

@ -1,13 +0,0 @@
coloredlogs==10.0
enum-compat==0.0.2
humanfriendly==4.16.1
i3ipc==1.6.0
ifaddr==0.1.4
ipaddress==1.0.22
psutil==5.4.7
pulsectl>=23.5.2<24
pyinotify==0.9.6
python-mpd2>=3.0.0<4
python-uinput==0.11.2
yoke==0.1.1
zeroconf==0.21.3

View file

@ -1 +0,0 @@
savepath-command='echo %s'

View file

View file

@ -1,413 +0,0 @@
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "~/Musiques"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory "~/.config/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file "~/.cache/mpd/database"
#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, otherwise logging is disabled.
#
log_file "~/.cache/mpd/log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file "~/.cache/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
state_file "~/.cache/mpd/state"
#
# The location of the sticker database. This is a database which
# manages dynamic information attached to songs.
#
sticker_file "~/.cache/mpd/sticker.sql"
#
###############################################################################
# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
#user "nobody"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group "nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon.
#
# For network
#bind_to_address "any"
#
# And for Unix Socket
#bind_to_address "~/.mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
#port "6600"
#
# This setting controls the type of information which is logged. Available
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
log_level "default"
#
# If you have a problem with your MP3s ending abruptly it is recommended that
# you set this argument to "no" to attempt to fix the problem. If this solves
# the problem, it is highly recommended to fix the MP3 files with vbrfix
# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
# point gapless MP3 playback can be enabled.
#
#gapless_mp3_playback "yes"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
restore_paused "yes"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists "no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
auto_update "yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself. There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################
# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks "yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
#follow_inside_symlinks "yes"
#
###############################################################################
# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled "yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network.
#
#zeroconf_name "Music Player"
#
###############################################################################
# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# can setting can be specified multiple times for different password profiles.
#
#password "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions "read,add,control,admin"
#
###############################################################################
# Database #######################################################################
#
#database {
# plugin "proxy"
# host "other.mpd.host"
# port "6600"
#}
# Input #######################################################################
#
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
#
###############################################################################
# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
#audio_output {
# type "alsa"
# name "My ALSA Device"
## device "hw:0,0" # optional
## mixer_type "hardware" # optional
## mixer_device "default" # optional
## mixer_control "PCM" # optional
## mixer_index "0" # optional
#}
#
# An example of an OSS output:
#
#audio_output {
# type "oss"
# name "My OSS Device"
## device "/dev/dsp" # optional
## mixer_type "hardware" # optional
## mixer_device "/dev/mixer" # optional
## mixer_control "PCM" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
# type "shout"
# encoding "ogg" # optional
# name "My Shout Stream"
# host "localhost"
# port "8000"
# mount "/mpd.ogg"
# password "hackme"
# quality "5.0"
# bitrate "128"
# format "44100:16:1"
## protocol "icecast2" # optional
## user "source" # optional
## description "My Stream Description" # optional
## url "http://example.com" # optional
## genre "jazz" # optional
## public "no" # optional
## timeout "2" # optional
## mixer_type "software" # optional
#}
#
# An example of a recorder output:
#
#audio_output {
# type "recorder"
# name "My recorder"
# encoder "vorbis" # optional, vorbis or lame
# path "/var/lib/mpd/recorder/mpd.ogg"
## quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
audio_output {
type "httpd"
name "geoffrey-music-httpd"
encoder "vorbis" # optional, vorbis or lame
port "8600"
bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
# quality "5.0" # do not define if bitrate is defined
bitrate "128" # do not define if quality is defined
format "44100:16:1"
max_clients "0" # optional 0=no limit
}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
#
audio_output {
type "pulse"
name "geoffrey-music-pulse"
## server "remote_server" # optional
## sink "remote_server_sink" # optional
}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
# type "winmm"
# name "My WinMM output"
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
# or
## device "0" # optional
## mixer_type "hardware" # optional
#}
#
# An example of an openal output.
#
#audio_output {
# type "openal"
# name "My OpenAL output"
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#}
#
## Example "pipe" output:
#
#audio_output {
# type "pipe"
# name "my pipe"
# command "aplay -f cd 2>/dev/null"
## Or if you're want to use AudioCompress
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
## Or to send raw PCM stream through PCM:
# command "nc example.org 8765"
# format "44100:16:2"
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
# type "null"
# name "My Null Output"
# mixer_type "none" # optional
#}
#
# If MPD has been compiled with libsamplerate support, this setting specifies
# the sample rate converter to use. Possible values can be found in the
# mpd.conf man page or the libsamplerate documentation. By default, this is
# setting is disabled.
#
#samplerate_converter "Fastest Sinc Interpolator"
#
###############################################################################
# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
# chooses between "track" and "album" depending on the current state of
# random playback. If random playback is enabled then "track" mode is used.
# See <http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
replaygain "auto"
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp "0"
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp "0"
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit "yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has
# equal "loudness". This setting is disabled by default.
#
#volume_normalization "no"
#
###############################################################################
# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
#filesystem_charset "UTF-8"
#
# This setting controls the encoding that ID3v1 tags should be converted from.
#
#id3v1_encoding "ISO-8859-1"
#
###############################################################################
# SIDPlay decoder #############################################################
#
# songlength_database:
# Location of your songlengths file, as distributed with the HVSC.
# The sidplay plugin checks this for matching MD5 fingerprints.
# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq
#
# default_songlength:
# This is the default playing time in seconds for songs not in the
# songlength database, or in case you're not using a database.
# A value of 0 means play indefinitely.
#
# filter:
# Turns the SID filter emulation on or off.
#
#decoder {
# plugin "sidplay"
# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt"
# default_songlength "120"
# filter "true"
#}
#
###############################################################################

View file

View file

@ -1,71 +0,0 @@
# The thumbnail cache directory.
# On Windows this defaults to %TEMP%\mpv_thumbs_cache,
# and on other platforms to /tmp/mpv_thumbs_cache.
# The directory will be created automatically, but must be writeable!
# Use absolute paths, and take note that environment variables like %TEMP% are unsupported (despite the default)!
# cache_directory=%HOME%/.cache/mpv/thumbnails
cache_directory=/tmp/my_mpv_thumbnails
# THIS IS NOT A WINDOWS PATH. COMMENT IT OUT OR ADJUST IT YOURSELF.
# Whether to generate thumbnails automatically on video load, without a keypress
# Defaults to yes
autogenerate=no
# Only automatically thumbnail videos shorter than this (in seconds)
# You will have to press T (or your own keybind) to enable the thumbnail previews
# Set to 0 to disable the check, ie. thumbnail videos no matter how long they are
# Defaults to 3600 (one hour)
autogenerate_max_duration=3600
# Use mpv to generate thumbnail even if ffmpeg is found in PATH
# ffmpeg is slightly faster than mpv but lacks support for ordered chapters in MKVs,
# which can break the resulting thumbnails. You have been warned.
# Defaults to yes (don't use ffmpeg)
prefer_mpv=no
# Explicitly disable subtitles on the mpv sub-calls
# mpv can and will by default render subtitles into the thumbnails.
# If this is not what you wish, set mpv_no_sub to yes
# Defaults to no
mpv_no_sub=no
# Enable to disable the built-in keybind ("T") to add your own, see after the block
disable_keybinds=no
# The maximum dimensions of the thumbnails, in pixels
# Defaults to 200 and 200
thumbnail_width=200
thumbnail_height=200
# The thumbnail count target
# (This will result in a thumbnail every ~10 seconds for a 25 minute video)
thumbnail_count=150
# The above target count will be adjusted by the minimum and
# maximum time difference between thumbnails.
# The thumbnail_count will be used to calculate a target separation,
# and min/max_delta will be used to constrict it.
# In other words, thumbnails will be:
# - at least min_delta seconds apart (limiting the amount)
# - at most max_delta seconds apart (raising the amount if needed)
# Defaults to 5 and 90, values are seconds
min_delta=5
max_delta=90
# 120 seconds aka 2 minutes will add more thumbnails only when the video is over 5 hours long!
# Below are overrides for remote urls (you generally want less thumbnails, because it's slow!)
# Thumbnailing network paths will be done with mpv (leveraging youtube-dl)
# Allow thumbnailing network paths (naive check for "://")
# Defaults to no
thumbnail_network=no
# Override thumbnail count, min/max delta, as above
remote_thumbnail_count=60
remote_min_delta=15
remote_max_delta=120
# Try to grab the raw stream and disable ytdl for the mpv subcalls
# Much faster than passing the url to ytdl again, but may cause problems with some sites
# Defaults to yes
remote_direct_stream=yes

View file

@ -1,4 +0,0 @@
no-audio-display
save-position-on-quit
# Required by thumbnails script
osc=no

View file

@ -1 +0,0 @@
/usr/share/mpv/scripts/mpv_thumbnail_script_client_osc.lua

View file

@ -1 +0,0 @@
/usr/share/mpv/scripts/mpv_thumbnail_script_server.lua

View file

@ -1,7 +0,0 @@
[mypy]
cache_dir = ~/.cache/mypy
ignore_missing_imports = True
disallow_untyped_defs = True
disallow_untyped_calls = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True

View file

@ -25,7 +25,7 @@ in
commonRc = lib.strings.concatLines ([
''
# Colored ls
# TODO Doesn't allow completion
# TODO Doesn't allow completion. Check out lsd instead
_colored_ls() {
\ls -lh --color=always $@ | awk '
BEGIN {
@ -324,7 +324,6 @@ in
};
xdg = {
configFile = {
# TODO Should be xdg.configFile
"ccache.conf" = {
text = "ccache_dir = ${config.xdg.cacheHome}/ccache";
};
@ -346,6 +345,12 @@ in
log-scale: yes
'';
};
"pythonstartup.py" = {
text = (builtins.readFile ./pythonstartup.py);
};
"screenrc" = {
text = (builtins.readFile ./screenrc);
};
};
};
home = {

View file

@ -329,7 +329,59 @@
programs = {
# Browser
qutebrowser.enable = true;
qutebrowser = {
enable = true;
keyBindings = {
normal = {
# Match tab behaviour to i3. Not that I use them.
"H" = "tab-prev";
"J" = "back";
"K" = "forward";
"L" = "tab-next";
# "T" = null;
"af" = "spawn --userscript freshrss"; # TODO Broken?
"as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore
# "d" = null;
"u" = "undo --window";
# TODO Unbind d and T (?)
};
};
loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml
searchEngines = rec {
DEFAULT = ecosia;
ampwhat = "http://www.amp-what.com/unicode/search/{}";
aw = ampwhat;
ddg = duckduckgo;
duckduckgo = "https://duckduckgo.com/?q={}&ia=web";
ecosia = "https://www.ecosia.org/search?q={}";
github = "https://github.com/search?q={}";
google = "https://www.google.fr/search?q={}";
g = google;
npm = "https://www.npmjs.com/search?q={}";
q = qwant;
qwant = "https://www.qwant.com/?t=web&q={}";
wolfram = "https://www.wolframalpha.com/input/?i={}";
youtube = "https://www.youtube.com/results?search_query={}";
yt = youtube;
};
settings = {
downloads.location.prompt = false;
tabs = {
show = "never";
tabs_are_windows = true;
};
url = {
open_base_url = true;
start_pages = "https://geoffrey.frogeye.fr/blank.html";
};
content = {
# I had this setting below, not sure if it did something special
# config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*")
cookies.accept = "no-3rdparty";
prefers_reduced_motion = true;
};
};
};
# Terminal
alacritty = {
@ -378,8 +430,26 @@
rofi = {
enable = true;
pass.enable = true;
extraConfig = {
lazy-grab = false;
matching = "regex";
};
};
autorandr.enable = true;
mpv = {
enable = true;
config = {
audio-display = false;
save-position-on-quit = true;
osc = false; # # Required by thumbnail script
};
scripts = with pkgs.mpvScripts; [ thumbnail ];
scriptOpts = {
mpv_thumbnail_script = {
cache_directory = "/tmp/mpv_thumbs_${config.home.username}";
};
};
};
};
xdg = {
@ -393,7 +463,49 @@
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
};
};
userDirs.enable = true; # TODO Which ones do we want?
userDirs = {
enable = true; # TODO Which ones do we want?
createDirectories = true;
# French, because then it there's a different initial for each, making navigation easier
desktop = null;
download = "${config.home.homeDirectory}/Téléchargements";
music = "${config.home.homeDirectory}/Musiques";
pictures = "${config.home.homeDirectory}/Images";
publicShare = null;
templates = null;
videos = "${config.home.homeDirectory}/Vidéos";
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots";
};
};
configFile = {
"pulse/client.conf" = {
text = ''cookie-file = .config/pulse/pulse-cookie'';
};
"xinitrc" =
let
nixgl = import
(builtins.fetchGit {
url = "https://github.com/nix-community/nixGL";
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
})
{ };
in
{
# TODO Configurable
source = pkgs.writeShellScript "xinitrc" ''
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command}
'';
};
"rofimoji.rc" = {
text = ''
skin-tone = neutral
files = [emojis, math]
action = clipboard
'';
};
};
};
services = {
unclutter.enable = true;
@ -433,29 +545,22 @@
};
};
};
mpd.enable = true;
mpd = {
enable = true;
network = {
listenAddress = "0.0.0.0"; # So it can be controlled from home
# TODO ... and whoever is the Wi-Fi network I'm using, which, not great
port = 8601; # FIXME Chose a different one for testing, should revert
startWhenNeeded = true;
};
extraConfig = ''
restore_paused "yes"
'';
};
autorandr.enable = true;
};
home = {
file =
let
nixgl = import
(builtins.fetchGit {
url = "https://github.com/nix-community/nixGL";
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
})
{ };
in
{
"${config.xdg.configHome}/xinitrc" = {
# TODO Configurable
source = pkgs.writeShellScript "xinitrc" ''
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command}
'';
};
};
packages = with pkgs; [
# remote
tigervnc
@ -468,8 +573,6 @@
# multimedia common
gimp
inkscape
mpv
mpvScripts.thumbnail
libreoffice
# data management
@ -496,16 +599,20 @@
simplescreenrecorder
trayer
xclip
lemonbar-xft
keynav
xorg.xinit
xorg.xbacklight
# TODO Make this clean. Service?
(callPackage (import ./frobar) { }) # FIXME Call it where needed
# organisation
pass
thunderbird
];
sessionVariables = {
MPD_PORT = "${toString config.services.mpd.network.port}";
};
};
}

2
config/nix/hm/frobar/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
dist/*
frobar.egg-info/*

View file

@ -0,0 +1,31 @@
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; } }:
# Tried using pyproject.nix but mpd2 dependency wouldn't resolve,
# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs.
let
frobar = pkgs.python3Packages.buildPythonApplication {
pname = "frobar";
version = "2.0";
propagatedBuildInputs = with pkgs.python3Packages; [
coloredlogs
notmuch
i3ipc
mpd2
psutil
pulsectl
pyinotify
];
src = ./.;
};
frobar_launcher = pkgs.writeShellApplication
{
name = "frobar_launcher";
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
text = ''
${pkgs.procps}/bin/pkill /bin/frobar || true
${frobar}/bin/frobar
'';
};
in
frobar_launcher

View file

@ -1,10 +1,10 @@
#!/usr/bin/env python3
from providers import *
from frobar.providers import *
# TODO If multiple screen, expand the sections and share them
# TODO Graceful exit
if __name__ == "__main__":
def run():
Bar.init()
Updater.init()

View file

@ -1,15 +1,17 @@
#!/usr/bin/env python3
import enum
import threading
import time
import i3ipc
import logging
import os
import signal
import subprocess
import logging
import threading
import time
import coloredlogs
import updaters
import i3ipc
from frobar.notbusy import notBusy
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger()
@ -168,7 +170,6 @@ class Bar:
@staticmethod
def updateAll():
if Bar.running:
Bar.string = ""
for bar in Bar.everyone:
@ -295,7 +296,7 @@ class SectionThread(threading.Thread):
def run(self):
while Section.somethingChanged.wait():
updaters.notBusy.wait()
notBusy.wait()
Section.updateAll()
animTime = self.ANIMATION_START
frameTime = time.perf_counter()
@ -311,7 +312,6 @@ class SectionThread(threading.Thread):
class Section:
# TODO Update all of that to base16
# COLORS = ['#272822', '#383830', '#49483e', '#75715e', '#a59f85', '#f8f8f2',
# '#f5f4f1', '#f9f8f5', '#f92672', '#fd971f', '#f4bf75', '#a6e22e',

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python3
import threading
notBusy = threading.Event()

View file

@ -1,20 +1,21 @@
#!/usr/bin/env python3
import datetime
from updaters import *
from display import *
import pulsectl
import psutil
import subprocess
import socket
import ipaddress
import logging
import coloredlogs
import json
import notmuch
import mpd
import logging
import random
import math
import socket
import subprocess
import coloredlogs
import mpd
import notmuch
import psutil
import pulsectl
from frobar.display import *
from frobar.updaters import *
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger()
@ -43,7 +44,6 @@ def randomColor(seed=0):
class TimeProvider(StatefulSection, PeriodicUpdater):
FORMATS = ["%H:%M", "%m-%d %H:%M:%S", "%a %y-%m-%d %H:%M:%S"]
NUMBER_STATES = len(FORMATS)
DEFAULT_STATE = 1
@ -257,7 +257,6 @@ class PulseaudioProvider(StatefulSection, ThreadedUpdater):
class NetworkProviderSection(StatefulSection, Updater):
NUMBER_STATES = 5
DEFAULT_STATE = 1

View file

@ -1,22 +1,24 @@
#!/usr/bin/env python3
import math
import functools
import threading
import pyinotify
import os
import time
import logging
import math
import os
import threading
import time
import coloredlogs
import i3ipc
from display import Text
import pyinotify
from frobar.display import Text
from frobar.notbusy import notBusy
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger()
# TODO Sync bar update with PeriodicUpdater updates
notBusy = threading.Event()
class Updater:
@ -241,7 +243,6 @@ class I3Updater(ThreadedUpdater):
class MergedUpdater(Updater):
# TODO OPTI Do not update until end of periodic batch
def fetcher(self):
text = Text()

View file

@ -0,0 +1,20 @@
from setuptools import setup
setup(
name="frobar",
version="2.0",
install_requires=[
"coloredlogs",
"notmuch",
"i3ipc",
"python-mpd2",
"psutil",
"pulsectl",
"pyinotify",
],
entry_points={
"console_scripts": [
"frobar = frobar:run",
]
},
)

View file

@ -1,10 +1,11 @@
import rlcompleter
#!/usr/bin/env python3
import sys
import os
# From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436
# Changing the history file
def register_readline():
def register_readline() -> None:
import atexit
try:
import readline

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
@ -178,10 +178,23 @@ in
};
isort.enabled = true;
mccabe.enabled = true;
pycodestyle.enabled = true;
pycodestyle = {
enabled = true;
maxLineLength = 88; # Compatibility with Black
};
pyflakes.enabled = true;
pylint.enabled = true;
pylsp_mypy.enabled = true;
pylsp_mypy = {
enabled = true;
overrides = [
"--cache-dir=${config.xdg.cacheHome}/mypy"
"--ignore-missing-imports"
"--disallow-untyped-defs"
"--disallow-untyped-calls"
"--disallow-incomplete-defs"
"--disallow-untyped-decorators"
];
};
# FIXME Somehow no warning is shown
# TODO Could add some, could also remove some
};

View file

View file

@ -1 +0,0 @@
cookie-file = .config/pulse/pulse-cookie

View file

@ -1,3 +0,0 @@
[pycodestyle]
# Compatibility with Black
max-line-length = 88

View file

@ -1,81 +0,0 @@
import os
# Public static configuration for qutebrowser
# Note that private stuff (permissions, per-site rules)
# are in autoconfig in gdotfiles
# Prompt the user for the download location. If set to false,
# `downloads.location.directory` will be used.
# Type: Bool
c.downloads.location.prompt = False
# When to show the tab bar.
# Type: String
# Valid values:
# - always: Always show the tab bar.
# - never: Always hide the tab bar.
# - multiple: Hide the tab bar if only one tab is open.
# - switching: Show the tab bar when switching tabs.
c.tabs.show = "never"
# Open a new window for every tab.
# Type: Bool
c.tabs.tabs_are_windows = True
# Open base URL of the searchengine if a searchengine shortcut is
# invoked without parameters.
# Type: Bool
c.url.open_base_url = True
# Search engines which can be used via the address bar. Maps a search
# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
# placeholder. The placeholder will be replaced by the search term, use
# `{{` and `}}` for literal `{`/`}` signs. The search engine named
# `DEFAULT` is used when `url.auto_search` is turned on and something
# else than a URL was entered to be opened. Other search engines can be
# used by prepending the search engine name to the search term, e.g.
# `:open google qutebrowser`.
# Type: Dict
c.url.searchengines = {
"DEFAULT": "https://www.ecosia.org/search?q={}",
"aw": "http://www.amp-what.com/unicode/search/{}",
"ddg": "https://duckduckgo.com/?q={}&ia=web",
"duckduckgo": "https://duckduckgo.com/?q={}&ia=web",
"ecosia": "https://www.ecosia.org/search?q={}",
"github": "https://github.com/search?q={}",
"google": "https://www.google.fr/search?q={}",
"npm": "https://www.npmjs.com/search?q={}",
"q": "https://www.qwant.com/?t=web&q={}",
"qwant": "https://www.qwant.com/?t=web&q={}",
"wolfram": "https://www.wolframalpha.com/input/?i={}",
"youtube": "https://www.youtube.com/results?search_query={}",
}
# Only allow first party cookies
config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*")
# Request websites to reduce non-essential motion/animations
config.set("content.prefers_reduced_motion", True)
# Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl
c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html"
# Bindings for normal mode
config.bind("H", "tab-prev")
config.bind("J", "back")
config.bind("K", "forward")
config.bind("L", "tab-next")
config.unbind("T")
config.bind("af", "spawn --userscript freshrss")
config.bind("as", "spawn --userscript shaarli")
config.bind("u", "undo --window")
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, "theme.py")
if os.path.exists(filename):
with open(filename) as file:
exec(file.read())
# Uncomment this to still load settings configured via autoconfig.yml
config.load_autoconfig()

View file

@ -1,2 +0,0 @@
theme.config
theme.rasi

View file

@ -1,4 +0,0 @@
#include "theme.config"
rofi.theme: theme
rofi.lazy-grab: false
rofi.matching: regex

View file

@ -1,5 +0,0 @@
configuration {
lazy-grab: false;
matching: "regex";
}
@theme "theme"

View file

@ -1,3 +0,0 @@
skin-tone = neutral
files = [emojis, math]
action = clipboard

0
config/linuxColors.sh → config/scripts/linuxColors Normal file → Executable file
View file

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Optimizes everything the script can find in a folder,
# meaning it will compress files as much as possible,
# without losing any data (verification will be done
@ -8,6 +9,7 @@
# TODO Run in parallel
# TODO Lots of dupplicated code there
# TODO Maybe replace part with https://github.com/toy/image_optim?
dir=${1:-$PWD}
total=$(mktemp)

Binary file not shown.

Binary file not shown.

Binary file not shown.