From 7bd345e11f2c86cae728f3cf03973ccf90cc173f Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Tue, 31 May 2022 16:25:49 +0300 Subject: [PATCH] Removed omnipause --- .config/VSCodium/User/settings.json | 5 +- .config/awesome/desktop/rc.lua | 14 +-- .config/awesome/rc.lua | 3 +- .config/btop/btop.conf | 5 +- .config/sx/sxrc | 2 +- .local/bin/omnipause | 129 ---------------------------- README.md | 1 - 7 files changed, 15 insertions(+), 144 deletions(-) delete mode 100755 .local/bin/omnipause diff --git a/.config/VSCodium/User/settings.json b/.config/VSCodium/User/settings.json index 73ab011b..8c877ea7 100644 --- a/.config/VSCodium/User/settings.json +++ b/.config/VSCodium/User/settings.json @@ -9,7 +9,6 @@ "terminal.integrated.cursorStyle": "line", "security.workspace.trust.untrustedFiles": "open", "explorer.confirmDragAndDrop": false, - "python.formatting.provider": "yapf", "python.formatting.yapfArgs": [ "--style", @@ -61,7 +60,6 @@ "[markdown]": { "editor.defaultFormatter": "yzhang.markdown-all-in-one" }, - "workbench.iconTheme": "material-icon-theme", "json.schemas": [], "workbench.enableExperiments": false, "editor.fontFamily": "JetBrainsMono NF", @@ -110,5 +108,6 @@ } ] }, - "workbench.colorTheme": "Sweet Dracula" + "workbench.colorTheme": "Dracula Soft", + "workbench.iconTheme": "material-icon-theme" } diff --git a/.config/awesome/desktop/rc.lua b/.config/awesome/desktop/rc.lua index 48e9138d..01bdb38b 100644 --- a/.config/awesome/desktop/rc.lua +++ b/.config/awesome/desktop/rc.lua @@ -272,13 +272,13 @@ root.buttons(gears.table.join( -- {{{ Key bindings globalkeys = gears.table.join( - awful.key( {}, "Pause", function () awful.spawn.with_shell("omnipause toggle") end, + awful.key( {}, "Pause", function () awful.spawn.with_shell("playerctl play-pause") end, {description="pause/play", group="media controls"}), - awful.key( {}, "#117", function () awful.spawn.with_shell("omnipause next") end, + awful.key( {}, "#117", function () awful.spawn.with_shell("playerctl next") end, {description="play next", group="media controls"}), - awful.key( {}, "#112", function () awful.spawn.with_shell("omnipause previous") end, + awful.key( {}, "#112", function () awful.spawn.with_shell("playerctl previous") end, {description="play previous", group="media controls"}), --awful.key( {}, "#123", function () volume_widget:inc(5) end ), -- increase volume @@ -289,10 +289,10 @@ globalkeys = gears.table.join( awful.key( {}, "#123", function () awful.spawn.with_shell("pulsemixer --change-volume +5") end ), -- increase volume awful.key( {}, "#122", function () awful.spawn.with_shell("pulsemixer --change-volume -5") end ), -- decrease volume awful.key( {}, "#121", function () awful.spawn.with_shell("pulsemixer --toggle-mute") end ), -- mute - awful.key( {}, "#171", function () awful.spawn.with_shell("omnipause next") end ), -- play next - awful.key( {}, "#173", function () awful.spawn.with_shell("omnipause previous") end ), -- play previous - awful.key( {}, "#174", function () awful.spawn.with_shell("omnipause stop") end ), -- stop - awful.key( {}, "#172", function () awful.spawn.with_shell("omnipause toggle") end ), -- play/pause + awful.key( {}, "#171", function () awful.spawn.with_shell("playerctl next") end ), -- play next + awful.key( {}, "#173", function () awful.spawn.with_shell("playerctl previous") end ), -- play previous + awful.key( {}, "#174", function () awful.spawn.with_shell("playerctl stop") end ), -- stop + awful.key( {}, "#172", function () awful.spawn.with_shell("playerctl play-pause") end ), -- play/pause awful.key( { "Control" }, "#107", function () awful.spawn.with_shell("flameshot gui") end, {description="take region screenshot", group="launcher"}), -- take region screenshot diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 0a046fc3..20607919 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -286,8 +286,7 @@ globalkeys = gears.table.join( awful.key( {}, "#123", function () awful.spawn.with_shell("pulsemixer --change-volume +5") end ), -- increase volume awful.key( {}, "#122", function () awful.spawn.with_shell("pulsemixer --change-volume -5") end ), -- decrease volume awful.key( {}, "#121", function () awful.spawn.with_shell("pulsemixer --toggle-mute") end ), -- mute - - awful.key( {}, "#172", function () awful.spawn.with_shell("omnipause toggle") end ), -- play/pause + awful.key( {}, "#172", function () awful.spawn.with_shell("playerctl play-pause") end ), -- play/pause awful.key( { "Control" }, "#107", function () awful.spawn.with_shell("flameshot gui") end, {description="take region screenshot", group="launcher"}), -- take region screenshot diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf index 1cb4e7d9..d2398b67 100644 --- a/.config/btop/btop.conf +++ b/.config/btop/btop.conf @@ -1,4 +1,4 @@ -#? Config file for btop v. 1.2.6 +#? Config file for btop v. 1.2.7 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" @@ -144,6 +144,9 @@ mem_graphs = True #* Show mem box below net box instead of above. mem_below_net = False +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + #* If swap memory should be shown in memory box. show_swap = True diff --git a/.config/sx/sxrc b/.config/sx/sxrc index c7d1c021..a5ee4adf 100755 --- a/.config/sx/sxrc +++ b/.config/sx/sxrc @@ -3,4 +3,4 @@ runsvdir ~/.runit/runsvdir & /usr/bin/pipewire-pulse & /usr/bin/pipewire-media-session & -exec awesome +exec dbus-launch --sh-syntax --exit-with-session awesome diff --git a/.local/bin/omnipause b/.local/bin/omnipause deleted file mode 100755 index c43fc033..00000000 --- a/.local/bin/omnipause +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# 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 . - - - -import dbus -import sys -import os -from dbus.mainloop.glib import DBusGMainLoop - - -directory = '/tmp/omniPause' -players = [] -DBusGMainLoop(set_as_default=True) -bus = dbus.SessionBus() - -def do_nothing(*args, **kwargs): - pass - -def get_player_name(i, player): - if i.startswith("org.mpris.MediaPlayer2."): - return i[len("org.mpris.MediaPlayer2."):] - else: - return player.Get('org.mpris.MediaPlayer2','DesktopEntry', dbus_interface='org.freedesktop.DBus.Properties') - - -def pause(): - player_names = [] - for i in players: - player = bus.get_object(i, '/org/mpris/MediaPlayer2') - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Playing': - player_name = get_player_name(i, player) - player_names.append(player_name) - player.Pause(dbus_interface='org.mpris.MediaPlayer2.Player', reply_handler=do_nothing, error_handler=do_nothing) - - if player_names != []: - for i in os.listdir(directory+'/paused-players/'): - os.remove(directory+'/paused-players/'+i) - for player_name in player_names: - player_status_file = open(directory+'/paused-players/'+player_name, "w") - player_status_file.close() - -def play(): - for i in os.listdir(directory+'/paused-players/'): - try: - player = bus.get_object('org.mpris.MediaPlayer2.'+i, '/org/mpris/MediaPlayer2') - except: - if i in os.listdir(directory+'/paused-players'): - os.remove(directory+'/paused-players/'+i) - continue - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Paused': - player.Play(dbus_interface='org.mpris.MediaPlayer2.Player', reply_handler=do_nothing, error_handler=do_nothing) - if i in os.listdir(directory+'/paused-players'): - os.remove(directory+'/paused-players/'+i) - -def stop(): - for i in players: - player = bus.get_object(i, '/org/mpris/MediaPlayer2') - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Playing' or player_status == 'Stopped': - player.Stop(dbus_interface='org.mpris.MediaPlayer2.Player', reply_handler=do_nothing, error_handler=do_nothing) -def toggle(): - playing = False - for i in players: - player = bus.get_object(i, '/org/mpris/MediaPlayer2') - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Playing': - playing = True - if playing: - pause() - else: - play() -def next(): - for i in players: - player = bus.get_object(i, '/org/mpris/MediaPlayer2') - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Playing': - player.Next(dbus_interface='org.mpris.MediaPlayer2.Player', reply_handler=do_nothing, error_handler=do_nothing) -def previous(): - for i in players: - player = bus.get_object(i, '/org/mpris/MediaPlayer2') - player_status = player.Get('org.mpris.MediaPlayer2.Player','PlaybackStatus', dbus_interface='org.freedesktop.DBus.Properties') - if player_status == 'Playing': - player.Previous(dbus_interface='org.mpris.MediaPlayer2.Player', reply_handler=do_nothing, error_handler=do_nothing) - -def getPlayerList(): - for i in bus.list_names(): - if i.startswith("org.mpris.MediaPlayer2."): - players.append(i) - -if not os.path.isdir(directory): - os.makedirs(directory) - if not os.path.isdir(directory+'/players'): - os.makedirs(directory+'/players') - if not os.path.isdir(directory+'/paused-players'): - os.makedirs(directory+'/paused-players') - - -if len(sys.argv)-1 == 1: - getPlayerList() - if sys.argv[1] == 'pause': - pause() - elif sys.argv[1] == 'play': - play() - elif sys.argv[1] == 'stop': - stop() - elif sys.argv[1] == 'next': - next() - elif sys.argv[1] == 'previous': - previous() - elif sys.argv[1] == 'toggle': - toggle() - else: - print("Error: Valid commands to "+sys.argv[0]+"are: pause, play, stop, next, previous, or toggle") -else: - print("Usage: "+sys.argv[0]+" [pause|play|stop|next|previous|toggle]") diff --git a/README.md b/README.md index b65a9515..5a9fcbb6 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,3 @@ ## Credits - [lfimg by cirala](https://github.com/cirala/lfimg) -- [omnipause by mel00010](https://github.com/mel00010/OmniPause) \ No newline at end of file