config & constants: Use constants for default locations.
This commit is contained in:
parent
ea9ac49fed
commit
77adfe9d6f
2 changed files with 10 additions and 20 deletions
|
@ -20,27 +20,10 @@ module Qasim
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
|
||||||
user = if ENV['USER'] then
|
|
||||||
ENV['USER']
|
|
||||||
else
|
|
||||||
raise "Environment variable 'USER' is missing!"
|
|
||||||
end
|
|
||||||
|
|
||||||
home_dir = if ENV['HOME'] then
|
@mnt_dir = File.join ENV['HOME'], "mnt"
|
||||||
ENV['HOME']
|
|
||||||
else
|
|
||||||
"/home/" + user
|
|
||||||
end
|
|
||||||
|
|
||||||
xdg_dir = if ENV['XDG_CONFIG_HOME'] then
|
@config_dir = APP_CONFIG_DIR
|
||||||
ENV['XDG_CONFIG_HOME']
|
|
||||||
else
|
|
||||||
home_dir + '/.config'
|
|
||||||
end
|
|
||||||
|
|
||||||
@mnt_dir = File.join home_dir, "mnt"
|
|
||||||
|
|
||||||
@config_dir = xdg_dir + '/sshfs-mapper'
|
|
||||||
@config_file = nil
|
@config_file = nil
|
||||||
@maps = []
|
@maps = []
|
||||||
@initialize_enable = false
|
@initialize_enable = false
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
module Qasim
|
module Qasim
|
||||||
APP_ICON_PATH = File.join QASIM_INCLUDE_DIR, "icons"
|
APP_ICON_PATH = File.join QASIM_INCLUDE_DIR, "icons"
|
||||||
APP_SYSCONFIG_DIR = "/etc/qasim/maps.d"
|
|
||||||
APP_NAME = "Qasim"
|
APP_NAME = "Qasim"
|
||||||
APP_VERSION = "0.1"
|
APP_VERSION = "0.1"
|
||||||
|
|
||||||
|
APP_SYSCONFIG_DIR = "/etc/qasim/maps.d"
|
||||||
|
|
||||||
|
APP_CONFIG_DIR = if ENV['XDG_CONFIG_HOME'] then
|
||||||
|
File.join ENV['XDG_CONFIG_HOME'], 'qasim'
|
||||||
|
else
|
||||||
|
File.join ENV['HOME'], '.config', 'qasim'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue