Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed volume buttons, mute, and brightness #61

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ These will improve the user experience but aren't required:
## Installation ##
1. Ensure all [dependencies](#dependencies) are met
2. Clone this repository and place its contents into your `.config` folder
3. edit the `awesome/rc.lua` file to select your theme, and define your desired default and startup applications, as well as network interfaces
4. navigate to the `awesome/wallpaper` folder and place your desired wallpaper there, ensuring that it is named either `wallpaper.jpg` if using the pastel theme, or `mirage.png` if using the mirage theme. Remember to delete the `blurredWallpaper` file in order to make the blurring script recognize a new wallpaper has been added and needs to be blurred
5. optional: edit the `keys.lua` file to change / add keybinds
3. Edit the `awesome/rc.lua` file to select your theme, and define your desired default and startup applications, as well as network interfaces
4. Execute `sudo chmod +x ~/.config/awesome/components/toggle_mute.sh` to make sure that the mute button works
5. Navigate to the `awesome/wallpaper` folder and place your desired wallpaper there, ensuring that it is named either `wallpaper.jpg` if using the pastel theme, or `mirage.png` if using the mirage theme. Remember to delete the `blurredWallpaper` file in order to make the blurring script recognize a new wallpaper has been added and needs to be blurred
6. (Optional): Edit the `keys.lua` file to change / add keybinds

<a name="folderStructure"></a>
## Awesome Folder File Structure ##
Expand Down
2 changes: 2 additions & 0 deletions awesome/components/toggle_mute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
amixer set Master toggle
amixer set Speaker unmute
2 changes: 1 addition & 1 deletion awesome/components/volume-adjust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ awesome.connect_signal("volume_change",
function()
-- set new volume value
awful.spawn.easy_async_with_shell(
"amixer sget Master | grep 'Right:' | awk -F '[][]' '{print $2}'| sed 's/[^0-9]//g'",
"amixer get Master | grep -E -o '[0-9]{1,3}%' | tr -d '%'",
function(stdout)
local volume_level = tonumber(stdout)
volume_bar.value = volume_level
Expand Down
14 changes: 7 additions & 7 deletions awesome/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,35 +157,35 @@ keys.globalkeys = gears.table.join(
-- Brightness
awful.key({}, "XF86MonBrightnessUp",
function()
awful.spawn("xbacklight -inc 10", false)
awful.spawn("brightnessctl s 5%+", false)
end,
{description = "+10%", group = "hotkeys"}
{description = "+5%", group = "hotkeys"}
),
awful.key({}, "XF86MonBrightnessDown",
function()
awful.spawn("xbacklight -dec 10", false)
awful.spawn("brightnessctl s 5%-", false)
end,
{description = "-10%", group = "hotkeys"}
{description = "-5%", group = "hotkeys"}
),

-- ALSA volume control
awful.key({}, "XF86AudioRaiseVolume",
function()
awful.spawn("amixer -D pulse sset Master 5%+", false)
awful.spawn("amixer set Master 5%+", false)
awesome.emit_signal("volume_change")
end,
{description = "volume up", group = "hotkeys"}
),
awful.key({}, "XF86AudioLowerVolume",
function()
awful.spawn("amixer -D pulse sset Master 5%-", false)
awful.spawn("amixer set Master 5%-", false)
awesome.emit_signal("volume_change")
end,
{description = "volume down", group = "hotkeys"}
),
awful.key({}, "XF86AudioMute",
function()
awful.spawn("amixer -D pulse set Master 1+ toggle", false)
os.execute("/home/$USER/.config/awesome/components/toggle_mute.sh")
awesome.emit_signal("volume_change")
end,
{description = "toggle mute", group = "hotkeys"}
Expand Down