Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-02-28 09:16:27

youni
Member
Registered: 2023-02-28
Posts: 10

Keyboard Shortcut for Open xfce4-terminal and Run Alias

Hello, dear xfce users!
I have an alias for alarm on 10 o'clock:
alias w
alias w='while [ ! `date -d +3sec +%H` -eq "10" ]; do date; sleep 1; clear; done; mpg123 "/home/user/music/titiyo-come-along.mp3" volume=40'

I wish to start this alias with 'audio mute button': clicking on 'aufio mute button' should run xfce-terminal window, where I see current time, and it starts music at 10 o'clock.
I cannot figure out which command should be. These dont work:
xfce4-terminal -x w
xfce4-terminal -x 'bash -i "w"'
xfce4-terminal -x 'while [ ! `date -d +3sec +%H` -eq "10" ]; do date; sleep 1; clear; done; mpg123 "/home/user/music/titiyo-come-along.mp3" volume=40'

Please, can you advise, how to run xfce4-terminal and run alias there?

Offline

#2 2023-02-28 09:34:04

youni
Member
Registered: 2023-02-28
Posts: 10

Re: Keyboard Shortcut for Open xfce4-terminal and Run Alias

I found that need to use 'bash -c'
This is my command for Keyboard shortcut:
xfce4-terminal -x bash -c 'while [ ! `date -d +3sec +%H` -eq "10" ]; do date; sleep 1; clear; done; mpg123 "/home/user/music/titiyo-come-along.mp3" volume=40'

This command runs window of xfce4-terminal, and run my alarm command.
But also it would be great if i learn how to use aliases here. This way to load alises does not work:
xfce4-terminal -x bash -c 'source /home/user/.bashrc; w'
-- this only run a window for 0.0001 sec and closes it straight away.

Offline

#3 2023-02-28 12:16:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Keyboard Shortcut for Open xfce4-terminal and Run Alias

Bash aliases only work in interactive mode. Try something like this:

xfce4-terminal -x bash -i -c w

Note, you might want to use something other than "w", as it is already a valid command.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2023-03-22 06:14:15

youni
Member
Registered: 2023-02-28
Posts: 10

Re: Keyboard Shortcut for Open xfce4-terminal and Run Alias

yes, this works. yes, changed alias to 'z'.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 554.23 KiB (Peak: 621.53 KiB) ]