change volume command to reduce cpu usage

This commit is contained in:
purhan 2020-09-03 13:32:07 +05:30
parent 3f01ea9db3
commit 571af14713
16 changed files with 89 additions and 51 deletions

View file

@ -175,6 +175,6 @@ parse_git_branch() {
# git rev-parse --abbrev-ref HEAD 2> /dev/null | sed -e 's/.*\/\(.*\)/\1/'
}
PS1="\[\e[1;49;34m\]@\u\[\e[00m\]\[\e[01;49;39m\]\[\e[00m\] \[\e[1;49;31m\]\W\[\e[0m\]"
PS1+=" (git: \e[1;50;32m\]\$(parse_git_branch)\[\033[34m\]\$(parse_git_dirty)\[\033[00m\])"
PS1+="\n\`if [ \$? = 0 ]; then echo \[\e[32m\]; else echo \[\e[31m\]; fi\` ➜\[\e[0m\] "
PS1+=" (git: \e[1;50;35m\]\$(parse_git_branch)\[\033[34m\]\$(parse_git_dirty)\[\033[00m\])"
PS1+="\n \[\033[32m\]➜\[\e[0m\] "
export PS1

View file

@ -11,8 +11,8 @@
# is intended to be a copy of this file
# to allow out of tree autostart programs
APPS=(
keepassxc
kdeconnect-indicator
# keepassxc
# kdeconnect-indicator
radeon-profile
$HOME/.config/awesomestart
)

View file

@ -1,5 +1,5 @@
corner-radius = 8.0;
round-borders = 1;
# corner-radius = 8.0;
# round-borders = 1;
# Shadow
shadow = true;

View file

@ -160,15 +160,18 @@ awful.key({}, 'XF86MonBrightnessUp',
awful.key({}, 'XF86MonBrightnessDown',
function() awful.spawn('xbacklight -dec 10') end,
{description = '-10%', group = 'hotkeys'}), -- ALSA volume control
awful.key({}, 'XF86AudioRaiseVolume',
function() awful.spawn('amixer -D pulse sset Master 5%+') end,
{description = 'volume up', group = 'hotkeys'}),
awful.key({}, 'XF86AudioLowerVolume',
function() awful.spawn('amixer -D pulse sset Master 5%-') end,
{description = 'volume down', group = 'hotkeys'}),
awful.key({}, 'XF86AudioMute',
function() awful.spawn('amixer -D pulse set Master 1+ toggle') end,
{description = 'toggle mute', group = 'hotkeys'}),
awful.key({}, 'XF86AudioRaiseVolume', function()
awful.spawn('amixer -D pulse sset Master 5%+')
_G.update_volume()
end, {description = 'volume up', group = 'hotkeys'}),
awful.key({}, 'XF86AudioLowerVolume', function()
awful.spawn('amixer -D pulse sset Master 5%-')
_G.update_volume()
end, {description = 'volume down', group = 'hotkeys'}),
awful.key({}, 'XF86AudioMute', function()
awful.spawn('amixer -D pulse set Master 1+ toggle')
_G.update_volume()
end, {description = 'toggle mute', group = 'hotkeys'}),
awful.key({}, 'XF86AudioNext', function()
--
end, {description = 'toggle mute', group = 'hotkeys'}),

View file

@ -55,8 +55,8 @@ end)
_G.tag.connect_signal('property::layout', function(t)
local currentLayout = awful.tag.getproperty(t, 'layout')
if (currentLayout == awful.layout.suit.max) then
t.gap = 4
t.gap = 2
else
t.gap = 4
t.gap = 2
end
end)

View file

@ -5,7 +5,6 @@
-- @copyright 2008 Julien Danjou
-- @module awful.layout
---------------------------------------------------------------------------
-- Grab environment we need
local pairs = pairs
@ -44,9 +43,7 @@ end
--- Maximized layout.
-- @clientlayout awful.layout.suit.max.name
max.name = 'max'
function max.arrange(p)
return fmax(p, false)
end
function max.arrange(p) return fmax(p, false) end
function max.skip_gap(nclients, t) -- luacheck: no unused args
return true
end

View file

@ -316,6 +316,8 @@ local fortune_update_interval = 3600
local fortune = wibox.widget {
font = "Roboto 11",
text = "You so poor you don't even have a cookie yet...",
align = 'center',
valign = 'center',
widget = wibox.widget.textbox
}

View file

@ -1,3 +1,4 @@
local awful = require("awful")
local wibox = require('wibox')
local mat_list_item = require('widget.material.list-item')
local dpi = require('beautiful').xresources.apply_dpi
@ -7,12 +8,16 @@ local percentage = wibox.widget.textbox()
percentage.align = 'center'
percentage.valign = 'center'
watch([[bash -c "amixer -D pulse sget Master"]], 0, function(_, stdout)
local mute = string.match(stdout, '%[(o%D%D?)%]')
local volume = string.match(stdout, '(%d?%d?%d)%%')
percentage.text = volume
collectgarbage('collect')
end)
function update_volume()
awful.spawn.easy_async("amixer -D pulse sget Master", function(stdout)
local mute = string.match(stdout, '%[(o%D%D?)%]')
local volume = string.match(stdout, '(%d?%d?%d)%%')
percentage.text = volume
collectgarbage('collect')
end)
end
update_volume()
local volume_setting = wibox.widget {
percentage,

View file

@ -3,9 +3,8 @@ update_info=spectacle_newConfig.upd:spectacle-new-config
[GuiConfig]
captureDelay=5
onClickChecked=true
window-position=195,198
window-position=195,191
[Save]
lastSaveAsLocation=file:///home/purhan/Pictures/Screenshot_20200828_110348.png
lastSaveLocation=file:///home/purhan/Pictures/Screenshot_20200828_123321.png
lastSaveAsLocation=file:///home/purhan/Pictures/Screenshot_20200902_180730.png
lastSaveLocation=file:///home/purhan/Pictures/Screenshot_20200902_192003.png

View file

@ -0,0 +1,24 @@
{
"target": "terminus_open",
"cancel": "terminus_cancel_build",
"title": "Terminal",
"auto_close": false,
"timeit": true,
"post_window_hooks": [["carry_file_to_pane", { "direction": "down" }]],
"focus": false,
"cmd": [
"bash",
"-c",
"g++ -std=c++17 -Wall -Wextra -Wshadow -fsanitize=undefined '${file}' -o '${file_path}/compiled'.o && tput setaf 2 && TIMEFORMAT='\nExecution Time: %R' && time timeout 5s '${file_path}/compiled.o' < input.txt && unset TIMEFORMAT"
],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants": [
{
"name": "Run"
}
]
}

View file

@ -1,4 +1,4 @@
{
"last-modified": "Sun, 30 Aug 2020 14:10:04 GMT",
"etag": "\"5f4bb33c-57eb1\""
"etag": "\"5f4f616c-58076\"",
"last-modified": "Wed, 02 Sep 2020 09:10:04 GMT"
}

View file

@ -1 +1 @@
1598796846
1599037988

View file

@ -9,7 +9,7 @@ UseFontLineChararacters=false
CursorShape=1
[General]
Command=/usr/bin/zsh
Command=/bin/bash
LocalTabTitleFormat=
Name=Profile 2
Parent=FALLBACK/

View file

@ -160,15 +160,18 @@ awful.key({}, 'XF86MonBrightnessUp',
awful.key({}, 'XF86MonBrightnessDown',
function() awful.spawn('xbacklight -dec 10') end,
{description = '-10%', group = 'hotkeys'}), -- ALSA volume control
awful.key({}, 'XF86AudioRaiseVolume',
function() awful.spawn('amixer -D pulse sset Master 5%+') end,
{description = 'volume up', group = 'hotkeys'}),
awful.key({}, 'XF86AudioLowerVolume',
function() awful.spawn('amixer -D pulse sset Master 5%-') end,
{description = 'volume down', group = 'hotkeys'}),
awful.key({}, 'XF86AudioMute',
function() awful.spawn('amixer -D pulse set Master 1+ toggle') end,
{description = 'toggle mute', group = 'hotkeys'}),
awful.key({}, 'XF86AudioRaiseVolume', function()
awful.spawn('amixer -D pulse sset Master 5%+')
_G.update_volume()
end, {description = 'volume up', group = 'hotkeys'}),
awful.key({}, 'XF86AudioLowerVolume', function()
awful.spawn('amixer -D pulse sset Master 5%-')
_G.update_volume()
end, {description = 'volume down', group = 'hotkeys'}),
awful.key({}, 'XF86AudioMute', function()
awful.spawn('amixer -D pulse set Master 1+ toggle')
_G.update_volume()
end, {description = 'toggle mute', group = 'hotkeys'}),
awful.key({}, 'XF86AudioNext', function()
--
end, {description = 'toggle mute', group = 'hotkeys'}),

View file

@ -1,3 +1,4 @@
local awful = require('awful')
local wibox = require('wibox')
local mat_list_item = require('widget.material.list-item')
local dpi = require('beautiful').xresources.apply_dpi
@ -7,12 +8,16 @@ local percentage = wibox.widget.textbox()
percentage.align = 'center'
percentage.valign = 'center'
watch([[bash -c "amixer -D pulse sget Master"]], 0, function(_, stdout)
local mute = string.match(stdout, '%[(o%D%D?)%]')
local volume = string.match(stdout, '(%d?%d?%d)%%')
percentage.text = volume
collectgarbage('collect')
end)
function update_volume()
awful.spawn.easy_async("amixer -D pulse sget Master", function(stdout)
local mute = string.match(stdout, '%[(o%D%D?)%]')
local volume = string.match(stdout, '(%d?%d?%d)%%')
percentage.text = volume
collectgarbage('collect')
end)
end
update_volume()
local volume_setting = wibox.widget {
percentage,